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

Debugging a APP_ERROR_CHECK

I am working on a project using a BLE Nano and Nordic sdk 8.1. I included the ble_flash.c, ble_error_log.c, and ble_debug_assert_handler.c files in my include path and c source files. I also added -DDEBUG to the flags. I then check if the app is failing using the APP_ERROR_CHECK(err_code); When I do this my program just stops running though and I don't get an error log or anything in the serial monitor and I don't see any stack trace saved on the device when I open it up. Are there any other steps I have to do or am I missing something? BTW I am compiling from terminal using a makefile.

Parents
  • How are you printing the error ? In app_error.c, try to comment out __disable_irq(), so the last lines looks like this:

        m_error_code = error_code;
        m_line_num = line_num;
        m_p_file_name = p_file_name;
    
        UNUSED_VARIABLE(m_error_code);
        UNUSED_VARIABLE(m_line_num);
        UNUSED_VARIABLE(m_p_file_name);
       // __disable_irq();
    
        printf("m_error_code %d\n",m_error_code);
        printf("m_line_num %d\n",m_line_num);
        printf("m_p_file_name %d\n",m_p_file_name);  
        while(loop);
    
Reply
  • How are you printing the error ? In app_error.c, try to comment out __disable_irq(), so the last lines looks like this:

        m_error_code = error_code;
        m_line_num = line_num;
        m_p_file_name = p_file_name;
    
        UNUSED_VARIABLE(m_error_code);
        UNUSED_VARIABLE(m_line_num);
        UNUSED_VARIABLE(m_p_file_name);
       // __disable_irq();
    
        printf("m_error_code %d\n",m_error_code);
        printf("m_line_num %d\n",m_line_num);
        printf("m_p_file_name %d\n",m_p_file_name);  
        while(loop);
    
Children
No Data
Related