Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


FreeRTOS on NXP LPC1343 Lpcxpresso Code Red

Posted by jinx on March 2, 2010

I am trying to run the example programs originally meant for the LPC17xx on the LPC13xx. The freertos documentation for the LPC17xx seems to indicate that it is a trivial task to modify the programs to run on the LPC13xx. Unfortunately I'm having trouble running example1 on the LPC1343.

I am using the LPC13xx LpcExpresso low-cost development kit by Code Red with an LPC1343 processor. After modifying all the files to include the LPC13xx.h files instead of the LPC17xx files, reducing the heap size to 512 bytes, I was able to compile the example successfully. Then, I was able to single-step through the example until it gets to the void vPortStartFirstTask(void) function; After this function, the program execution just sits in the infinite while(1) loop of the void SVCall_Handler(void) function located in cr_startup_lpc13.c.

Can anyone point out on how to get this to work correctly?


RE: FreeRTOS on NXP LPC1343 Lpcxpresso Code Red

Posted by MEdwards on March 2, 2010
“ reducing the heap size to 512 bytes”

That seems very small. You will not be able to create more than a couple of tasks, if that.

“while(1) loop of the void SVCall_Handler(void)quote]

That sounds like the vector table has not been set up properly. Did you change the vector table? The FreeRTOS SVCall handler should be installed, but this sounds like the default handler (which is not implemented other than while(1)) is being called.

RE: FreeRTOS on NXP LPC1343 Lpcxpresso Code Red

Posted by jinx on March 2, 2010
Hi, Thanks for the reply.

I just changed the heapsize in freeRTOSConfig.h as follows:

#define configTOTAL_HEAP_SIZE (size_t) (10 * 256) //this is what it was previously


#define configTOTAL_HEAP_SIZE (size_t) (10 * 512) //

That did not change anything. I am still getting hung-up in the SVCall handler.

Also, I did not change the vector table...where is this located? I did include the LPC13xx.h files instead of LPC17xx.h files, so that should have taken care of the vector tables, right?

Where is the default handler for FreeRTOS located?

As additional information, here is what is in the function vPortStartFirstTask if it helps...I checked the register location 0xE0000ED08 and that thould be the same for all cortex M3 devices.

void vPortStartFirstTask(void)
__asm volatile{
" ldr r0, =0xE000ED08 \n"
" ldr r0, [r0] \n"
" ldr r0, [r0] \n"
" msr msp, r0 \n"
" svc 0 \n"

RE: FreeRTOS on NXP LPC1343 Lpcxpresso Code Red

Posted by Richard on March 3, 2010
I donĀ“t have a CrossWorks project in front of me at the moment (not using my computer) but it should be located in the start up file, which on a Cortex M3 can be a C or an assembly file.

The SCVCall, PendSV and SysTick interrupts need to be populated with exactly the same functions as per the examples that are sent with the books.

Sorry not to be more helpful, if I had my own computer here I would be able to tell you example which file and which functions, but hopefully you will be able to work it out from the files provided.


RE: FreeRTOS on NXP LPC1343 Lpcxpresso Code Red

Posted by jinx on March 3, 2010
Thanks. I'm SO glad that it is now working!
That solved my problem. The LPC13xx startup file that I used did not have the 'overloaded' functions for SVCCall, PendSV and SysTick as the LPC17xx startup file in the original examples. I did a compare between the two and added in these functions in the right places and now it works!

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo, Nuvoton Cortex-M23 demo & STM32H745 dual core (AMP) demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner