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

POFWARN

Hi,

I'm working on the nrf52832 development board and SDK 16.0. I want to use the Power supply supervisory functionality to detect any type of power failure.

I'm using ble Blinky example with softdevice s132 to test this.

I just want to know, How can I register my event with the soft device.

I have seen many examples regarding the POFWARN at this forum but unable to implement it in code. 

    err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled);
    APP_ERROR_CHECK(err_code);

    err_code = sd_power_pof_threshold_set(POWER_POFCON_THRESHOLD_V28);
    APP_ERROR_CHECK(err_code);

but I don't know where how to get the warning NRF_EVT_POWER_FAILURE_WARNING  by incorporating with the softdevice. If there is any example stating the procedure or any help will be grateful.

Thanks

Regards,

Parents Reply
  • Hi, 

    Please check the NRF_SDH_SOC_ENABLED is set to 1 in the sdk_config.h and Include header files for  nRF5_SDK\components\softdevice\common\nrf_sdh_soc.h

    // <e> NRF_SDH_SOC_ENABLED - nrf_sdh_soc - SoftDevice SoC event handler
    //==========================================================
    #ifndef NRF_SDH_SOC_ENABLED
    #define NRF_SDH_SOC_ENABLED 1
    #endif
    // <h> SoC Observers - Observers and priority levels
    
    //==========================================================
    // <o> NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. 
    // <i> This setting configures the number of priority levels available for the SoC event handlers.
    // <i> The priority level of a handler determines the order in which it receives events, with respect to other handlers.
    
    #ifndef NRF_SDH_SOC_OBSERVER_PRIO_LEVELS
    #define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2
    #endif
    
    // <h> SoC Observers priorities - Invididual priorities
    
    //==========================================================
    // <o> BLE_DFU_SOC_OBSERVER_PRIO  
    // <i> Priority with which BLE events are dispatched to the DFU Service.
    
    #ifndef BLE_DFU_SOC_OBSERVER_PRIO
    #define BLE_DFU_SOC_OBSERVER_PRIO 1
    #endif
    
    // <o> CLOCK_CONFIG_SOC_OBSERVER_PRIO  
    // <i> Priority with which SoC events are dispatched to the Clock driver.
    
    #ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO
    #define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0
    #endif
    
    // <o> POWER_CONFIG_SOC_OBSERVER_PRIO  
    // <i> Priority with which SoC events are dispatched to the Power driver.
    
    #ifndef POWER_CONFIG_SOC_OBSERVER_PRIO
    #define POWER_CONFIG_SOC_OBSERVER_PRIO 0
    #endif

    And that these files (under nRF5_SDK\components\softdevice\common\) are included in your project:

    -Amanda H.

Children
Related