I would like to reserve R12 for my application in Thumb mode, but I don't know how to make it with Keil uVisionV5. GCC has -ffixed-reg (don't know if or how it works). I am compiling now for Arm Cortex M7. Doe's compiled c code use upper registers R8..R12 at all or when they are used.
infocenter.arm.com/.../IHI0042F_aapcs.pdf
This might help: www.keil.com/.../armcc_chr1359124967427.htm but it can only be used for r4 to r11
Hello Markku,
To better answer your question, can you say why you want the compiler from using R12 for part of your code?
If you plan to use any of the ARM libraries in your project, it will be difficult to block out R12, since it is used as a scratch register.
Also, I did not understand when you said run in thumb mode - a cortex M-7 uses the Thumb2 instruction set, so does not have ARM mode and Thumb mode.
"The Cortex-M7 processor implements a version of the Thumb® instruction set based on Thumb-2 technology, ensuring high code density and reduced program memory requirements. The Cortex-M7 processor instruction set provides the exceptional performance expected of a modern 32-bit architecture, with the high code density of 8-bit and 16-bit microcontrollers."
developer.arm.com/.../about-the-cortex-m7-processor-and-core-peripherals