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

power_management_init return runtime error

I am merging interactive command and buttonless dfu base on https://www.u-blox.com/sites/default/files/Add-NordicSemiconductorDFU-to-SDKexample_AppNote_UBX-19050198.pdf

somehow when i try to debug  after enter 

static void power_management_init(void)
{
ret_code_t err_code;
err_code = nrf_pwr_mgmt_init();
APP_ERROR_CHECK(err_code);
}

APP_ERROR_CHECK(err_code);

it did not jump to log_init(); which i expect

but error happended and it enter

void app_error_handler_bare(ret_code_t error_code)
{
error_info_t error_info =
{
.line_num = 0,
.p_file_name = NULL,
.err_code = error_code,
};

app_error_fault_handler(NRF_FAULT_ID_SDK_ERROR, 0, (uint32_t)(&error_info));

UNUSED_VARIABLE(error_info);
}

and

__WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
{
__disable_irq();
NRF_LOG_FINAL_FLUSH();

#ifndef DEBUG
NRF_LOG_ERROR("Fatal error");

and stuck in NRF_BREAKPOINT_COND; later on

someone know what happened?

Parents Reply Children
  • Hello,

    Please ensure that DEBUG is defined in your preprocessor defines, in order to see a detailed error message printed by your logger in the case that a non-NRF_SUCCSS error is passed to an APP_ERROR_CHECK.
    The included image illustrated how DEBUG can be defined with SES.


    Please do this, and share with us this detailed error message.

    Best regards,
    Karl

  • I follow what you said but still it did not show any error on the output  but i found out some weird stuff here 

    after hours of trying i found out 

    // <q> NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY  - Blocked shutdown procedure will be retried every second.
     
    
    #ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY
    #define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0
    #endif
    cause the problem if i switch to 1 the error happened but when i switch back to 0 the error vanish

    base on https://www.u-blox.com/sites/default/files/Add-NordicSemiconductorDFU-to-SDKexample_AppNote_UBX-19050198.pdf

    5.2

    5.2 sdk_config.h
    Open the project sdk_config.h file.
    There are several settings that need modified to enable DFU. Each line in this list are in separate
    locations throughout the file. Perform a search for each of these lines and change its value as noted:
    #define BLE_DFU_ENABLED 1 // was 0
    #define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1 // was 0
    #define NRF_SDH_BLE_VS_UUID_COUNT 2 // was 1
    #define NRF_SDH_BLE_SERVICE_CHANGED 1 // was

    can anyone know why and what

    NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1

    really do here

    also I am still trying to merge interactive command and buttonless dfu

Related