Skip to main content
Associate II
June 26, 2024
Question

NUCLEO STM32F303K8 PA3 pin doesn't work for UART receive

  • June 26, 2024
  • 3 replies
  • 3294 views

Hello,

I came across a behavior that I don't understand. In the board's datasheet, I can clearly see alternate function for pin PA3 is USART2_RX but once set, it doesn't work. When I set USART_RX on pin PA15, it works just fine. Can someone explain why it doesn't work? Maybe there are some limitiations which I don't understand or it is MCU malfunction.

3 replies

waclawek.jan
Super User
June 26, 2024

What hardware is this, a Nucleo board? Are you sure PA3 is connected to your signal source?

Read out and check GPIO and UART register settings.

JW

 

Andrew Neil
Super User
June 26, 2024

@waclawek.jan wrote:

What hardware is this, a Nucleo board?


@a1rWAXTA  If it is a Nucleo board, note that the ST-Link's VCP may be connected to PA3:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/i-cannot-receive-data-while-using-usb-to-uart-for-nucleo-f411re/m-p/690201/highlight/true#M19855

 

And if it's not a Nucleo board, you still need to check that there's nothing else driving it ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
waclawek.jan
Super User
June 26, 2024

@Andrew Neil,

the STM32xxxKx would be a 32-pin Nucleo, and that uses PA15 as the Rx pin for the on-board VCP.

Although, maybe that's what confuses @a1rWAXTA ...?

JW

 

a1rWAXTAAuthor
Associate II
June 26, 2024

I stumbled upon something in the User Manual (UM1956)

a1rWAXTA_0-1719419339659.png

I am confused now. Why in alternate function table, it is shown that PA3 can be mapped to USART_RX but here is written that PA15 is connected to ST-LINK. What does it mean? What exactly is ST-LINK in that case?

 
Tesla DeLorean
Guru
June 26, 2024

The Alternate Function tables list a lot of different options, the issue is picking one which is actually board appropriate, which depends on how it's physically wired.

https://www.st.com/en/evaluation-tools/nucleo-f303k8.html#cad-resources

https://www.st.com/resource/en/schematic_pack/nucleo-32pins_sch.zip

PA3 is exposed as an Analogue Input on the CN4 connector

nucleo32_f3.jpg

 

 

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
a1rWAXTAAuthor
Associate II
June 26, 2024

Could you please explain me this schematic? What is the part U2 and what is Extension connectors? PAx are MCU's pins and they can be assigned to various alternate functions but I'm limited to those what board realize, right? A3, D3 etc. mean analog pin, and digital pin (in/out) respectively, don't they? And hence I can assign (in cubemx) only those functions pointed on the schematic, even though cube allows me to assign other functions (for whatever reason?). For example PA15 can be only mapped to usart, and can't be mapped to general purpose input and PA3 is analog input/output? Do I understand it correct?