Skip to main content
kasun
Associate II
November 30, 2022
Question

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.

  • November 30, 2022
  • 3 replies
  • 1378 views

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.

This topic has been closed for replies.

3 replies

ODOUV.1
ST Employee
December 9, 2022

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
kasunAuthor
Associate II
December 12, 2022

Hi ODOUV.1,

Thank you for the support.

It worked nicely.

Thanks,

Kasun

ODOUV.1
ST Employee
December 12, 2022

You are welcome dear Kasun !

Thank you, have a nice day.