This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ERROR 3735928559 [Unknown error code] at ../../../../../../integration/nrfx/nrfx_glue.h

I have developed a code based on app_timer to initiate an interrupt every 10 seconds. Inside app_timer_handler, I have code for reading data from an I2C device. 

When I run the code, it stops at line 100 app_error_weak.c with below in the debug session: 

<info> app_timer: RTC: initialized.
<error> app: ASSERTION FAILED at ../../../../../../integration/nrfx/nrfx_glue.h:107

What could be the possible cause for this? 

Thanks

Parents
  • Hi,

    As you write, the error points to line 107 in integration\nrfx\nrfx_glue.h. On that line, you have this assert:

        ASSERT(INTERRUPT_PRIORITY_IS_VALID(priority));

    So there is a problem with an interrupt priority, and looking at the call stack I see this is while configuring RTC2. So the problem is with the RTC2 interrupt priority. Looking at your code it does not seem like you have populated the interrupt_priority field in your rtc2_config (nrf_drv_rtc_config_t) so that could be anything. You need to set it to a sensible value.

  • I changed RTC2 configuration to "nrf_drv_rtc_config_t rtc2_config = NRF_DRV_RTC_DEFAULT_CONFIG;" so that RTC2 interrupt priority is loaded from sdk_config.h. 

    My debugger stops at line 100 app_error_weak.c still. 

    The code has app_timer with interrupt priority 7. It triggers I2C sampling every 5 seconds. 

    I2C has interrupt priority of 6. The code is intended to communicate with an I2C device. If it detects the device connected to the processor it starts to write to it and read data back from it (detection_err_code == NRF_SUCCESS). When the device is connected no error happens, it only happens when I2C device is not connected to the processor. This is the log in debug terminal: 

    <info> app_timer: RTC: initialized.
    <error> app: ERROR 33281 [NRF_ERROR_DRV_TWI_ERR_ANACK] at ...\main.c:172
    PC at: 0x0002A4D5
    <error> app: End of error report

    RTC2 is a low power delay implementation to wait until sensor finish its measurement, then the micro read data. Interrupt priority for this is 5. 

    See below for sdk_config.h and appearing error. 

  • It seems the issue is gone once I comment out "APP_ERROR_CHECK(detection_err_code);" line.

Reply Children
  • Hi,

    Kaveh.M said:
    It seems the issue is gone once I comment out "APP_ERROR_CHECK(detection_err_code);" line.

    This means that you are simply ignoring the error, not that the problem has gone away. This can sometimes be OK, but then it should be a well considered decision, and not something you do for all errors just to "make it work".

    Kaveh.M said:
    <info> app_timer: RTC: initialized.
    <error> app: ERROR 33281 [NRF_ERROR_DRV_TWI_ERR_ANACK] at ...\main.c:172
    PC at: 0x0002A4D5
    <error> app: End of error report

    Looking at the screenshot I see this is returned from nrf_drv_twi_rx, so you get NRF_ERROR_DRV_TWI_ERR_ANACK. If that is something you expect could happen here and that is OK, then it would make sense to make an exception specifically for this. Something like the following:

    if (detection_error_code == NRF_ERROR_DRV_TWI_ERR_ANACK)
    {
        // Do nothing (Ignore this error as it is expected to happen for some ... reason)
    }
    else
    {
        APP_ERROR_CHECK(detection_error_code);
    }

Related