cancel
Showing results for 
Search instead for 
Did you mean: 

ETM Trace on STM32F429

Aurélien f
Senior
Posted on August 21, 2015 at 09:26

Hello,

I wanted to know if someone has already worked on ETM trace on STM32 cortex-M4. My purpose is to activate them into the embedded software itself and dumping traces on the 5 following pins (TRACED[0-3] + TRACECK), but it is impossible to find some code examples. (from what i understood, in most of case, this feature is activated via the probe, and an external software analyzer by writing directly into the memory)

Please feel free to share your thoughts about my issue.

I thank you in advance. 

Best regards,

Aur�lien

#stm32-stm32f429-etm-trace
8 REPLIES 8
Posted on August 21, 2015 at 11:11

Neat idea, but what do you expect to gain from it?

I have only a limited experience with traces from the '51 era, having a complete trace from a full-fledged hardware emulator, but my conclusion back then was that sifting through extensive data generally provided less information-to-labor rate than other debugging techniques. I understand that ETH is in some regard more flexible than a dumb data dump and that data processing capabilities have changed dramatically in the last 20 years or so, but still you'll be facing that post-processing step to filter out the proverbial needle out of the haystack...

Please do report back with your findings.

Jan

Aurélien f
Senior
Posted on August 21, 2015 at 12:41

Hi Jan,

Thank you for your reply. 

I don't expect so much gain, it will help us to debug some tricky issue when they will occurs. Actually, i have no choice, i need to implement it. For analyzing, i will use a lauterbach probe, maybe under eclipse or an other tool. I have started reading STM documentation, but it is not really detailed about this topic and they do a lot of reference to ARM documention, that i have also started reading.

I have also found this link: 

https://github.com/PetteriAimonen/STM32_Trace_Example

but i can't do this code working on my cortex-M4. For the moment, my first purpose is to call a function into my code that enables ETM for dumping all CPU traces (without limitation).

John F.
Senior
Posted on August 21, 2015 at 13:19

Maybe you already have ETM working. I would caution that you make sure you have a reliable hardware connection before developing more software. The ETM can operate at very high speed but you will need short PCB traces and good layout for a reliable connection. Anecdotally, I think some of the STM324xx evaluation boards only support ''ETM Trace'' if you run the clock at lower < 60MHz frequency because of PCB layout issues.

Posted on August 21, 2015 at 13:34

> Anecdotally, I think some of the STM324xx evaluation boards only support ''ETM Trace'' if you run the clock at lower < 60MHz frequency because of PCB layout issues.

You mean the ST's own EVAL range of boards, such as the STM32429I-EVAL?

JW

Aurélien f
Senior
Posted on August 21, 2015 at 16:17

Yes, you are right, i gonna check this before going further, my internal clock is around 166 mHz and the probe (USBee XS) that i am currently using has a bandwidth of 30 mHz (the lauterbach should have a larger bandwidth). I gonna try to decrease the internal clock but by doing this i fear to face other troubles ...

Posted on August 21, 2015 at 17:02

The interface is non-trivial, the debugger vendors have NDA's with ARM, and the decoding of the data requires a lot of PC side context about what code, and memory, is being used. ARM's method is to express flow information, and analysis is derived from that rather than showing everything on the buses.

There's a reason trace adapters run $1300-1500 (USD). The ARM/Segger pods have fast/expensive FPGAs and deep/fast memory buffers.

Like Jan, I've been doing this for decades, trace has value for a specific class of problems, but I've only found it critical on a handful of occasions. Most problems can be solved more effectively/cheaply with good instrumentation, and understanding ones own code flow.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on August 21, 2015 at 17:08

>>Anecdotally, I think some of the STM324xx evaluation boards only support ''ETM Trace'' if you run the clock at lower < 60MHz frequency because of PCB layout issues.

 

 

>You mean the ST's own EVAL range of boards, such as the STM32429I-EVAL?

Well you certainly lose high order address bits for the external memories, so there's going to be some compromises to be make. I'd have to review what the

http://www.keil.com/mcbstm32f400/

 runs at, I don't recall having to play with the operational frequency.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Aurélien f
Senior
Posted on August 25, 2015 at 09:21

Hello,

I finally succeeded to dump something (i hope it is the ETM program trace), actually it was a problem of GPIO configuration ... :\

Next step is to decode those traces with a lauterbach. It should be easier 🙂

BR,

Aurélien