cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7B3LIH6Q: Custom Board Programming Requirements

KMew
Senior III

Hello,

I am preparing a custom board and I am preparing the portion of the board to program and live debug it. I have been looking at the evaluation board schematic and some other online references and I'm getting some contradicting information, so I wanted to confirm:

  • Is SWD the common/preferred method to do both the programming and live debugging (using the CubeIDE debugging feature)
  • If I use SWD, are the following pins all that are necessary to program the STM32H7 series:

PA13 (JTMS-SWDIO)

PA14(JTCK-SWCLK)

PB3 (JTDO-SWO)

NRST (NRST)

GND

  • Is there any additional equipment I need to program the board?

Thank you in advance.

8 REPLIES 8
Sarra.S
ST Employee

Hello @KMew​,

  • yes, SWD is the common/preferred method for programming and live debugging with the STM32CubeIDE debugging feature.
  • SWD is always mapped on PA13 (SWDIO) and PA14 (SWCLK). This is the default state after reset.
  • Yes,  SWD must be made available for connection with ST-LINK.

Please refer to the AN4989 section 4.1 to know all the details

Hope that helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Sarra,

Thank you for the reply. So to confirm, based on this document:

  • I only need to enable PA13/PA14 to program/debug the board? I do not need PB3 or NRST?0693W00000Y92JsQAJ.png
  • From that document, I see two recommended products. See the picture below. Will any of those work, or does it have to be a specific one?0693W00000Y92MSQAZ.png
Nikita91
Lead II

NRST can be useful for some programming modes e.g. when you brick your MCU... Cube programmer has a mode "Under reset".

PB3=SWO is a debug tool: high speed UART like output. It is not mandatory but if you have this pin unused it may be worth routing it.

Hello Nikita91,

Thank you for your reply!

So to go through the list:

PA13 (JTMS-SWDIO) - MANDATORY

PA14(JTCK-SWCLK) - MANDATORY

PB3 (JTDO-SWO) - Optional, but recommended for debugging (Can I have it print messages in the debugger?)

NRST (NRST) - I have a physical push button for my custom board that resets it (similar to how the evaluation boards do it). For a proof of concept board, is this sufficient and I won't need the NRST pin to program?

GND - MANDATORY

Nikita91
Lead II

Have a look at the pin-out of the ST-LINK connector for the used signals.

I always route the NRST to the programming/debugging connector because the CubeProgrammer or the CubeIDE may use it.

Or look at the schematics of a board like the NUCLEO_H743 and route the signals on CN5 and CN6 to your programming/debugging connector.

CN5 is for the Virtual COM port  (VCP) supported by ST-LINK, very handy for debugging ( AN4989 section 7).

https://www.st.com/resource/en/schematic_pack/nucleo_144pins_sch.zip

Yes CubeIDE supports SWO and can displays messages.

Yes GND is mandatory.

You also need local VCC (most of the time 3.3V) if you use a ST-LINKV3SET

https://www.st.com/resource/en/user_manual/um2448-stlinkv3set-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdf

As said @Sarra.S​  the  AN4989 is your friend!

Hello Nikita,

Thank you for the reply.

I fully agree that the AN4989 is helpful, but there are details missing that are important for some of my decisions.

  • In the ST-LINKV3SET, I found the pinout for the SWD, but it doesn't mention what connector is used (1.27mm pitch header, 2.54mm, etc.). Where can I find this information?

0693W00000Y9MsdQAF.png

  • For the T_NRST pin, is it pulled to GND like it's done on the evaluation boards? If so, I could keep the push button on my PCB and use the hardware connection under reset feature, correct? (I attached a schematic of my NRST portion on my PCB for reference)

0693W00000Y9MssQAF.png

Nikita91
Lead II

Hello,

For the ST_LINKV3SET the natural connector to use is the CN1 (STDC14). Look at the manual chapter 9:

STDC14 connector (1.27 mm pitch) on target application: pinout detailed in Table 6. Reference Samtec FFSD-07-D-05.90-01-N-R

(The CN6 is obviously a 0.1" header).

The NRST pin is not pulled down. It is pulled up by an MCU internal pull up, and set to ground to activate the reset. You can keep the button for manual reset and also connect the reset pin to the debug connector.

Hello Nikita,

I am looking to optimize space on this board, so having to have a header connector on my board with that many pins will be problematic (This board is fitting in a tight space). That is why I was leaning towards CN6 and then just strictly use SWD.

When you say obviously CN6 is a 0.1" header, where are you basing your information off of? If that is the case, then that's preferred because I can more easily integrate the 0.1" pitch wire harnesses in our lab.

Thank you for confirming the NRST portion!