Determining the Reset reason in an OTA Bootloadable

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
IvBu_1817031
Level 2
Level 2
First like received

Hi,

In a device, based on the CYBLE-222005-00 module, we need to distinguish between a power on and a software reset. We do this with the help of the CySysGetResetReason function and in a single application, which we program using an SWD programmer, it works. However, if we restructure the software to add an OTA upgrade possibility (i.e. prepare separate Upgradable Stack OTA Bootloader and Bootloadable User Application), the same function called in the Bootloable returns a reset reason value with the CY_SYS_RESET_SW bit – set.  I tried but I could not find the answer of the following questions:

- How can I recognize a power on reset in a OTA Bootloadable application that works with an Upgradable Stack OTA Bootloader?

- Is there a way to pass a value from the bootloader to the bootloadable or to share a variable between them?

Thanks!


 

0 Likes
1 Solution
Anonymous
Not applicable

The bootloader will reset the device when it finishes loading the new application; This means that software resets can be initiated by both the software application and the bootloader.

The bootloadable and bootloader can both read the flash memory, so in theory you could store values in flash for access by both. Otherwise, the only similar reference is the "metadata" for the bootloader/-able which is stored in flash as well.

Regards,

Epratt

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

The bootloader will reset the device when it finishes loading the new application; This means that software resets can be initiated by both the software application and the bootloader.

The bootloadable and bootloader can both read the flash memory, so in theory you could store values in flash for access by both. Otherwise, the only similar reference is the "metadata" for the bootloader/-able which is stored in flash as well.

Regards,

Epratt

0 Likes

Thanks, Epratt!

I was hoping that there is a possibility to share a region of non-initialised RAM between the bootloader and the application but ... ok, I will use the flash!

If anyone though, has a better idea how to recognise a 'power on' reset in an OTA bootable application, please, share it!

Cheers!

0 Likes
Anonymous
Not applicable

Yeah, I looked through the documentation for references but didn't see any that stood out for RAM or shared memory 😕

Possibly there is a low-level method for doing it, but I wouldn't know

Good Luck though!

Epratt

0 Likes