cancel
Showing results for 
Search instead for 
Did you mean: 

Make SWO character output non-blocking?

Grant Bt
Senior

Correct me if I'm wrong, but it seems that ITM_SendChar() is blocking on the character transmission. Has anyone attempted to compensate for this or do people just put up/move to a UART?

At this point all I can think of is to implement a FIFO queue and tie a timer interrupt to it to fake the equivalent of Transmit Data Register Empty. Thoughts?

FYI I'm using an STM32F411 in CubeIDE and Keil uVision connected via ST-Link/V2.

4 REPLIES 4
TDK
Super User

It has to be blocking. There is no buffer available for storing data to be sent out here. It’s a low level cortex interface. Dont think there’s an interrupt like TXE you can co-opt for this.

I use UART.

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Super User

People just put up or move to a UART. Optionally with DMA.

 

Yeah, a TIM or SysTick.

Or you can wrap such that it can either send immediately or enqueue. Perhaps pump in a yield routine or the main loop

 So checking queue and outputting as available, but leaving immediately if not ready.

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

This basically is the Segger RTT library for J-Link. Pity that ST does not offer a similar library for ST-Link. Keil has something like that too, and it works with ST-Link, but only for use with their own debugger IIRC.