Skip to main content
Associate III
February 2, 2024
Solved

Doubt with GPIO config in stm32cubemx

  • February 2, 2024
  • 3 replies
  • 1660 views

Hello,

I have a question while configuring the GPIO on stm32cubeMX. I put all my pins in the program like this:

rubenles_0-1706881193579.png

When I configure all the pins and generate the code, not all the configured pins appear in the gpio.c file on stm32cubeIDE; for example, the UART RX and TX pins do not appear in stm32cubeIDE.

Thank you so much.

This topic has been closed for replies.
Best answer by Andrew Neil

@rubenles wrote:

the UART RX and TX pins do not appear in stm32cubeIDE.


Because they are used as UART RX & TX - rather than just as GPIOs ?

Have you looked in the UART config?

EDIT:

See the HAL_UART_MspInit() in your usart.c; also look in main.h ...

3 replies

mƎALLEm
Technical Moderator
February 2, 2024

Hello,

Could you please share your ioc file reproducing the behavior as we could understand what is going on?

"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."
rubenlesAuthor
Associate III
February 5, 2024

Just trying to generate the code to show it to you, i realize that now all the gpio configs are there. I don't really know if i was confused just with UART or it was an error. By the way, it is solved, thank you so much.

Andrew Neil
Andrew NeilBest answer
Super User
February 2, 2024

@rubenles wrote:

the UART RX and TX pins do not appear in stm32cubeIDE.


Because they are used as UART RX & TX - rather than just as GPIOs ?

Have you looked in the UART config?

EDIT:

See the HAL_UART_MspInit() in your usart.c; also look in main.h ...

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.
rubenlesAuthor
Associate III
February 5, 2024

@Andrew Neil UART config was there, true, thank you so much for this advice!!! Other gpio still doesn't appear, but uart is solved thank you!!

TDK
Super User
February 2, 2024

Normally, pins are initialized in stm32h7xx_hal_msp.c for most peripherals.

"If you feel a post has answered your question, please click ""Accept as Solution""."
rubenlesAuthor
Associate III
February 5, 2024

@TDK This file is empty for me, just one interrupt configuration is in there

 

 __HAL_RCC_SYSCFG_CLK_ENABLE();

 /* System interrupt init*/
 /* PendSV_IRQn interrupt configuration */
 HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);

But nothing about gpio configs.

Thank you