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

Fatal error! id: 16385 code line: 0 info: 537132876

When I do a 'build and run' in Segger Embedded Studio I get this error

<debug> app: Main start GHS
<info> app_timer: RTC: initialized.
<error> app: Fatal error! id: 16385 code line: 0  info: 537132876

Then I press the reset button and everything works.

If I do 'build and run' again the error repeats. It does not happen if I use the 'build and debug' option.

I am using SoftDevice s140 7.2.0 and the nFR52840 DK.

This is a relatively new error. I must have done something to mess up the configuration. I tried erasing the entire board and using nRFConnect to reload SoftDevice and the built HEX file, but when I build this error keeps repeating.

I can tell that the build and download of the app will generate this error simply by looking at the popup which shows the progress; it pops up and shows the first row filling and then flashes quickly (to quick for me to follow) and vanishes. When it works the popup remains up and shows a sequence of progress bars filling. The 'good' behavior lasts several seconds. The 'bad' behavior lasts less than a second.

I cannot find out what the above error code means because in debug mode it does not happen.

What am I missing?

Parents
  • Hi,

    16385 is 0x4001 -> NRF_FAULT_ID_SDK_ERROR

    Have you implemented your own error-handler? Normally it looks something like this,

    /**
     * Function is implemented as weak so that it can be overwritten by custom application error handler
     * when needed.
     */
    __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");
    #else
        switch (id)
        {
    #if defined(SOFTDEVICE_PRESENT) && SOFTDEVICE_PRESENT
            case NRF_FAULT_ID_SD_ASSERT:
                NRF_LOG_ERROR("SOFTDEVICE: ASSERTION FAILED");
                break;
            case NRF_FAULT_ID_APP_MEMACC:
                NRF_LOG_ERROR("SOFTDEVICE: INVALID MEMORY ACCESS");
                break;
    #endif
            case NRF_FAULT_ID_SDK_ASSERT:
            {
                assert_info_t * p_info = (assert_info_t *)info;
                NRF_LOG_ERROR("ASSERTION FAILED at %s:%u",
                              p_info->p_file_name,
                              p_info->line_num);
                break;
            }
            case NRF_FAULT_ID_SDK_ERROR:
            {
                error_info_t * p_info = (error_info_t *)info;
                NRF_LOG_ERROR("ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x",
                              p_info->err_code,
                              nrf_strerror_get(p_info->err_code),
                              p_info->p_file_name,
                              p_info->line_num,
                              pc);
                 NRF_LOG_ERROR("End of error report");
                break;
            }
            default:
                NRF_LOG_ERROR("UNKNOWN FAULT at 0x%08X", pc);
                break;
        }
    #endif
    
        NRF_BREAKPOINT_COND;
        // On assert, the system can only recover with a reset.
    
    #ifndef DEBUG
        NRF_LOG_WARNING("System reset");
        NVIC_SystemReset();
    #else
        app_error_save_and_stop(id, pc, info);
    #endif // DEBUG
    }

    and should print e.g. something like this:

    <info> app_timer: RTC: initialized.
    
    <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at C:\SDK_folder\SDK17.0.2\examples\ble_peripheral\ble_app_beacon\main.c:300
    
    PC at: 0x0002E8B7
    
    <error> app: End of error report

    If you have implemented your own error handler, you should try print the information stored in info

                error_info_t * p_info = (error_info_t *)info;
                NRF_LOG_ERROR("ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x",
                              p_info->err_code,
                              nrf_strerror_get(p_info->err_code),
                              p_info->p_file_name,
                              p_info->line_num,
                              pc);

Reply
  • Hi,

    16385 is 0x4001 -> NRF_FAULT_ID_SDK_ERROR

    Have you implemented your own error-handler? Normally it looks something like this,

    /**
     * Function is implemented as weak so that it can be overwritten by custom application error handler
     * when needed.
     */
    __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");
    #else
        switch (id)
        {
    #if defined(SOFTDEVICE_PRESENT) && SOFTDEVICE_PRESENT
            case NRF_FAULT_ID_SD_ASSERT:
                NRF_LOG_ERROR("SOFTDEVICE: ASSERTION FAILED");
                break;
            case NRF_FAULT_ID_APP_MEMACC:
                NRF_LOG_ERROR("SOFTDEVICE: INVALID MEMORY ACCESS");
                break;
    #endif
            case NRF_FAULT_ID_SDK_ASSERT:
            {
                assert_info_t * p_info = (assert_info_t *)info;
                NRF_LOG_ERROR("ASSERTION FAILED at %s:%u",
                              p_info->p_file_name,
                              p_info->line_num);
                break;
            }
            case NRF_FAULT_ID_SDK_ERROR:
            {
                error_info_t * p_info = (error_info_t *)info;
                NRF_LOG_ERROR("ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x",
                              p_info->err_code,
                              nrf_strerror_get(p_info->err_code),
                              p_info->p_file_name,
                              p_info->line_num,
                              pc);
                 NRF_LOG_ERROR("End of error report");
                break;
            }
            default:
                NRF_LOG_ERROR("UNKNOWN FAULT at 0x%08X", pc);
                break;
        }
    #endif
    
        NRF_BREAKPOINT_COND;
        // On assert, the system can only recover with a reset.
    
    #ifndef DEBUG
        NRF_LOG_WARNING("System reset");
        NVIC_SystemReset();
    #else
        app_error_save_and_stop(id, pc, info);
    #endif // DEBUG
    }

    and should print e.g. something like this:

    <info> app_timer: RTC: initialized.
    
    <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at C:\SDK_folder\SDK17.0.2\examples\ble_peripheral\ble_app_beacon\main.c:300
    
    PC at: 0x0002E8B7
    
    <error> app: End of error report

    If you have implemented your own error handler, you should try print the information stored in info

                error_info_t * p_info = (error_info_t *)info;
                NRF_LOG_ERROR("ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x",
                              p_info->err_code,
                              nrf_strerror_get(p_info->err_code),
                              p_info->p_file_name,
                              p_info->line_num,
                              pc);

Children
Related