cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745 usart 3 not working

BAl K.1
Associate III

Hello, i need help with my stm32h745i-disco. I use usart3 in PB10 and PB11 (which is used for vcp by default in arduino pin) and i cannot send or receive any data using that, is there any settings should i check? im using default HAL_UART_Transmit and HAL_UART_Receive.

7 REPLIES 7
RhSilicon
Lead

I'm going to describe something I've been through with the STM32 and the Arduino platform since I started using it a few years ago. Maybe it can help someone in the future not to waste too much time.

I've already tried using Arduino IDE with STM32, it's interesting for simple things that are already implemented, but the user has to use it the way it is. If the user need to modify something, it is more recommended to use HAL with STM32CubeIDE. Although it is a bit difficult to learn to use a new IDE, over time it is the best alternative to get the best performance from STM32, the next step is to use baremetal code (register manipulation) which can be easier with STM32CubeIDE.

The new Arduino IDE version 2 helped with code navigation, but even so the integration with the STM32 peripherals is done little by little by the developers of the libraries, in the STM32CubeIDE almost everything is already implemented.

The Arduino platform uses a layer of code independence in relation to the hardware, perhaps comparable to CMSIS (Common Microcontroller Software Interface Standard) so when the STM32 hardware user asks for help on the Arduino forum, few people will be able to have the knowledge to help. Something similar happens when the Arduino IDE user seeks help on the ST forum, few people are aware of the adaptations that were made to the STM32Cube codes to serve the Arduino platform.

Regarding the use of the UART, it is not very complicated to use, the user have to do the initializations, which can be the most difficult part for an Arduino IDE user, whereas in the STM32CubeIDE this must be done automatically with the help of the visual configurator (Device Configuration Tool Code Generator).

The examples for other lines of STM32 can serve as a basis to help the user understand how to implement:

https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Step3_Introduction_to_the_UART

Thank you for your reply! I just debug it and find out that the program is stuck in the UART_WaitOnFlagUntilTimeout() function. i search the solution and some of them are solve it with update the package but it is not work for me. do you know how to solve this?

 

Hello @BAl K.1 ,

Make sure pins, clocks and peripheral are correctly initialized. ​

FAQ: STM32 HAL UART driver - API and Callbacks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
shaani
Associate

We have the same problem. My work stops due to this error. I am working on projects related to animals including fish, insects, etc.

Pavel A.
Evangelist III

Discovery boards are complex and most of MCU pins are connected to something. Look in the board user manual for information on these pins, maybe to reuse them for your purpose you need to place or remove some SB or set a jumper.

BAl K.1
Associate III

I tried many solutions in many forums but it is just not working. and i found out that my receive status is on HAL_TIMEOUT not HAL_OK. please any suggestions or advice for this? 

please any suggestions or advice for this?

You've already got advices. Read the board user manual, look for conflicts on these pins.