cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable RTOS timer when bootloader give the execution to the newly downloaded file? But the timer should be enabled in the runtime of the newly downloaded code execution.

kasun
Associate II

I'm working in a project of OTA update for the SPC570s MCU.I have modified the bootloader program to wait until CAN frames come. If there is not any CAN frame, the bootloader will execute the application code in the flash after a small delay. This is working for the application codes which are not having RTOS.

3 REPLIES 3
ODOUV.1
ST Employee

Hello,

RTOS is using PIT0 channel 0 to manage time on SPC5 platforms

try to add this function at then end of systimer.c in OSAL component:

#include "lldconf.h"

void test_sysTimeStop(void) {

if (PIT_0.CH[0].TCTRL.R != 0U){

PIT_0.CH[0].TCTRL.R = 0U;  /* Timer Inactive, interrupt disabled.     */

}

PIT_0.MCR.R   = 2;     /* PIT clock disabled. */

SPC5_PIT_DISABLE_CLOCK();    /* stop the peripheral clock */

}

and call it just before to jump into your new program.

in our demo, it should be in updater_jump

just after stm_lld_stop

Best regards,

kasun
Associate II

Hi ODOUV.1,

Thank you for the support.

It worked nicely.

Thanks,

Kasun

ODOUV.1
ST Employee

You are welcome dear Kasun !

Thank you, have a nice day.