Quality RTOS & Embedded Software

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


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

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

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

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