I am currently facing an issue while programming the STM32F746G-Discovery board using STM32CubeIDE. I have created a project using the default-generated settings and made a small modification in the GPIO configuration to set PI2 (D8) to a high output level. However, despite the console confirming that the code was flashed correctly and verified successfully, it appears that my changes are not taking effect on the board. I verified that with a multimeter.
I have also attempted to test the board using various simple code examples, but none of them seems to work either. I am wondering what could be causing this problem and if there's something I might be overlooking. Could there be a fault somewhere that is preventing my code from being properly flashed to the board, an additional step?
I was facing this issue on Windows, then decided to test the same on my Linux development laptop with a fresh installation of STM32CubeIDE. I have gone through "Help" -> "ST-Link Upgrade".
I have debugged my STM32F746G-Discovery board project using STM32CubeIDE (Version: 1.12.1) and observed some details related to the configuration of the GPIO pin PI2 (D8).
I attempted to generate a .bin file for the project through C/C++ Build settings in the STM32CubeIDE, but I couldn't locate the "Convert to binary file" option. If I would have succeeded, I would have tried to flash it using the STM32CubeProgrammer.
I used the STM32CubeProgrammer to inspect the device's memory. After erasing the device, I programmed it with my code using STM32CubeIDE. The firmware includes the change in pin configuration where PI2 is set to a high output level. After flashing the program, I noticed that the flash memory area from 0x08000000 to 0x080003F0 was the only section of the device memory displaying written data. This indicates that the flashing process was completed successfully, and the configuration change for PI2 should be included in this written data.
When I build the project in STM32CubeIDE, it successfully finishes with no errors or warnings. The build output is:
Finished building target: test.elf
arm-none-eabi-size test.elf
arm-none-eabi-objdump -h -S test.elf > "test.list"
text data bss dec hex filename
77904 476 39460 117840 1cc50 test.elf
Finished building: default.size.stdout
Finished building: test.list
06:28:52 Build Finished. 0 errors, 0 warnings. (took 5s.154ms)
In the STM32CubeIDE debugger, I navigated to the Special Function Registers (SFR) tab and selected GPIOI. I found that the MODER register (GPIO port mode register) for GPIOI had a value of 0x00. This indicates that all pins in GPIOI are configured as inputs.
When stepping over the code in the debugger, I noticed that the SystemClock_Config(); function was continuously running in a loop and the debugger would not step further. This suggests there might be an issue with the clock configuration or an error handler redirecting the execution flow back to the system initialization code.
Breakpoint 3, main () at ../Core/Src/main.c:162
162 HAL_Init();
(gdb)
Breakpoint 5, main () at ../Core/Src/main.c:169
169 SystemClock_Config();
Breakpoint 5, main () at ../Core/Src/main.c:169
169 SystemClock_Config();
Breakpoint 5, main () at ../Core/Src/main.c:169
169 SystemClock_Config();
Any guidance or suggestions on troubleshooting steps would be greatly appreciated.
Thank you!