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

twi sensor code hanging problem

Dear sir,

The twi sensor code in SDK14 is getting stuck at  NRF_BREAKPOINT_COND. Also, on the uart terminal it is showing FATAL ERROR. Please help me out of this.I am using NRF52832 Development kit.
Regards,

Manoj Hiwarkar.

Parents
  • Hi,

    I'm guessing that it gets stuck inside app_error_fault_handler()?

    You can try to change your code to something like this to make the error handler print some more informative messages:

    __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
        static error_info_t  * p_error_info;
        p_error_info = (error_info_t*)info;
        NRF_LOG_ERROR("Error: ID: %d, PC: 0x%X\n\r", id, pc);
        NRF_LOG_ERROR("Error: Code: 0x%04X (%d), Line: %d, File: %s\n\r", p_error_info->err_code, p_error_info->err_code, p_error_info->line_num, (uint32_t)p_error_info->p_file_name);
        NRF_LOG_FINAL_FLUSH();
    //    NRF_BREAKPOINT_COND;
        // On assert, the system can only recover with a reset.
    #ifndef DEBUG
        NRF_LOG_INFO("Hit weak handler");
        NVIC_SystemReset();
    #else
        app_error_save_and_stop(id, pc, info);
    #endif // DEBUG
    }

    After that you can examine the error info to pinpoint where and what failed. 

  • I facing the same issue, when using nrf_drv_twi_tx. May I know what does app_error_fault_handler means?

Reply Children
Related