Skip to main content
Mario Luzeiro
Associate III
March 29, 2022
Solved

STM32CubeMX not generating #defines for GPIOs on STM32MP1 CM4

  • March 29, 2022
  • 3 replies
  • 3430 views

Hello all,

I am used to the regular MCUs STM32Fx families where I'm used that the main.h has all the #defines of the GPIOs and other peripherals.

I'm now using STM32MP1 generating code for CM4 and noticed it is generate any #define information.

also, it is not initializing GPIOs state.

Why is it generating no initialization of GPIOs or other user label #defines?

This topic has been closed for replies.
Best answer by TDK

GPIO pin context is assigned at the pin level.

Right click the pin in pinout view -> Pin Reservation -> Cortex M4

0693W00000LwAofQAF.png

3 replies

TDK
Super User
March 29, 2022

Are they assigned to the CM4 core? Attach your IOC.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Mario Luzeiro
Associate III
March 29, 2022

IOC Attached.

I can't find any configuration to assign it to each core, where should I look for it?

TDK
TDKBest answer
Super User
March 29, 2022

GPIO pin context is assigned at the pin level.

Right click the pin in pinout view -> Pin Reservation -> Cortex M4

0693W00000LwAofQAF.png

"If you feel a post has answered your question, please click ""Accept as Solution""."
Mario Luzeiro
Associate III
March 29, 2022

Thanks, that was a new (hidden) option for me!

Joerg Wagner
Senior III
May 10, 2023

But there are still no #defines in main.h or anywhere

but now there is code generation for GPIO.

I tried with and without RESMGR_UTILITY.

ECoul.1
Visitor II
May 22, 2023

I agree, I still have the same issue using the latest version of CubeMX. I working on a project using STM32MP157C-DK2 and the user labels are not correctly generated, except for a few of them (~30 % are correctly generated in main.h).