1

I have my application running on a stm32f4 discovery board. I want to extract execution trace (particularly branching control flow) and also time stamped data trace. I have the following questions:

  1. stm32f4 discovery board does not have debug connectors. Can I still use J-Link or J-trace to extract trace information? Is there any other debugging tool that you would recommend to use with stm32f4 discovery boards?
  2. I want to feed the trace data onto an FPGA for monitoring. Can the trace data got from the debugger (Eg: J-trace) be fed to an FPGA board ?

Thank you for any help you can provide.

HelpingHand
  • 1,294
  • 11
  • 27
Smitha
  • 11
  • 2
  • I would have liked to add tags for `ETM` and `ITM`, but they don't exist AFAIS. One could argue that these abbreviations are too specific. However, they are specific components that are common to many types of ARM Cortex CPUs. Note that we also have different tags for `stm32`, `stm32f4`, `stm32f4discovery`... – HelpingHand Apr 13 '20 at 11:19

1 Answers1

0
  1. You didn't specify the exact type of discovery board, but in contrast to some (more expensive) evaluation boards, most (all?) of the discovery boards use smaller controller packages with less than 100 pins, which do not provide the ports where synchronous TPIU (trace data) output is available. Sadly, these ports can often not be remapped elsewhere, and ETM data is only output through TPIU. Please consult the pinout spec in the datasheet for detail - the TPIU pins are often found somewhere in the PE group.

    In contrast, the ITM is also output through the SWO pin, which is present in every STM32F4 package (it is multiplexed with JTAG_TDO, so you have to use SWD protocol then, instead of JTAG). Sadly, you don't get a complete execution trace (branching/control flow) through ITM.

    I don't have personal experience with J-Trace, but acconding to the online docu it is perfectly fine (I used Lauterbach uTrace successfully for both ITM and ETM.). The problem is not the J-Trace adapter but the controller package.

  2. I don't know. But with the typical prices you pay for any available ETM-capable debug/trace adapter, the manufacturer's support should assist you happily with such questions when you're buying one of them.

HelpingHand
  • 1,294
  • 11
  • 27
  • it is a wrong answer as trace data can be available on other pins - not only PE. – 0___________ Apr 07 '20 at 11:47
  • OK, I updated the answer to be more precise in this point. The mid-range STM32's I saw so far all mapped TPIU fix to GPIOE. – HelpingHand Apr 07 '20 at 12:55
  • Any example? Please be specific – 0___________ Apr 07 '20 at 13:04
  • Just a random list of examples I recently came in contact with, all these have their TPIU pins at the PE group: STM32F100, STM32F101, STM32F103, STM32F302/STM32F303, STM32F427, STM32F437, STM32F446, STM32L431, STM32L476, STM32L552 – HelpingHand Apr 07 '20 at 13:16
  • Trace is stiil available on the SWO pin. You chose it in the TPIU registers – 0___________ Apr 07 '20 at 13:24
  • 1
    You are right. But on SWO, we only get the trace from ITM, no data from ETM (which is way more powerful). I'm not sure if this is a property of the ARM Cortex-M cores, or of the way the STM32 are implemented around them. For STM32, you find the different accessibility described somewhere in the docs, too. IIRC, you have to check the bottom of the reference manual(s) for further detail. – HelpingHand Apr 07 '20 at 14:25