void vPortEndScheduler( void ) Cortex-M3 implementation?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

void vPortEndScheduler( void ) Cortex-M3 implementation?

2,014 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alanisgp on Wed Apr 18 07:22:42 MST 2012
Hello,
I am using the version of FreeRTOS for Cortex-M3. For an application of secondary bootloader. My application download and save into flash an image of a binary file. Then simply performs an execution jump to that code. I have found that if the code also contains a running FreeRTOS, the program executes an exception and crashes.
Need a way to eliminate the trace of the FreeRTOS before making the leap, and thus should use vTaskEndScheduler (), which lacks implementation in point:

vPortEndScheduler void (void)
{
/ * It is Unlikely That the CM3 port will require this function as there
is nothing to return to. * /
}

It would be possible to obtain such implementation.

Best regards.
0 Kudos
2 Replies

1,590 Views
BlackNight
NXP Employee
NXP Employee

A vPortEndScheduler() implementation for ARM Cortex-M devices is described in FreeRTOS: how to End and Restart the Scheduler | MCU on Eclipse  and can be downloaded from the links provided in the article.

I hope this helps,

Erich

0 Kudos

1,590 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by  on Thu Apr 19 13:20:00 MST 2012
If I understand your question correctly, you want to jump from a FreeRTOS application into a boot loader, and at this time stop FreeRTOS running because it is causing a problem?

If this is the case, I suspect the problem is caused by the RTOS tick interrupt, which will still be executing when you are running your bootloader code.

The tick interrupt can be stopped by stopping the SysTick timer, in the CPU core.

If your boot loader does not use interrupts, then a simple fix will be to simply disable interrupts globally before jumping to the bootloader.

FreeRTOS leaves a sub-set of interrupts completely unaffected by critical sections, therefore, if you bootloader does need interrupts, then enter a critical section (taskENTER_CRITICAL()) before jumping to the boot loader, and set the interrupts used by the bootloader to a priority above the configMAX_SYSCALL_INTERRUPT_PRIORITY setting found in FreeRTOSConfig.h.
0 Kudos