cancel
Showing results for 
Search instead for 
Did you mean: 

Enable/Disable Global Interrupts

sjackson
Associate II
Posted on September 04, 2007 at 20:02

Enable/Disable Global Interrupts

11 REPLIES 11
mark9
Associate II
Posted on May 17, 2011 at 09:44

Why are you using USER mode in main()? If you are using the default STR library, main runs from SYS mode. Look at 91x_init.s and ignore the comments (I hate comments like this. Most of the 91x library is littered with bad comments that are flat out wrong or misleading).

; --- Now change to USR/SYS mode and set up User mode stack,

MSR CPSR_c, #Mode_SYS ; IRQs & FIQs are now enabled

LDR SP, = SFE(CSTACK) & 0xFFFFFFF8

-Mark

sarao
Associate II
Posted on May 17, 2011 at 09:44

This was not intentional. I am using startup code supplied by Keil with a demo board supplied by them as well.

From their STR91x.s

 

MSR CPSR_c, #Mode_USR

 

MOV SP, R0

 

SUB SL, SP, #USR_Stack_Size

 

IMPORT __main

 

LDR R0, =__main

 

BX R0