FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2016 Threads] FreeRTOS in BootloaderPosted 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?
- Disable all HW peripheral interrupts that were enabled in the Bootloader.
Disable HW interrupts (I'm using an ARM so ("cpsid i"));
Best way to disable Tic Timer?
Any thing else from FreeRtos's point of view?
Thanks.
Joe
FreeRTOS in BootloaderPosted 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").
Regards.
FreeRTOS in BootloaderPosted 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_irq();
// Disable IRQs
for(i = 0;i < 8;i++)
{
NVIC->ICER[i] = 0xFFFFFFFF;
}
// Clear pending IRQs
for(i = 0;i < 8;i++)
{
NVIC->ICPR[i] = 0xFFFFFFFF;
}
// enable all interrupts
__enable_irq();
__set_CONTROL(0);
// re-init stack pointer (first entry of the vector table)
__set_MSP(*(__IO uint32_t*)START_ADDRESS);
//jump!
p_jump_function();
}
~~~
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|