Why reset status is always set as software reset in a bootloadable project – KBA233957
The reset status is always set as ‘software reset’ in a bootloadable project for PSoC™ 3/4/5LP MCUs even though the device is reset due to other reasons such as brown-out detection (BOD) and watchdog timer (WDT).
Consider a bootloadable application in which the WDT is enabled and the reset reason is checked at the start of the application. In such an application, even though a WDT reset occurs, the reset reason in the bootloadable project will be detected as software reset instead of the actual reset reason, which is WDT reset in this case. Similarly, other reset reasons like BOD also will be detected as software reset in a bootloadable project.
This is because when the device is reset, the bootloader is executed initially. The bootloader after the validation of the bootloadable image resets the device (software reset – SRES) to transfer the control to the bootloadable application. Thus, software reset is detected as the reset reason. For further information on the bootloader and bootloadable application flow, see AN73854 – PSoC™ - Introduction to bootloaders.
The device reset reason can be read in the bootloader image and saved in the flash or EEPROM. The bootloadable image can then read the flash or EEPROM to detect the reset reason.