FreeRTOS & EA LPC3131
Hi
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?
FreeRTOS & EA LPC3131
Check that the startup code does not have an unterminated comment in it that prevents the data abort stack being setup correctly.
msr CPSR_c, #MODE_UND|I_BIT|F_BIT /* Undefined Instruction Mode
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.
Regards.
FreeRTOS & EA LPC3131
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
Thanks for the tips.
FreeRTOS & EA LPC3131
Hi!
I also have this EA LPC3131 board and am actively developing on it.
I would be interested in contributing to refining this port of FreeRTOS to this platform.
Are you looking for a contributor?
Kind regards,
Jean-Pierre Poulin
FreeRTOS & EA LPC3131
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
Richard
FreeRTOS & EA LPC3131
(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
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