1
\$\begingroup\$

Regarding this STM32 board. I want to send character to it by from a terminal program using ST-LINK module and only USB. I can do that by using USB to TTL converter. For instance I enable the pins of USART1 and use the following for TTL Rx Tx pins:

HAL_UART_Receive_IT (&huart1, Rx_data, 1);

The thing is under connectivity no USARTS enabled but USART1(which I enabled for TTL to USB):

enter image description here

And I know that if I knew the USART name I could communicate through this port:

enter image description here

I just need to change huart1 to huartX but I couldn't figure out which one.

Edit:

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ 6.1.3 ST-LINK/V2-A VCP configuration on page 15 explains what you need to do. \$\endgroup\$ Commented Feb 4, 2022 at 9:56
  • \$\begingroup\$ Does that mean I need to solder that little surface mount chip's super tiny pins i.sstatic.net/At6RW.png to PA2 and PA3? Omg this is insanely impractical for an evaluation board. \$\endgroup\$ Commented Feb 4, 2022 at 12:19
  • \$\begingroup\$ If you want to use the ST-LINK, then yes. You need to solder wires to the LQFP144 package. At least both pins are at the end of a row, which makes it slightly less cumbersome. That surprises me, considering that both products come from the same manufacturer. The other option is to use a standalone UART-to-USB adapter (e.g. TTL-232R-3.3V). I'd opt for the second option. \$\endgroup\$ Commented Feb 4, 2022 at 13:06

2 Answers 2

1
\$\begingroup\$

The PDF you linked to says the VCP is not connected to the target MCU at all, and shows how to connect it to USART2 as an example.

\$\endgroup\$
3
  • \$\begingroup\$ Since USART is shown disabled that made me confused. \$\endgroup\$ Commented Feb 4, 2022 at 9:21
  • \$\begingroup\$ Does it mean one needs to solder that little surface mount chip's super tiny pins i.sstatic.net/At6RW.png to PA2 and PA3? This is insanely impractical for an evaluation board. \$\endgroup\$ Commented Feb 4, 2022 at 12:20
  • \$\begingroup\$ If you want to use the VCP provided by ST-Link, yes. You do have the alternaribe to use a USB to 3.3V TTL UART cable. And the reason why this board does not connect UARTs is unknown. \$\endgroup\$ Commented Feb 4, 2022 at 12:29
0
\$\begingroup\$

In order to find what USART interface to use you usually need a PCB schematic, which will show what UART pins of MCU are connected to ST-Link.

Normally, you need to download board schematic for your disco, for example: https://www.st.com/en/evaluation-tools/stm32f4discovery.html#cad-resources

In board schematic you find ST-Link, find its TX/RX pins and check where they go to MCU. Usually they're connected to MCU.

Luckily for you, the document you provided is enough without going into board schematic at all (but I still recommend that you download it, it's nice to have it around sometimes), on page 15 of the document you provided you can see that ST-Link UART is not connected by default, but you also see what pins you need to connect. And it will become USART2 peripheral. Yeah you'll have to connect them with wires.

Alternatively, nothing stops you from connecting any other UART pins without soldering if UART pins of MCU are exposed on Pin Headers. This you will actually have to figure out with board schematic. Remember, that multiple pins can have same USART peripheral functionality (some USART3_RX can be on multiple MCU pins), so check pin functions carefully. Also, you probably know it, but it never hurts to remind that RX must be connected to TX and vice versa (although STM32 can have TX/RX pins swapped).

As for why things are initialized or not by Cube, it doesn't always initialize correct peripherals. You need to check what it activates by default. Usually it's right, but every now and then you need to change something, so don't be surprised.

\$\endgroup\$
1
  • \$\begingroup\$ But those ST-LINK chip pins are surface mount. It super difficult to solder them without damage, \$\endgroup\$ Commented Feb 4, 2022 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.