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

Assertion failed saadc

Hi,

    I'm coding a nrf55832, my code uses TWI, UART, SPI, app_timer, nrf_drv_timer. The code was going welle until i add the saadc. When i call the nrf_drv_saadc_init function,I have got this message error : <error> app: ASSERTION FAILED at ../../../../../nRF5_SDK_15.2.0_9412b96/integration/nrfx/nrfx_glue.h:107.  Wich is ASSERT(INTERRUPT_PRIORITY_IS_VALID(priority)); line.
    When I initialize saadc whithout initializing nrf_drv_timer the code runs well. When I initialize nrf_drv_timer without initializing saadc the code runs well, but there is a problem when I'm using both.
    I tried to change the IRQ_priority of timer/app_timer/uart/... It doesn't change anything. Anybody knows what can I do to solve this ?

Best Regards, 
Guillaume

Parents
  • Hi Guillaume, 

    if you get an assert at  ASSERT(INTERRUPT_PRIORITY_IS_VALID(priority)); when calling nrf_drv_saadc_init() then it means that you have provided an invalid interrupt priority, i.e. 

    #define INTERRUPT_PRIORITY_IS_VALID(pri) ((((pri) > 1) && ((pri) < 4)) || \
                                              (((pri) > 4) && ((pri) < 8)))

    which interrupt priority did you set in the nrf_drv_saadc_config_t struct passed to nrf_drv_saadc_init()?

    Best regards

    Bjørn

Reply
  • Hi Guillaume, 

    if you get an assert at  ASSERT(INTERRUPT_PRIORITY_IS_VALID(priority)); when calling nrf_drv_saadc_init() then it means that you have provided an invalid interrupt priority, i.e. 

    #define INTERRUPT_PRIORITY_IS_VALID(pri) ((((pri) > 1) && ((pri) < 4)) || \
                                              (((pri) > 4) && ((pri) < 8)))

    which interrupt priority did you set in the nrf_drv_saadc_config_t struct passed to nrf_drv_saadc_init()?

    Best regards

    Bjørn

Children
Related