cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745I-DISCO UART communication problem

EnesUNLU
Visitor

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?

5 REPLIES 5
mƎALLEm
ST Employee

Hello @EnesUNLU and welcome to the ST community,

As you can see from the board schematic, PC6 and PC7 are not exported on the Arduino header. Tx and Rx are exported on D0/D1 (PB10/PB11) on CN6 connector:

mALLEm_0-1769436457506.png

So for now use USART3 and connect PB10/PB11 together.

PC6 and PC7 are already used by the eMMC memory:

mALLEm_1-1769436680254.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.

Thanks for the fast reply, I tried what you said and since last 3 days I am tryng to solve this problem and I have tried all rx/tx pins. IBut I cannot do it. Maybe my board is burned or?

Please select one configuration and retest: select USART3 and connect PB10 to PB11.

If it doesn't work you can share your code with that configuration i.e. USART3 using PB10 and PB11.

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.
Saket_Om
ST Employee

Hello @EnesUNLU 

Could you please confirm whether the HAL_UART_TxCpltCallback is being executed in your application?
This will help us verify that the transmit interrupt path is working correctly.

In addition, could you check the TX line with a logic analyzer or oscilloscope to confirm that the data is actually being transmitted on the pin?

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.
Saket_Om
Andrew Neil
Super User

Before adding the complication of interrupts, have you got this working using just blocking calls ?

 

Getting the simple blocking calls working first will demonstrate that your basic hardware setup is working - then you can move on to working with interrupts ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.