We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
But I was wonder, for SVC handler, the beginning still needs around 4 lines of inline assembly. How does this fact support the claim "entirely C"?
What 4 lines of inline assembly are you referring to? If you mean the code needed to pass parameters from the Supervisor call to the SVC mode interrupt handler, then the ARM Compiler offers the __svc keyword which defines a SuperVisor Call (SVC) function taking up to four integer-like arguments and returning up to four results in a value_in_regs structure.
In the beginning of SVC handler, we need to test LR, if the stacking was done using MSP or PSP. This contains basically 4 assembly instructions.