2015-01-14 04:10 AM
Hello there,
I am trying to make an efficient debug trace system on a stm32F4discovery board. For now I have an example of an application that uses ITM the standard way- it prints data in a loop. I was wondering either it is possible to use DMA for this one way transmission. I couldnt find anything about it in the datasheet/ google. There is a possibility to config an Uart DMA transfer so maybe this as well? I would aprichiate any information and help about this topic. #itm #dma #discovery2015-01-14 04:51 AM
I seriously doubt it, but what prevents you from actually experimenting? Perhaps DMA2 from a TIM trigger, paced at a rate the debugger can sink them?
Plenty of USART TX + DMA examples out there.2015-01-14 05:02 AM
It's not the primary purpose of trace features to provide a ''print'' facility. The debug modules are part of the processor, and DMA can't write into the processor.
JW2015-01-14 05:41 AM
There is nothing that stops me from experimenting, well one thing actually. Im not very fluent in stm32 world yet. I was trying to gather some data first instead of trying to do something that is not possible perhaps.
2015-01-14 06:15 AM
I dont aggree about the printf. If not for printing information for the user what is it designed for then?
I noticed that SWO frequency can be set to a very high values. I wonder is there any real profit from using printf with uart + dma than from SWO without DMA but on for example 16800000Hz frequency?2015-01-14 07:57 AM
> I dont aggree about the printf. If not for printing information for the user what is it designed for then?
Primarily, to transmit automatically generated information e.g. on program execution path, timing, etc. > I noticed that SWO frequency can be set to a very high values. Most debug adapters (''the SWD/JTAG thingy'', e.g. ST-Link) will have significantly limited receiving bandwidth. JW2015-01-14 08:32 AM
It's not outputting at anywhere near that rate, it needs to know the core speed to set clock dividers and internal bit rates. You also probably don't have a $1K+ JTAG/SWD pod either.
Your going to be spending a lot of time in spin-loops doing no useful work waiting on the debug interface, which is not good to be doing under interrupt. So I think the debug channel is going to significantly distort the behaviour of the system, which is highly undesirable. A system with a USART and DMA, sufficient buffering, and some basic management should be reasonably transparent.2015-01-14 09:16 AM
I understand now. Thank you very much for clarifications Jan and Clive.