2025-08-20 1:46 PM
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
2025-08-20 2:15 PM
Include the IOC you're having problems with.
2025-08-21 12:37 AM
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.
2025-08-21 8:33 AM
2025-08-21 9:12 AM
Pin PC7 is correctly set as GPIO output in the IOC:
And after generating code, it's correctly initialized as output within MX_GPIO_Init.
It looks like everything is behaving as intended. What makes you think it's not being initialized?
2025-08-21 10:10 AM
because when we run the "generate code" that line set doesn't appear in our main.c
2025-08-21 10:13 AM
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.
2025-08-21 10:50 AM
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.
2025-08-21 11:19 AM - edited 2025-08-21 11:35 AM
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.
2025-08-26 6:13 AM
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.