cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745I-DISCO UART communication problem

EnesUNLU
Associate II

Hello everyone,

First of all I am kinda new in ARM (I never use), I am working on the STM32H745I-DISCO board (using the CM7 core) and I am facing a persistent issue with UART . No matter what I try, the RX Interrupt never triggers, and the code never enters the HAL_UART_RxCpltCallback.

My Setup: Board: STM32H745I-DISCO

IDE: STM32CubeIDE (Latest Version)

Scenario: UART Loopback Test (Connecting TX to RX physically).

Peripheral: USART6 (TX: PC6 / RX: PC7) on the Arduino Headers (D1/D0).

Settings: 115200 baud, 8N1, Asynchronous.

The Problem:

-HAL_UART_Transmit works fine (signals observed). HAL_UART_Receive_IT returns HAL_OK. However, the HAL_UART_RxCpltCallback is never executed.  When checking SFRs in Debug mode: RXNE flag stays at 0.

What I have verified so far (Step-by-Step):

NVIC Settings: USART6 global interrupt is Enabled in CubeMX.

Vector Table: USART6_IRQHandler exists in stm32h7xx_it.c and calls HAL_UART_IRQHandler.

Initialization Order: I ensured that MX_USART6_UART_Init() is called BEFORE HAL_UART_Receive_IT in main.c.

Cache Management: I know H7 has cache coherence issues, so I completely Disabled D-Cache (SCB_DisableDCache()) at the beginning of main() to avoid DMA/Buffer issues (even though I am using IT, not DMA).

Hardware: Tested with a jumper wire between PC6 and PC7. I also tried different UART pins (like UART3 VCP), but the result is the same.(Also I tried another pins and UARTx or USARTy )

HardFault: Previously I had HardFaults due to init order, but that is fixed. The code runs, the while(1) loop blinks the LED, but no interrupt occurs.
Can someone help me?

17 REPLIES 17
EnesUNLU
Associate II

-UPDATE-
As you guys mentioned I check pins with multimeter and I saw there is no Voltage in any pin (PB10 and PB11). Why it is occur does anyone know:/ I will Start new STM32 Project and try it again.

mƎALLEm
ST Employee

Hello,

Please share your project so we can look at it closely.

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.
EnesUNLU
Associate II

I attached my project as .rar

Hello,

It seems the VCP connection has been changed from the board rev B01 to B02 from USART3 to USART1:

Rev B01:

mALLEm_0-1769594007082.png

Rev B02. and starting from Rev 2, USART1 is used with VCP instead of USART3:

mALLEm_1-1769594096208.png

So check the revision of your board:

mALLEm_2-1769594630618.png

If B02 or later you need to use USART1. I've attached a project where USART1 is used and Tx and Rx are looped back and the Rx callback is continuously called each character is received.

Hope that helps.

 

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.

Thanks for that information I will try it now but I checked that you said and I have "B03". I was using revision "B01" as you mentioned. How can I find "B03" or I can still use "B02" ?

As I said starting from B02 you need to use USART1.

The different schematics' versions are available at this link:

mALLEm_0-1769597094421.png

Each schematics corresponds to a revision of the board.

So now please retry with the project I shared and get back to me with the result.

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.
mƎALLEm
ST Employee

@EnesUNLU 

That's not the correct post to accept as solution:

mALLEm_1-1769610289358.png

 

You need accept the previous one (below) as it answers your original question:

mALLEm_0-1769610271404.png

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.

Dear @mƎALLEm and all community, 
Thank you all for your helpfulness and consideration. Finally I solved the problem I changed the code entirely and I write from your code taking sample by sample. As you mentioned probably It was because of "different schematic problem" . After the changing pins In debug I saw variable rx is increasing and I can measure output voltage 3.3V (From D1/Tx pin).
Probably I will have another questions in soon :D