Enabling RTT logging with a running system always performs a reset for STM32H7A3VI, but not for STM32U585QI

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Enabling RTT logging with a running system always performs a reset for STM32H7A3VI, but not for STM32U585QI

      New

      Hi,
      I have two systems STM32H7A3VI and STM32U585QI, and I use a J-Link Ultra+ to connect via SWD/JTAG. When I try to enable RTT logging (using J-Link RTT Viewer V7.98h on Windows 10) on a running system, it works fine for STM32U585QI, but for STM32H7A3VI it always resets automatically. After the reset the RTT logging works fine though, but I want to avoid this reset. The same behavior is observed also when trying to attach a debug session to a running system, STM32U585QI can attach but STM32H7A3VI resets.



      I have done some debugging and in the JLinkLogOverride.log, this is observed for STM32H7A3VI when trying to enable RTT on a running system (full log attached):



      T1C80 004:195.802 JLINK_Connect()
      T1C80 004:196.782 ConfigTargetSettings() start
      T1C80 004:196.823 J-Link Script File: Executing ConfigTargetSettings()
      T1C80 004:196.872 ConfigTargetSettings() end - Took 28us
      T1C80 004:196.891 InitTarget() start
      T1C80 004:196.909 J-Link Script File: Executing InitTarget()
      T1C80 004:197.615 SWD selected. Executing JTAG -> SWD switching sequence.
      T1C80 004:203.271 DAP initialized successfully.
      T1C80 004:205.286 Can not attach to CPU. Trying connect under reset.
      T1C80 004:257.953 SWD selected. Executing JTAG -> SWD switching sequence.
      T1C80 004:263.299 DAP initialized successfully.
      T1C80 004:406.683 InitTarget() end - Took 209ms

      The log clearly says that it can not attach to CPU and resets the system. But I do not understand WHY this is happening. I'm connecting without any extra script file, so this is a call to some generic implementation of InitTarget(). I can't find the "source code" to this, so it is not possible to understand what goes wrong.

      For STM32U585QI the log looks like this:



      T1C80 098:599.344 InitTarget() start
      T1C80 098:599.368 J-Link Script File: Executing InitTarget()
      T1C80 098:600.216 SWD selected. Executing JTAG -> SWD switching sequence.
      T1C80 098:605.968 DAP initialized successfully.
      T1C80 098:632.816 InitTarget() end - Took 33.4ms

      There is no reset, nor any call to ConfigTargetSettings(), which is seen above.


      1. Is it expected that STM32H7A3VI needs to do a reset when trying to start RTT logging? If so, why does it work on STM32U585QI?

      2. Can I find the "source code" for the generic implementation of InitTarget() etc, or is this hidden inside your DLL file?

      3. Why is ConfigTargetSettings() called for STM32H7A3VI but not for STM32U585QI? Where is that decided? Is this logic hidden in your DLL file?

      4. What can cause the the failure to attach to the CPU in STM32H7A3VI (Can not attach to CPU)?



      BR,

      Johan
      Files