2024-06-26 08:29 AM - edited 2024-06-26 09:18 AM
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.
2024-06-26 08:43 AM
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
2024-06-26 08:53 AM - edited 2024-06-26 08:54 AM
@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:
And if it's not a Nucleo board, you still need to check that there's nothing else driving it ...
2024-06-26 09:08 AM - edited 2024-06-26 09:08 AM
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
2024-06-26 09:18 AM - edited 2024-06-26 09:23 AM
Yes, it's nucleo board :)
2024-06-26 09:31 AM - edited 2024-06-26 09:32 AM
I stumbled upon something in the User Manual (UM1956)
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?
2024-06-26 09:44 AM
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
2024-06-26 09:48 AM - edited 2024-09-18 04:50 AM
So you are using a Nucleo-32 board?
"ST-Link" is the programmer/debugger built into the Nucleo board:
More details in section 6.3 of the User Manual (UM1956).
@a1rWAXTA wrote:Why in alternate function table, it is shown that PA3 can be mapped to USART_RX
That's a function of the chip - irrespective of what board it's mounted on.
@a1rWAXTA wrote:but here is written that PA15 is connected to ST-LINK.
That's about the wiring on the board - which is external to the chip.
EDIT:
The chip is highlighted in red; the board in blue:
Note how the board is providing connections from the chip (the STM32 microntroller) to the Button, the LED, and the ST-Link.
2024-06-26 10:42 AM
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?
2024-06-26 11:01 AM
@a1rWAXTA wrote:Could you please explain me this schematic? What is the part U2
That is the STM32F303K8 microcontroller:
@a1rWAXTA wrote:what is Extension connectors?
Those are the 2 rows of pins on the sides of the Nucleo board - marked as "Arduino Nano connectors" in the UM:
@a1rWAXTA wrote:A3, D3 etc. mean analog pin, and digital pin (in/out) respectively, don't they?
Those are the standard functions assigned in the Arduino Nano pinout - but the pins aren't restricted to just those functions.