Skip to main content
Mr. AK
Associate II
May 12, 2022
Question

What are the exact pins and ports for UART1, UART4 in STM32h745I-DISCO board?

  • May 12, 2022
  • 11 replies
  • 8841 views

Hi Team,

I'm working with the STM32H745I-DISCO board for UART communication. As I'm working with UART, I'm able to get the data through UART3 from STLINK. But I also need same communication through UART 1 and UART4. Could you please help me with the exact ports and pins needs to be connected for individual UARTs for the transmission?

Thanks

This topic has been closed for replies.

11 replies

Mike_ST
ST Technical Moderator
May 12, 2022

Hello,

Please check the datasheet here:

https://www.st.com/resource/en/datasheet/stm32h745zg.pdf

If I understood well, from page 88, you will find what you want.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
Tesla DeLorean
Guru
May 12, 2022

Couldn't you look at the schematic and datasheet?

USART1_TX PB6 ARD_D1

USART1_RX PB7 ARD_D0

USART2_TX PD5 STMOD2 via SB16

USART2_RX PD6 STMOD3 via SB12

UART4_TX PA0 STMOD1 via SB19

UART7_TX PB4 ARD_D10

UART7_RX PA8 ARD_D5

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Mr. AK
Mr. AKAuthor
Associate II
May 12, 2022

Hi,

Thank you for replying to our query. But we have tried this for UART7 and UART1. All our hardware set-up seem to be correct but we are not able to get the proper output. By using UART1 we are able to establish the communication but getting junk data in the hyper terminal. Are there any parameters need to be added to get correct data?

Thanks

Mike_ST
ST Technical Moderator
May 12, 2022

Difficult to tell without code, but most of the time it revolves around one of these points:

1 - check your UARTx input clock in SystemClock_Config() function

2 - check proper pins initialization in HAL_UART_MspInit(UART_HandleTypeDef *huart)

3 - check config in MX_UARTx_UART_Init(void)

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
Andrew Neil
Super User
May 12, 2022

As already noted, the exact microcontroller ports & pins will be in the microcontroller's datasheet.

To find how those pins are then routed on the Disco board, you will need to study the User Manual (including the schematics) for that board.

You will also need to pay attention that the board isn't using those pins for other onboard functions/features...

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.
Mr. AK
Mr. AKAuthor
Associate II
May 13, 2022
Mr. AK
Mr. AKAuthor
Associate II
May 13, 2022

Hi Team,

I have already attached and sent one file (main.h file) in the previous reply accidently . We have been able to make the USART communication possible with USART3 but not with any other UARTs. We tried with USART1 but getting only junk data. We have only modified the main.h file for USART1(changed the ports also accordingly) and the main.c file is as it is.

I'll also attach the main.c file along with this reply. Please take a look into it.

We are using Keil IDE.

Thank you.

Andrew Neil
Super User
May 13, 2022

So have you reviewed the chip's datasheet and the board's User Manual (including the schematics) to answer the fundamental hardware questions of pins and board routing?

There's no use going to code before that's established...

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.
Mr. AK
Mr. AKAuthor
Associate II
May 16, 2022

Thank you all for responding and providing the solution.

We tried all the possible options but unfortunately we're not be able to get the result what we expected.

We took the example code and modified the SystemClock_Config()  only then USART3 (STLink) worked successfully.

Now for the USART1, by modifying the main.h code (attached in previous chat) and connecting exact pins of board to USB-TTL connector we were able to get garbage data and we got stuck here. Also we have done step by step debugging and both the projects seems to working fine, I can see no difference. So what might be the reason and do I need to modify the other files too? Like streams, clocks? Please support.

Explorer
April 3, 2024

was this solved?