Perform Reset PSOC5 with a flag displaying a custom reset cause

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

cross mob
user_352521
Level 1
Level 1

Dear Cypress community,

   

I want to software-reset my device at a certain point and provide a custom reset cause (which can be used as a flag for a part of the initialization code). My idea was to use RESET_SR0: 0x400046FA or CYREG_PHUB_CFGMEM23_CFG1: 0x400076BC for this because bit 4 (0x10) seems to be unused. The code I wrote to do this is simple:

   

void sw_reset_with_custom_reset_cause() {
    uint8 currentValue = CY_GET_REG8(CYREG_RESET_SR0);
    currentValue |= 0x10;
    CY_SET_REG8 (CYREG_RESET_SR0, currentValue);
    CySoftwareReset();
}

   

The problem is that it does not work as expected (reset cause is always 0x20 after calling the SW reset). My hope would of course be to get a reset cause that is equal to 0x30. I've tried with both above mentioned registers but with no luck. 

   

What am I doing wrong here?

   

Best regards,

   

Sander

0 Likes
7 Replies