This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sd API for GPREGRET2

How to access GPREGRET2 with sd API call?

thanks

jing

Parents
  • This is an unfortunate miss from our side, the s132 lacks API for setting the GPREGRET2 register. However, it is possible to workaround this by disabling the MWU when you want to access it:

     #define TEST_UNPROTECT_POWER \
    
    NRF_MWU->PREGION[0].SUBS &= ~(MWU_PREGION_SUBS_SR0_Include << MWU_PREGION_SUBS_SR0_Pos)
    
    #define TEST_REPROTECT_POWER \
    
     NRF_MWU->PREGION[0].SUBS |= (MWU_PREGION_SUBS_SR0_Include << MWU_PREGION_SUBS_SR0_Pos) 
    

    This has already been reported internally.

  • This is still locking up the NRF52 ......

        // TEST_UNPROTECT_POWER
    NRF_MWU->PREGION[0].SUBS &= ~(MWU_PREGION_SUBS_SR0_Include << MWU_PREGION_SUBS_SR0_Pos);
    
    // Update it
    NRF_POWER->GPREGRET2 = (value_to_write & 0xFF);
    
    // TEST_REPROTECT_POWER
    NRF_MWU->PREGION[0].SUBS |= (MWU_PREGION_SUBS_SR0_Include << MWU_PREGION_SUBS_SR0_Pos);
    

    If I comment out the Updating it line of code, no problem.

Reply
  • This is still locking up the NRF52 ......

        // TEST_UNPROTECT_POWER
    NRF_MWU->PREGION[0].SUBS &= ~(MWU_PREGION_SUBS_SR0_Include << MWU_PREGION_SUBS_SR0_Pos);
    
    // Update it
    NRF_POWER->GPREGRET2 = (value_to_write & 0xFF);
    
    // TEST_REPROTECT_POWER
    NRF_MWU->PREGION[0].SUBS |= (MWU_PREGION_SUBS_SR0_Include << MWU_PREGION_SUBS_SR0_Pos);
    

    If I comment out the Updating it line of code, no problem.

Children
No Data
Related