cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 N6 FSBL USART doesn't work

HANITALY
Associate II

Hi,

 

I have been trying to study how to use the N657X0 Nulceo board. 

When I tried to test the USART of the board with an FSBL project, there was no print on the serial monitor, and I could not find the reason. Could somebody check what the problem is with my project? 

 

I have attached my projects below.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RomainR.
ST Employee

@HANITALY 

To use strlen(), the string header must be added.

#include <string.h>

To use printf, you must also redirect stdio fputc to USART1.

See the main.c file modified in attachment and the terminal result below using PC4 USART1_TX.

The printf and UART Transmit are working now.

RomainR_0-1748263090447.png

In your code:
PC4 USART1_TX is available on AF4
PF12 USART1_RX is available on AF12

PC4 is available on MORPHO connector CN3 pin #13
PF12 is connected to Ethernet LAN8742A device on board, and it is not available on MORPHO connectors.

If you need TX and RX you can also use PD9 USART3_RX and PD8 USART3_TX on CN15 pin #35 and #37.  

Note: PE5 USART1_TX and PE6 USRT1_RX are also connected to embedded STLinkV3 Virtual COM Port.
Refer to the example below:
STM32Cube_FW_N6_V1.1.1\Projects\NUCLEO-N657X0-Q\Examples\UART\UART_Printf

Best regards,

Romain,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
RomainR.
ST Employee

@HANITALY 

To use strlen(), the string header must be added.

#include <string.h>

To use printf, you must also redirect stdio fputc to USART1.

See the main.c file modified in attachment and the terminal result below using PC4 USART1_TX.

The printf and UART Transmit are working now.

RomainR_0-1748263090447.png

In your code:
PC4 USART1_TX is available on AF4
PF12 USART1_RX is available on AF12

PC4 is available on MORPHO connector CN3 pin #13
PF12 is connected to Ethernet LAN8742A device on board, and it is not available on MORPHO connectors.

If you need TX and RX you can also use PD9 USART3_RX and PD8 USART3_TX on CN15 pin #35 and #37.  

Note: PE5 USART1_TX and PE6 USRT1_RX are also connected to embedded STLinkV3 Virtual COM Port.
Refer to the example below:
STM32Cube_FW_N6_V1.1.1\Projects\NUCLEO-N657X0-Q\Examples\UART\UART_Printf

Best regards,

Romain,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.