Skip to main content
mpen.1
Associate II
January 20, 2022
Question

Hi guys,who knows what the best to connect STM32H743 to a computer for debugging?

  • January 20, 2022
  • 22 replies
  • 8485 views

..

This topic has been closed for replies.

22 replies

Danish1
Lead III
January 20, 2022

You'll need two things

  • the hardware interface JTAG or ST-Link
  • the software that runs on the computer. An "integrated debugging environment"

Best?

Are we talking about a hobbyist student who is willing to put time and effort into sifting through documentation/youtube/web-searches but can only afford something relatively cheap.

Or a major institution with unlimited budget looking to equip a major research laboratory.

You can't go far wrong starting with the stm32cube software, and an stm32 nucleo/discovery board that has built-in USB-to-jtag/st-link

But when you're designing your own boards you'll want a separate JTAG/ST-Link. ST sell some. I happen to use one by Rowley*. As far as I know there are more expensive ones by Segger (maybe others) that add trace capability.

*I use their commercial Crossworks IDE. I started before stm32cube was around, and I prefer it. But other offerings also exist.

Hope this helps,

Danish

mpen.1
mpen.1Author
Associate II
January 20, 2022

The board you mean is compatible with ST-link,I would have to try in order to make it work?

Javier1
Principal
January 20, 2022

jeeesus, did you etched the PCB yourself? Why there is no soldermask?

looks nice tough

hit me up in https://www.linkedin.com/in/javiermuñoz/
Javier1
Principal
January 20, 2022

"debugging"

What do you need to debug?

Normally in my designs i expose the SWD pins + one uart to connect with an STLINK

You could buy one stlink from ST or if you already have any discovery/nucleo board, those already have an embedded stlink you could rewire.

hit me up in https://www.linkedin.com/in/javiermuñoz/
mpen.1
mpen.1Author
Associate II
January 20, 2022

I've order online they made it ! Never had the chance to make it work properly! I was wondering from the software ST there s a method to connect to it through bluetooth or wifi , from ST thisone https://www.st.com/en/development-tools/st-link-v2.html

mpen.1
mpen.1Author
Associate II
January 20, 2022

https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html even this you mentioned ,my aim is to debug in real time while the device is playing so I'd rather do it even through bluethooth maybe wifi

Tesla DeLorean
Guru
January 20, 2022

If you're looking to instrument your code for diagnostic or telemetry messages use a Bluetooth module connected to a UART​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
mpen.1
mpen.1Author
Associate II
January 20, 2022

well is to make the code working fine

Tesla DeLorean
Guru
January 20, 2022

Debugging tends to work better with the least number of abstractions away from the hardware you're trying to understand. Wireless debugging strikes me as snake-oil nonsense that just obfuscates the task at hand, sounds good, but can get better results just plugging a cable into the header.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Paul1
Senior III
January 20, 2022
  1. Normal debugging uses low cost STLink (Debug by Breakpoints, memory view, etc.). You'll want that first for programming and to debug any wireless or other connections you create.
  2. UART or USB VCP debugging, where you output diagnostics using your own code, i.e. printf(). With an appropriate IC these could be redirected over wireless, though there will likely be bandwidth limits. I suggest creating ring buffers so your code dumps diag to the ring buffers, and the ring buffers are sent over UART/VCP/wireless as the bandwidth allows. Ring buffers maybe 10K~100K depending on how verbose you are. Include code to handle ringbuffer overflow when you get too verbose :)
  3. Full speed real time debugging can use Trace Interface (JTracePro for Cortex M $$$). Be very careful to keep traces from STM32 to connector short, balanced, equal length, etc. See the appropriate app notes. Any issues will limit the MHz the STM32H743 can be traced at. This is way faster than anything wireless can handle, but even with this done perfectly you can probably only run the H743 at half speed before diag info overloads the trace link. You can configure the RCC to slow down the H743 when using Trace, then when debugged recompile with the RCC back to full speed (with appropriate timing corrections in your code). You can use regular STLink functions with H743 at full speed.

Paul

mpen.1
mpen.1Author
Associate II
January 21, 2022

Hi Paul,the first option becouse after i would have to handle the code it is written already,maybe it is accessible to start to debug from the ide ,second option afterward i ve done a bit of practice with coding..

Which st link is good for stm32h743​

I ve saw few once onilne​,

Also do you recon in the maintime I could connect to the stm32 from the ide or from laptop through bluetooth?

If yes wht the best

Danish1
Lead III
January 21, 2022

That does look like an impressive board.

We do not need to know what the board is intended to do, but please tell us more about the timing or other requirements for debugging.

For example, if the board controls a high-power motor, where momentarily freezing execution could lead to burned-out windings, then conventional JTAG / ST-Link debugging is difficult. This is because the way JTAG works is that it momentarily freezes the stm32 and instead reads/writes debug information from the internal processor buses. That freezing is extremely quick on a "human" timescale, but could be thousands of processor-clock-cycles.

And your desire for wireless debugging e.g. Bluetooth suggests there might be high voltages present and that you want electrical isolation to protect your PC. If this is the only worry, I seem to remember that ST had an opto-isolated ST-Link.

Years back, people would do "burn-and-crash" debugging - burning fresh code into an eprom, then letting it run - observing the execution and outputs on an oscilloscope or logic-analyser. Then trying to guess where the outputs did not match what was intended and from that deducing what might be wrong with the code. Not easy, but it was all we had.

Things are much easier if you can send debugging information out, but all interfaces (other than direct-writes to LEDs) are also very slow compared with the stm32. Even with a handy JTAG for getting the exact processor state, memory-contents etc at a breakpoint, I like to have a UART for logging near-real-time diagnostics at various points in my code without having to freeze execution. But UARTs are slow, so I have to code a FIFO for my UART.

Hope this helps,

Danish

Pavel A.
January 21, 2022

>  all interfaces (other than direct-writes to LEDs) are also very slow compared with the stm32.

ITM (SWO) should be pretty fast, and it consumes only one pin, compared to the 'serious' ARM trace. It has internal buffer to store data bursts before transmitting to the host.

Using ITM just as replacement of UART, one byte at a time, is a waste. It can send 4 characters at once, but AFAIK all s/w tool implement only single byte mode. (is this to allow unicode characters perhaps?)

Paul1
Senior III
January 21, 2022

What connector is on your board?

We have STM32H743 boards with tiny MIPI 10,14,20pin, and we use:

You can also get the STLINK-V3SET, bigger and different connector but same functionality.

Don't get STLINK-V3MODS, it doesn't have a connector.

Segger parts also work (and may also do non-ST ARM MCUs).

If you have an ST demo board you may be able to use its onboard STLINK, see the docs for the board you have.

I wouldn't buy anything except ST or Segger, I've heard some of the knockoffs are flakey, and the STLINK-V3MINI is just so low cost why not get real thing.

Paul

Pavel A.
January 21, 2022

Hmm, I've missed this newsletter )

https://blog.st.com/tapnlink-nfc-st25dv/

mpen.1
mpen.1Author
Associate II
January 22, 2022

sure,I mean presferences and configuration file has to be set better,

so to work on the projects,It has being created meticoulosly well ,

design ether software still to make confidence with it,but I can do it !