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?
Disable all HW peripheral interrupts that were enabled in the Bootloader.
Disable HW interrupts (I’m using an ARM so (“cpsid i”));
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”).