I am working with LPC1768 with Keil realview MDK ARM V4.01. When iam using "__asm" keyword in my code for IENABLE,IDISABLE macros (to switch between sys mode and irq mode), it is generating a compilation error as "Inline assembler not permitted when generating Thumb code". these two macros i wish to use. #define IENABLE __asm { MRS sysreg, SPSR; MSR CPSR_c, #SYS32Mode }//__asm { MRS sysreg, SPSR; MSR CPSR_c, #SYS32Mode } #define IDISABLE __asm { MSR CPSR_c, #(IRQ32Mode|I_Bit); MSR SPSR_cxsf, sysreg }
please suggest regarding this.
I was just testing a piece of code found on the forum ST's STM32 section. I know that is not good to use printf in hard fault section, but it was only a test. However, I find the code for Keil, who still gives me other errors, but I think I'm going OT.