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

nrf52832 executing TWI function from app_timer handler

Hello,

When i execute a function that uses TWI from a timer handler the NRF gets stuck. I assumed that this issue occurs because of interrupt priority so i gave the TWI a higher priority then the priority of APP_TIMER, but it didn't help.

What can be the cause of this issue ?

  • The timer interrupt is not the issue because when my function in the timer handler is commented out it works as it should.

Thanks !!

Parents Reply
  • Hi,

    NRF_LOG_FLUSH() is a blocking function and if you are using UART as backend this is using interrupts while printing messages. Hence, you are triggering interrupts from within an interrupt context and this might cause priority issues. If you are using RTT as backend it will not use interrupts the same way, but since NRF_LOG_FLUSH() is blocking and since it takes a significant amount of time to format a string you should never flush in an interrupt context. NRF_LOG_FLUSH() is intended to be used only in main context.

Children
No Data
Related