I have _just_ got FreeRTOS V5.1.2 running on my EA LPC3131 devboard, it’s a bit of a hack but the vLEDFlashTask task now runs and the GPIO_BOOT2 LED blinks!!!
I noticed that it does not run with the configUSE_PREEMPTION flag set to ‘1’. The code crashes somewhere in/after the first timer interrupt with an Abort Exception but LR_ABT is garbage (actually, some addy in uninitialized RAM) so I’m lost in Hyperspace Has anyone else seen this behavior on ARM9?
is the offending line. This has just been fixed in SVN.
Also, are you vectoring directly to the peripheral handler, or through a common IRQ entry point. This effects the code required.
Have you also checked for stack overflows?
Does the tick interrupt work ok when you are using co-operative mode? When using pre-emptive mode the entry/exit from the IRQ needs to be different in order to save and restore the task context. Check the examples for other ARM7/9 GCC demos for how this is done.
The LPC313x uses Vectored interrupts, so I have one IRQ (and one FIQ) handler that checks a reg for the Idx of the interrupt that fired. The IRQ and FIQ handlers are "naked" but the specific handlers are not.
Anyway, turns out I was calling portSAVE_CONTEXT/portRESTORE_CONTEXT in the IRQ handler AND in vPreemptiveTick() - the vNonPreemptiveTick() function does not have this. Removing the portSAVE_CONTEXT/portRESTORE_CONTEXT from the vPreemptiveTick() function solves the problem & the pre-emptive version works now
I’m starting on an lpc3131 port also. have it ticking and “maybe” context switching - just starting to run tests. would like to see how you did yours. any chance we could share thought/code?
Richard
(hate to whine in blogs, but i could use a clue on this one)
Anybody have any luck using the nxp lpc313x_***_driver.c files? I am thinking it would be better to write new ones, since a timer tick and a context switch seem to be the only “system” functions needed. Timer tick is simple but i have a question regarding use mode vs service mode. I assume that “you guys” are running in service mode, since the examples i have looked at do things like enable/disable interrupts in the RTOS code. Otherwise i think i would have to wrap the enable/disable up in a SWI call.
Are you using IAR, GCC or Keil toolchains? I am using Keil MDK.
Thanks for any comments,
Richard