Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

FreeRTOS on NXP LPC1343 Lpcxpresso Code Red

Posted by jinx on March 2, 2010
Hi,

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?

Thanks

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

to

#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.

Regards.

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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists