2025-07-30 6:36 PM - edited 2025-07-30 6:37 PM
Hi all! I'm using the Nucleo-H755ZI-Q board and trying to write a simple program where the LED should turn on (and stay on) only when I press the USER button (the blue one on the board). I’ve shared a screenshot of my code below. The code builds and debugs without any errors, but when I run it, the LED just starts blinking on its own... even when I haven’t pressed the button. What’s more interesting is that when I stop the program in the IDE, the LED keeps blinking, and it only stops if I enter debug mode again. I expected the LED to stay off by default and turn on steadily only when the button is pressed. Also, after flashing and starting debug, I only see a "Resume" button instead of "Run"... Not sure if that means something’s wrong or if it’s normal. Any help figuring this out would be great!my program
Solved! Go to Solution.
2025-07-31 7:12 AM
Might want to erase the chip so any CM4 firmware isn't active.
2025-07-30 8:34 PM
> the LED just starts blinking on its own
Which LED?
This is a dual core device, what is the CM4 core doing?
Hit pause and see where execution is at. Set a breakpoint within the if statement to see if it gets hit.
2025-07-30 9:36 PM
Hi,
I'm trying to turn on the LD1 LED on the NUCLEO board, which is on pin PB0 according to the .ioc file. The CM4 core doesn't seem to be doing anything. I assumed that just writing code for the CM7 core would be enough. When I click "Pause" during debugging, it either stops in the STM32H7xx_hal_gpio.c file or inside the while(1) loop in main.c of the CM7 core. (The while(1) code is in the screenshot I shared in the original post.)
I also have another question: under the Board Project Options, should I select or unselect the User LEDs and Buttons? I assumed that selecting them is necessary in order to use them.
I also tried using break point in while(1) to see if that will do any difference but no the LED just blinks and it doesnt stop
2025-07-31 7:12 AM
Might want to erase the chip so any CM4 firmware isn't active.
2025-07-31 8:26 PM
Thanks for the suggestion! I wasn’t exactly sure what you meant by “erase the chip so any CM4 firmware isn’t active,” so I tried a few things:
First, I commented out all the code in the CM4 main.c file, then built and ran only the CM7 project. But the LED still blinked on its own.
Then in the CM7 main.c, I found this line:
which wakes up CM4. I commented out just this line and ran the code again. This time, the LED didn’t blink at all — not even when I pressed the USER button. So it seemed like nothing was working. Found it interesting though
Finally, I deleted the CM4 project completely and ran just the CM7 part again, but that didn’t help either.
So I’m not sure what else to try...
2025-07-31 8:48 PM
BOYY YOU ARE A GENIUS!! I THANK YOU!! it worked like a charm!!!! TAKE A BOWWW!!!
2025-08-01 5:13 AM
It sounds like you got it, but doing a full chip erase in STM32CubeProgrammer will erase all code on there, both CM7 and CM4.