cancel
Showing results for 
Search instead for 
Did you mean: 

Cant't send message with usart2.

HQIN.1
Associate

Hi All,

i'am beginner of using libary HAL, i use CubeMX to generate code. At first, I use usart1 to send message and i work, and then i try to use usart2 but i cant can't send any message.

these two code is almost the same.

5 REPLIES 5
S.Ma
Principal

Elaborate, which chip and which pins/alternate functions?

A peripheral without configured pins is a blind guy.

0690X00000BuyAMQAZ.pngi used nucleo f401 so is stm32f401,

There should be no pullup (nor pulldown), and I/O speed should be low (unless the baudrate is higher than 4 MHz).

Check the board user manual, PA2 and PA3 might be connected to the onboard debug adapter by default, and not available on the pin headers, unless you modify some solder bridges first.

dbgarasiya
Senior II

check datasheets whether pin PA2 and PA3 for usart2

otherwise could be hardware fault

On Rx pin pull-up is recommended!