Quality RTOS & Embedded Software

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


FreeRTOS in Bootloader

Posted by joehinkle on September 16, 2016

Several of my cpu's peripherals (SPI, I2C, ENET) utilize FreeRTOS tasks so When I designed my Bootloader I need FreeRTOS running to utilize those components.

When the time comes to jump from the Bootloader (FreeRTOS tasks running) into the Main Application (which also uses FreeRTOS) -- What do I need to do from the FreeRTOS perspective to perform the leap?

  1. Disable all HW peripheral interrupts that were enabled in the Bootloader.
  2. Disable HW interrupts (I'm using an ARM so ("cpsid i"));

  3. Best way to disable Tic Timer?

  4. Any thing else from FreeRtos's point of view?



FreeRTOS in Bootloader

Posted by rtel on September 16, 2016

I've been doing this quite a bit myself, and haven't found any issues that you would not find in a bare metal (non RTOS) application - so really FreeRTOS doesn't add any complexity. As per a non RTOS application you need to jump to the start up code of the application being booted, so it initialises its variables etc, (not jump to main() of the application being booted), set up the vector table base address (so the vector table of the application is used, not the vector table of the bootloader), etc, etc.

In addition to disabling interrupts of any peripherals that were enabled by the bootloader you will also need to somehow disable the systick interrupt - but for a belt and braces approach I tend to globally disable interrupts too before jumping to the application ("cpsid i").


FreeRTOS in Bootloader

Posted by amcolex on October 9, 2016

I recently wrote a bootloader for my project, and like you, I also use FreeRTOS in the bootloader and the application.

Here is my jump function:


define START_ADDRESS 0x08018200 // change accordingly

typedef void (*p_function)(void);

void jumptoapplication(void) { uint8t i; uint32t jumpaddress = *(__IO uint32t*)(STARTADDRESS + 4); pfunction pjumpfunction = (pfunction)jumpaddress;

// stop all interrupts

// Disable IRQs
for(i = 0;i < 8;i++)
// Clear pending IRQs
for(i = 0;i < 8;i++)

// enable all interrupts


// re-init stack pointer (first entry of the vector table)
__set_MSP(*(__IO uint32_t*)START_ADDRESS);


} ~~~

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

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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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