Skip to main content
Associate II
August 20, 2025
Question

IOC not generating pin setup for gpio output

  • August 20, 2025
  • 9 replies
  • 725 views

My colleague is working with the stm32h743.

Initially PC7 was setup as a PWM output.  That worked fine.

When he changed the pin to GPIO_output, no code was produced to set up the pin.

By manually entering code, we could get the pin to be configured as we want.  
But no matter what we tried, the IDE would not generate configuration code

9 replies

TDK
Super User
August 20, 2025

Include the IOC you're having problems with.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Ghofrane GSOURI
Technical Moderator
August 21, 2025

Hello @jwtuttle 

Could you please provide more details about the version of STM32CubeMX your colleague is using, as well as the operating system? Additionally, as @TDK  mentioned, please share your IOC file so we can review your project configuration and help identify the issue.

THX

Ghofrane

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.
jwtuttleAuthor
Associate II
August 21, 2025

STM32CubeIDE version 1.19.0

ico included

TDK
Super User
August 21, 2025

Pin PC7 is correctly set as GPIO output in the IOC:

TDK_0-1755792564857.png

And after generating code, it's correctly initialized as output within MX_GPIO_Init.

TDK_1-1755792683936.png

 

It looks like everything is behaving as intended. What makes you think it's not being initialized?

"If you feel a post has answered your question, please click ""Accept as Solution""."
jwtuttleAuthor
Associate II
August 21, 2025

because when we run the "generate code" that line set doesn't appear in our main.c

 

jwtuttleAuthor
Associate II
August 21, 2025

It is possible that a sequence of events is required to cause the bug.

Initially the pin was setup as a PWM pin and the timer was also setup to establish that.

Later, using the GUI, the timer was disabled and the pin was changed to std_io.

It was at that point that the "generate code" did not produce initialization code.

Visitor II
August 21, 2025

Here is the sequence of events as I remember.

1- I tried to use the pin as GPIO while it was configured as a timer. It did not work as a GPIO.

2- After I realized that the pin was configured as a timer, I changed it to be a GPIO. However, the pin was stuck low when I executed the code.

3- To double check, I configured the pin as a timer again. When I executed the code, it worked as timer as expected.

4- I configured the pin as a GPIO again. However, the pin was stuck low when I executed the code.

5- Consulting with jwtuttle, he did what he described above. The GPIO behaved as expected this time.

6- When I tried to reverse what jwtuttle did, the GPIO got stuck again.

TDK
Super User
August 21, 2025

Again: Include the IOC file of the program you're having trouble with that generates the faulty code. There are no issues with the one you attached, as shown in the screenshots.

 

It's possible you're not regenerating the code, or looking at a different main.c. In any case, if the issue can't be replicated, it is unlikely to be solved.

"If you feel a post has answered your question, please click ""Accept as Solution""."
jwtuttleAuthor
Associate II
August 26, 2025

It appears we had two different problems that prevented the IOC from generating new code:
1. We weren't logged into ST (which wasn't a problem in the past)

2. The new security protocols may have prevented a write to the project.  I have several tools that can not be used with OneDrive as the project location.

The project is moving forward.

Thank-you for the answers above.