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

how can I find out the reason of error_info?

When my program was running,An error occurred.The program ran here

(app_error_handler_bare)and the error_info is

0x00000004, how can I find out the reason of error_info?

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

}

Parents
  • Hi, hong. Can you specify what

    IDE (for instance, Keil ARM-MDK 5 / IAR EWARM 7 / etc.),

    what chip (nRF52832-QFAA, etc)

    and what SDK / SoftDevice version you are using?

    Also, are you running an example project provided by the SDK?

    // In, nrf_error.h (SDK 12)
    #define NRF_ERROR_BASE_NUM      (0x0)       ///< Global error base
    #define NRF_SUCCESS                           (NRF_ERROR_BASE_NUM + 0)  ///< Successful command
    #define NRF_ERROR_NO_MEM                      (NRF_ERROR_BASE_NUM + 4)  ///< No Memory for operation
    

    you've received an "no memory error".

    To answer your question, I suggest using the IDE's help like the below.

    First, set the breakpoint at the app_error_handler_bare like you did.

    Second, the IDEs may provide you call stack / call graph.

    • When using Keil MDK 5

    keil

    • When using IAR EWARM 7

    IAR

    IAR ref. link

    These methods can help you to figure out why the error 0x00000004 was returned from what function.

    Also, the functions, provided from the SDK, has described the reasons for returning those error at the comment sections.

    P.S.) I've only used Keil MDK and IAR EWARM.

    So if you use other IDEs, I suggest you to investigate how to view call stack when debugging with the IDE which you are using.

    -Best Regards, Mango

  • You don't need to apologize. :D

    The app_timer_stop calls timer_stop_op_schedule. If you check the comment section of timer_stop_op_schedule,

    /**@brief Function for scheduling a Timer Stop operation.
    * @param[in]  timer_id   Id of timer to stop.
    * @param[in]  op_type    Type of stop operation
    * @return NRF_SUCCESS on successful scheduling a timer stop operation.
     NRF_ERROR_NO_MEM when there is no memory left to schedule the timer stop operation.
    */
    static uint32_t timer_stop_op_schedule(timer_node_t * p_node, timer_user_op_type_t op_type){
        timer_user_op_t * p_user_op = user_op_alloc(&last_index);
        if (p_user_op == NULL) err_code = NRF_ERROR_NO_MEM; // omitted other parts
    
Reply
  • You don't need to apologize. :D

    The app_timer_stop calls timer_stop_op_schedule. If you check the comment section of timer_stop_op_schedule,

    /**@brief Function for scheduling a Timer Stop operation.
    * @param[in]  timer_id   Id of timer to stop.
    * @param[in]  op_type    Type of stop operation
    * @return NRF_SUCCESS on successful scheduling a timer stop operation.
     NRF_ERROR_NO_MEM when there is no memory left to schedule the timer stop operation.
    */
    static uint32_t timer_stop_op_schedule(timer_node_t * p_node, timer_user_op_type_t op_type){
        timer_user_op_t * p_user_op = user_op_alloc(&last_index);
        if (p_user_op == NULL) err_code = NRF_ERROR_NO_MEM; // omitted other parts
    
Children
No Data
Related