2008-12-07 08:27 PM
2008-12-04 09:09 PM
Hello,
just another question, in der IAR Docu is stated:Quote:
All interrupt functions must be compiled in ARM mode; if you are using
Thumb mode, use the __arm extended keyword or the #pragma type_attribute=__arm directive to alter the default behavior. In the ST-Firmware (71x_it.c) the IRS are without __arm. What is the difference, what exactly could go wrong without this? Thanks, Steffen2008-12-05 10:09 PM
In short, nothing will go wrong if you compile interrupt functions in THUMB mode.
The confusion comes from the use of the term 'interrupt function.' It could mean a number of things. Apparently, the IAR mannual implies that the 'interrupt function' is called directly by the CPU to process an exception. As we know, the ARM CPU starts to process an exception handler in ARM mode. In contrast, the support code from ST for STR71x MCUs uses wrappers in assembly language for each ISR. Among other things, those wrappers automatically switch to THUMB mode if required (using the BX instruction.) The wrappers are in the file 71x_vect.s. Hence, the 'interrupt functions' can be compiled either in ARM or in THUMB mode. To be honest, I never liked the way 71x_vect.s does this. The code is too long and complicated. The fundamental reason for this is the stupid design of the EIC - the 'enhanced interrupt controller' in STR7x. I use my own wrapper which is much shorter and most likely faster. Regards, - mike2008-12-07 08:27 PM
Hello Mike,
thanks for your reply, it's very helpful. Steffen