This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What does it mean to say "ARM Cortex-M processors are entirey C programmable"?

Hi,

Being new to the fascinating ARM world, I am going through various documentation and reading material.

I read that the ARM Cortex-M processors (or I think it applies to all the Cortex processors) are entirely C programmable. This means that assembly code is not required for start-up code and for ISRs.

I am curious to find out what prohibits the earlier ARM processors (or even other architectures) to write the start-up code in C? Are these any specific instructions? One which I found was the WFI (Wait For Interrupt) which can't have an equivalent in C. But that is not a start-up or ISR instruction.

Thanks for your support !

Gopal

Parents
  • yasuhikokoumoto's answer is correct. -The ARM7 requires instructions in the interrupt vectors (plus it requires a bunch of register setup if you use the FIQ interrupt and setup of stack pointers for each interrupt mode you use).

    You should know that all the necessary assembly instructions for Cortex-M that you would need, are already available through the CMSIS API.

    For instance, __REV(), __WFI(), __WFE(), __SEV(), __ISB(), __DSB(), __DMP() - yes even __NOP() are all available, so you do not need to use the asm directive - there are many more, see your favourite device's core_cmInstr.h for the complete list.

    -But you can of course still write code in assembly language if you wish, and in some cases you may benefit from doing so.

    In general, I would recommend to stick to C, because it's easier to change quickly and it's also easier to make your code portable to other Cortex-M (or even Cortex-A) platforms.

Reply
  • yasuhikokoumoto's answer is correct. -The ARM7 requires instructions in the interrupt vectors (plus it requires a bunch of register setup if you use the FIQ interrupt and setup of stack pointers for each interrupt mode you use).

    You should know that all the necessary assembly instructions for Cortex-M that you would need, are already available through the CMSIS API.

    For instance, __REV(), __WFI(), __WFE(), __SEV(), __ISB(), __DSB(), __DMP() - yes even __NOP() are all available, so you do not need to use the asm directive - there are many more, see your favourite device's core_cmInstr.h for the complete list.

    -But you can of course still write code in assembly language if you wish, and in some cases you may benefit from doing so.

    In general, I would recommend to stick to C, because it's easier to change quickly and it's also easier to make your code portable to other Cortex-M (or even Cortex-A) platforms.

Children
No data