1

I love STM32 nucleo boards and they have tons of UARTs. Now want to use two UARTS for protocol conversion (rx at 115200baud, tx at 38400) on a stm32g0316 discovery board that has only two UARTs.

How would I be able to connect the debugger (ST Link) that is using UART as well?

JeromeBu1982
  • 315
  • 2
  • 9
  • 1
    Beware that you could have a unsolvable buffering problem if the flow of input data exceeds what the output baud rate can handle on a continuous basis. Hopefully you have gaps in the input where you can drain your buffers at the slower output rate. – Chris Stratton Jun 24 '20 at 22:07

1 Answers1

4

The debugger is not using a UART it is communicating via SWD with the device.

It only happens that the Nucleo boards have one UART connected to a virtual USB to COM bridge integrated into the debug header of the board (the part you can break off).

There are solder bridges and jumpers on the Nucleo boards which allow you to disconnect the UART from the virtual USB COM port on the debug header and route them to the normal pins on the headers.

The documentation and schematics of the Nucleo boards will tell you which solder bridges or jumpers have to be adjusted.

Arsenal
  • 17,464
  • 1
  • 32
  • 59
  • Ah! So I mixed using Nucleo's USB for terminal in/output with the actual programming part. That is S(erial...)WD and indeed in the datasheet as a single pin (pin 7 on a 8 pin package). I am now confused that this pin can even be used for other things. Tried to google how debugging really works but also how the programming works. Hadn't found a good link (hence I posted my question, I really had no idea of this basic and important part. Nucleo makes it toooo easy) – JeromeBu1982 Jun 25 '20 at 07:24
  • @JeromeBu1982 The serial wire debug interface uses at least three pins: ground, serial wire clock and serial wire debug input/output. For STM32 the pins usually are PA13 and PA14. You can use those pins as general purpose IO but if you do so, you cannot connect to a running target. You only can connect during a reset (when the pins are in their initial state). – Arsenal Jun 25 '20 at 07:34
  • Perfect! I only now got that. Found the swd io and clk. Answers – JeromeBu1982 Jun 25 '20 at 16:20