Skip to main content
Associate II
April 23, 2024
Question

problem of using USART6 on STM32F769I DISCOVERY kit board

I am using the usart6 port (PC6 and PC7) on a STM32F769I DISCOVERY board to communicate with another STM32F769I DISCOVERY board. I use cubemx generated code "MX_USART6_UART_Init" to initiate the usart6 and use "HAL_UART_Transmit" on sender and "HAL_UART_Receive_IT" on receiver. The problem I have now is the received data shifts one byte to right compared to the send data. Both "HAL_UART_Transmit" and "HAL_UART_Receive_IT" returns with "HAL_OK".

Any thoughts what could be the root cause? Thanks!

This topic has been closed for replies.

17 replies

Associate II
April 29, 2024

It is not the race condition. Both boards are set up as the combination of transmitter and receiver so it does not matter which one starts first. It occurs randomly (not always) in both the standalone board and two boards connected, and it is usually fixed by just reset the program (by software reset in IAR).

I think the problem is that Rx input is float when it is set up as "GPIO_NOPULL", which causes an unknown input state during start up. It triggers error interrupts right after the start up.

Karl Yamashita
Principal
April 29, 2024

You need to Google about push-pull and open collector outputs. Once your learn about push-pull which UART uses, you'll soon understand that the Rx line would be pulled to high once the transmitting board is initialized.

 

If you look at any of ST's Nucleo boards which uses UART for the VCP between the debugger
MCU and the actual STM32, you'll see they don't use internal/external pull-ups. 

 

I2C uses open collector output so that is why you must have pull-ups for that type of peripherals but not for UART.  

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source