I’m working on getting my LPC2368 development board running with FreeRTOS 5.0.2. I’ve used FreeRTOS in the past with an AT91SAM7XC256 with ease, mostly because the work was already done :). I see that there are ports available for this processor, just not for this compiler. I have a Keil MCB2300 development board that IAR has a demo project for. This demo project works just fine. I’ll list the steps I performed trying to get this working.
* I started with the LPC2129 IAR FreeRTOS project.
* I changed the ICF and startup.s files to what IAR supplied for the MCB2300 board, these files work fine in my demo application.
* I included LPC230x.h header file instead of the 2129 file. This required a few semantic changes in the project; mainly IO1CLR to IOCLR1 and the like. This file was provided by IAR and I’m using it in my other application.
* I changed the core under options to a 2368 instead of the 2129.
* I also changed the processor speed in FreeRTOSConfig.h to 57600000.
* I’m using the PLL setup code from my other application in place of the hardware setup code in main() from the 2129 port. I’m not setting up the MAM since the version of the chip I have has an errata on it that was fixed in a newer revision, as such I won’t be using it just yet.
The original 2129 port uses the “FreeRTOS\Source\portable\IAR\LPC2000” port files, which I’m assuming by the name will work with the 2368. “LPC2000_IAR” is defined so the correct portmacro.h file is included.
All of this compiles and loads without warnings. I’m getting a prefetch abort after the call to “vTaskStartScheduler”.
vTaskStartScheduler -> xPortStartScheduler -> vPortStartFirstTask -> portRESTORE_CONTEXT
portRESTORE_CONTEXT is located in ISR_Support.h. "LDR LR, [LR, #+60]" ends up with 0x00 in LR, then the operation after that "SUBS PC, LR, #0x4" results in the prefetch abort.
My assembly isn’t terrific, I’m going to figure out what those two operations should actually result in. If anyone has any input it would be well received. I can send my project files off to whoever might be interested. If someone has a project already started and would like to share I would be very grateful.
kfarr ^a^t^ infinetix ^dot^ com