Skip to main content
PRedd.5
Associate II
October 15, 2019
Solved

Is the HAL IRQ callback function running outside of irq context ? Is this a good place for some string processing ?

  • October 15, 2019
  • 4 replies
  • 1244 views

I am currently working with UART in DMA mode for CLI implimentation. I would like to do some string parsing as part of the HAL_UART_RxCpltCallback.

Is this callback running in IRQ context or outside of IRQ context ? Is this the correct place for post processing IRQ data ? What would you recommend ?

This topic has been closed for replies.
Best answer by TDK

That runs from within an IRQ. As for if that’s the right place to process data or not, it really depends on how long processing takes. If it’s heavy, transfer data, set a flag and do it in the main thread. Otherwise, in the IRQ is fine.

4 replies

TDK
TDKBest answer
October 15, 2019

That runs from within an IRQ. As for if that’s the right place to process data or not, it really depends on how long processing takes. If it’s heavy, transfer data, set a flag and do it in the main thread. Otherwise, in the IRQ is fine.

"If you feel a post has answered your question, please click ""Accept as Solution""."
PRedd.5
PRedd.5Author
Associate II
October 15, 2019

the processing is basically string compares to about 2 dozen commands and tokenizing command and arguement.

TDK
October 15, 2019

String compares are quick. Try it in the irq and if you get overrun issues you’ll have to do something else.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Pavel A.
October 15, 2019

The HAL interrupt callbacks run in IRQ context. Not a good place for lengthy processing.

-- pa