5 Replies Latest reply on Aug 10, 2016 10:30 AM by BoTa_264741

    Perform Reset PSOC5 with a flag displaying a custom reset cause


      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);


      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,