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


Odd behavior when bootloading FreeRTOS app

Posted by marshall on June 15, 2009
I've written a boot loader for an ARM7 lpc2148. The bootloader simply looks for a firmware file on an sd card and writes the file out to program memory. It then starts execution of the firmware. The firmware is the same as the orginal app, only the linker script designates program memory starting at address 0x20000.

When the bootloader starts execution of the app, I'm seeing some very odd behavior. When the first task is run, if I step into each line of code, everything works fine. If I step over each line of code, then the first time I step over a function in the task, execution goes back to the bootloader. I'm not seeing any kind of ARM exception such as data abort, execution just appears to restart at 0x0000.

Is there something I'm missing? I don't see why there would be any problem with what I'm doing. Since all of the stacks are reinitialized when the app starts execution and the first task is actually starting, then why would there be a problem during the first function call?

Thanks for any insight.

RE: Odd behavior when bootloading FreeRTOS ap

Posted by Dave on June 15, 2009
These problems are normally down to the vector table location. Where are you putting the vector table and how are you telling the mcu where it is? The ARM7 will attempt to read it from 0.

RE: Odd behavior when bootloading FreeRTOS ap

Posted by marshall on June 15, 2009
You are indeed correct. I stepped through until I hit a taskYield() and saw that execution dropped back to 0x0008 so the ARM7 is looking for the vector table at 0 as you said. Apparently, stepping over function calls was giving FreeRTOS enough time to preempt the task I was looking at and perform a context switch. I assume single stepping prevented the timer interrupt from being called enough to require a context switch.

Looks like I just need to map the interrupts to ram and copy them over for the bootloaded app.


[ 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