lpcware

FreeRTOS on M0 Core

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Flo on Thu Mar 28 09:23:30 MST 2013
Hi there,

I would like to use FreeRTOS on the M0-Core in a LPC4357. The development board is a Embedded Artists LPC4357 with the 4,3" LCD-Addon.
For the development and debugging I use Code Red's Red Suite with the Red Probe+. It looks like the PC runs into the wrong memory area.

So here's the situation:
My aim is a simple task running on the M0-Core, that is able to get delayed.
I used the LPCOpen FreeRTOS Blinky Example to set up my system. So the M0 Core uses the RIT-Timer to generate the freeRTOS SystemTick, wich is working.
Also the pendSVHandles gets called. The RIT CTRL is configured with 0x0F, so the counter is automatically cleared.
Anyway, after starting the programm my task runs into vTaskDelay(configTICK_RATE_HZ / 6) but than never returns.
Pause the Core ends up at "0xce" Programm Code, but I did not define any code or data there.

So here is a overview over my memory settings:

Programm Data M4: Flash A   at 0x1a000000 - 0x80000   Length
Data Section M4 : SRAM      at 0x10000000 - 0x8000    Length
GUI Data M4     : SRAM      at 0x28000000 - 0x2000000 Length  // Used for emWin GUI

Program Data M0 : Flash B   at 0x1b000000 - 0x80000   Length
Data Section M0 : SRAM      at 0x10080000 - 0xa000    Length


I already started to find the location, where something goes wrong.
It looks like the pendSV-Interrupt doesn't work correct.
I commented out the Set of the pendSV-Interrupt and the program does not run to 0xce anymore, but
my tasks also does not "wake up".
However, i also debugged the pendSVHandel (take a look below). As I use ARM GCC i am not able to single step trough the asm code.
But i was able to re-enter the Handler a lot of times. Deactivating the breakpoint and pause a few seconds later ends up in 0xce again.
So it looks like there is something wrong with the handler, but i got no clue what could be happening. Espacially because it is the same like the
one provided with lpcOpen.

Anyway, here are the Code Sections:

/* Watch attachment txt-File */

I can't see any problem with the code, but I have no clue, what could be the cause of the problem. On the M4-Core the the RTOS runs, just using the original SysTick-Timer.
So is here somebody who sees the problem or could give me a hint.

Greetings,
Florian

Original Attachment has been moved to: code_1.txt.zip

Attachments

Outcomes