LPC2378 HELP! __disable_interrupt()

Hi, Im trying to make FreeRTOS run on a LPC2378 (KEIL MCB2300 board). I have used the ARM7_LPC2129_IAR examlpe to get started. Now I am having some trouble with the __disable_interrupt() from IAR. When I debug troug the code I always end up in an infinite loop in __disable_interrupt(). Does anyone know what can be wrong? Best regards, Peter Vesterby

LPC2378 HELP! __disable_interrupt()

Which compiler are you using?  If you are using the Keil tools, then are you using the original Keil compiler or the Realview compiler? If Keil, then look at the existing Keil port for hints. If Realview then you can use: #define portDISABLE_INTERRUPTS()    __disable_irq() #define portENABLE_INTERRUPTS()        __enable_irq()

LPC2378 HELP! __disable_interrupt()

Sorry, I use the IAR Embedded Workbench, so the names should be right! The __disable_interrupt() is only to be called from supervisor mode. Can you tell me how FreeRTOS changes between user an supervisor mode?? /Peter

LPC2378 HELP! __disable_interrupt()

The kernel runs in Supervisor mode.  Tasks run in System mode.  Therefore you can call the enable/disable functions ok.

LPC2378 HELP! __disable_interrupt()

Yes but where/how does FreeRTOS changes between modes? /Peter

LPC2378 HELP! __disable_interrupt()

SWI is used within API calls when a context switch is required.  Also a mode switch occurs within the tick interrupt. Regards.

LPC2378 HELP! __disable_interrupt()

Ok, thanks. My problem is when debugging with J-Link, I can see the mode is ‘10000’ (usermode) after running the cstartup.s79 ! It sholud be in supervisor mode according to this line from the startupfile: ; Must start in supervisor mode. MSR     CPSR_c, #SVC_MODE|I_Bit|F_Bit /Peter