Skip to main content
Associate
June 5, 2024
Solved

Cannot find a clear mapping from physical ports/pins to the software GPIO pins

  • June 5, 2024
  • 4 replies
  • 4707 views

Hello everyone,

I am new to STM32 architecture and configuration. I am trying to configure new GPIO ports and pins in an STM32H745i-DISCO board. I had some previous code for the pin configuration, but I could not 100% map it to the user manual for the board. The code is the following. I could not match these definitions to any from the manual. Could anyone help me with the mapping for pins D0-D15 on the board? Thank you very much

 


#define LD6_Port GPIOD
#define LD7_Port GPIOI
#define LD8_Port GPIOB

#define LD9_Port GPIOC
#define LD10_Port GPIOA

#define B1_Port GPIOC

#define LD6_Pin GPIO_PIN_3
#define LD7_Pin GPIO_PIN_2
#define LD8_Pin GPIO_PIN_15

 

 

Best answer by Andrew Neil

Here they are:

AndrewNeil_1-1717602220330.png

 

EDIT:

But note that there are two errors in this table - see the posts from @mƎALLEm:

https://community.st.com/t5/stm32cubeide-mpus/cannot-find-a-clear-mapping-from-physical-ports-pins-to-the/m-p/685182/highlight/true#M658

 

4 replies

Andrew Neil
Super User
June 5, 2024

@kyrkap wrote:

I could not match these definitions to any from the manual.


If they're not in the User Manual for the board (they should be), try looking at the schematics ?

 

Please use this button to properly post source code:

AndrewNeil_0-1717601986665.png

 

 

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.
kyrkapAuthor
Associate
June 5, 2024

Thanks for the tip Andrew. First time posting here :) 

mƎALLEm
Technical Moderator
June 5, 2024

Hello,

You can find the correspondence D0-D15 / GPIO pins in the board's schematics:

SofLit_0-1717602226550.png

But also in UM2488 / Table 17. STM32H745I-DISCO and STM32H750B-DK I/O assignment: search for ARD_DXX. Example for D3 search for ARD_D3.

"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."
kyrkapAuthor
Associate
June 6, 2024

Thanks a lot for the comments and help. Final question. I try to set the pin state from code and I see no response. I control relays from the pin state and for the two new pins I see no response from the relay. This is the code that is used for all pins so far. Three work (D11, 12 and 13). D14 and D15 (new defined pins, do not.

void setLed(GPIO_Led led, GPIO_State state) {
	HAL_GPIO_WritePin(outputs[led].port, outputs[led].pin, state == LOW ? GPIO_PIN_RESET : GPIO_PIN_SET);
	if (state != outputs[led].initialState) {
		outputs[led].state = 50;
	}
}

Any ideas?

 

mƎALLEm
Technical Moderator
June 6, 2024

Before going to the implementation you need to test the IOs as I suggested before: a simple toggle for example for each pin to validate their positions on the Arduino connector. Did you do that?

For the implementation I suggest to refer to the LED BSP driver implementation from stm32h745i_discovery.c:

https://github.com/STMicroelectronics/stm32h745i-disco-bsp/blob/32bbf8a9a25c75cb7b06484694e62172fe8bc0cb/stm32h745i_discovery.c

"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."
kyrkapAuthor
Associate
June 6, 2024

Just with the HAL_GPIO_WritePin function you mean? D10 is working perfectly (new pin). D14 and 15 not at all

 

mƎALLEm
Technical Moderator
June 12, 2024

FYI,
This is just to confirm my suspicion in my previous comment regarding the discrepancy in the Arduino D0/D1 CN6 connector in table 8: PB6 and PB7 will be respectively replaced by PB10 and PB11. Also USART1 will be replaced by USART3.
The internal Ticket 183533 has been opened to fix the issue.

"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
Technical Moderator
May 6, 2025

@mƎALLEm wrote:

FYI,
This is just to confirm my suspicion in my previous comment regarding the discrepancy in the Arduino D0/D1 CN6 connector in table 8: PB6 and PB7 will be respectively replaced by PB10 and PB11. Also USART1 will be replaced by USART3.
The internal Ticket 183533 has been opened to fix the issue.


Document fixed. It was published on the ST website.

"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."