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

  • Since I have not gotten any further response to this problem, for some reason, I am getting additional info that may help in the form you have outlined above. This is the first day that has happened and it has repeated twice.. The problem continues, but a press of the reset button solves it, so I have not been blocked. I am still concerned there is something fundamentally wrong causing the error, and I am just hiding it by pressing the reset button.

    In any case after calling

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    I now get this addition information:

    <info> app_timer: RTC: initialized.
    <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at E:\projects\utech\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_ghs_epoch\main.c:1952
    PC at: 0x0002FD3F
    <error> app: End of error report
    

    The documentation is hopeless. Think I can find anything on NRF_ERROR_INVALID_STATE for the method nrf_sdh_enable_request() method? It's probably in there but as I said before the search engine is one of the worst I have ever worked with. I would need to ask many fewer questions if the search was better.  The documentation is huge, and a good search engine is needed.

    Looking at the source code the only reasons I can see for returning the invalid state code is that SoftDevice is already enabled ... which makes no sense.

  • Hi,

    Since I have not gotten any further response to this problem, for some reason,

    Sorry for the delay(I was on vacation). But lucky I see my colleague was able to help you with this issue in your other case. :)

    Link to case if someone else finds this post: https://devzone.nordicsemi.com/f/nordic-q-a/77690/adding-nrf_nvic_state_t-nrf_nvic_state-0-causes-code-not-to-build-no-reason-for-build-failure/323711#323711

Reply Children
No Data
Related