0
votes

Sadly I'm forced to use and obscure microcontroller based on ARM Cortex-M1 core. I just found out that the latest CMSIS (5.2) does not support it and official CMSIS docs say this:

CMSIS supports the complete range of Cortex-M processors (with exception of Cortex-M1) and the ARMv8-M architecture including security extensions.

I guess Cortex-M1 is not very popular. But what should I do without CMSIS? My vendor ships support package which strangely enough includes CMSIS files for this core, namely, core_cm1.h; it's full of ARM copyrights and does not appear to be written directly by said vendor. File comment lists CMSIS version V3.20 from 25 February 2013. But I can't find it anywhere else, neither in higher versions of CMSIS nor in lower.

In "Definitive Guide to the ARM Cortex-M0" by Joseph Yiu I found this quote:

There is also a small chance that the software needs minor adjustment because of execution timing differences. At the time of writing, no CMSIS software package is available for the Cortex-M1. However, you can use the same CMSIS files for the Cortex-M0 on Cortex-M1 programming, because they are based on the same version of the ARMv6-M architecture.

I diffed core_cm0.h from CMSIS 4.0 and core_cm1.h from my vendor and found only very minor differences (like, 1 << smthn became 1u << smthn in a couple of places). Than I diffed core_cm0.h from CMSIS 5.0.2 and core_cm1.h from my vendor and found a lot of differences, structs are different, inline functions for NVIC are different and so on.

So my question is: is it really safe to use core_cm0 for Cortex-M1 even for latest CMSIS? Or should I play it safe and stick to my vendor's files (even though I have no idea where did it get them)?

2
Are you really using an "M1 microcontroller" - who makes such a thing? M1 is a soft-core for FPGA's - Clifford
Your vendor has probably just supplied and older version of the M0 CMSIS. In the CMSIS core not much will have changed for ARMv6-M. Since it is all provided as source you are equipped to verify that the parts you need are correct for your target. The only reason there is no Cortex-M1 CMSIS I would guess is because M1 is a soft-core IP for FPGAs and implementations may differ since there are a number of vendor selected options. I would use the vendor supplied files, as they will presumambly match the silicon options they have selected for the part, - Clifford
@Clifford, weell.. it's actually a bit fishy. Vendor does not officially say that this is a Cortex-M1. Officially it's a "high performance RISC core" but as I said in the question, it is shipped with files for M1, I supposed to use armcc and so on. I guess you are right and I should just use vendor supplied files. - Amomum
@old_timer, we are just starting to use this particular chip, so non of my coworkers know anything about it. But reimplementing all the register-defines by hand from manual when it was already done in cmsis is pure madness. - Amomum
@SeanHoulihane I can but I'm afraid it's in russian since it's actually a russian military mcu. Here's the link ic.milandr.ru/upload/iblock/3bb/… - Amomum

2 Answers

1
votes

You can use the Cortex-M0 CMSIS-CORE header on Cortex-M1. There are couple of things you need to be aware: - WFI, WFE and SEV instructions are not available in Cortex-M1. - Cortex-M1 has an auxiliary control register for I-TCM enable control. You need to declare that manually if you need to switch I-TCM enable. - CPU ID register has different value - Instruction execution timings are different - Interrupt latency is not constant.

There is a lot of code changes from CMSIS-CORE 4 to CMSIS-CORE 5. But those changes are focus on supporting of additional tools, general coding styles and for future extension of CMSIS. Hope this helps.

0
votes

Cortex-M1 is very similar to Cortex-M0 from a software point of view. At the CMSIS level, using core_cm0.h (latest CMSIS) will work fine.

You might also find compiler switches don't support Cortex-M1 - in this case treat it as if it were M0.