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

APP_UART called during an interruption not working properly.

Dear community,

I am developing a firmware using SDK 16.0.0 which handles interruptions from an accelerometer and a timer.

I've built on top of APP_UART lib a set of functions for printing to the console as well as WifI module.

After configuring the interruptions for the GPIOTE coming from the accelerometer and the timer, I've tried to print some debug info through APP_UART and figured out that it only prints 1 char when it is called from a function handler.

I've changed the IRQ  priorities and tried some priorities around it but the behaviour keeps the same.

This might not happen in the real case scenario where no console output exists, but since I have no clue of what is happening, this can represent a problem when sending/receiving info to/from the Wifi (even though I can turn of the interruptions during this process) but can also cause some problems with the GPIOTE interruption as well.

A simple test scenario I've created using nrfx_timer looks like this:

Where the handler is triggered every 500ms.

  • I think I have seen this behavior before. I think it was related to adding wrong fifo file into the project. Can you give me a list of all FIFO and uart related file names in your project?

  • Hi!

    Well this is silly but as you've mentioned FIFO it just ringed a bell!

    I've changed the IRQ priority level on UART in the sdk config, BUT the FIFO macro has an argument where you pass the priority as well.

    I've changed APP_IRQ_PRIORITY_LOWEST to APP_IRQ_PRIORITY_HIGH and it is working now.

    Thank you!