cancel
Showing results for 
Search instead for 
Did you mean: 

LED Blinks Automatically on Nucleo-H755ZI-Q Instead of Waiting for User Button Press

arvind014
Visitor

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 programmy program

3 REPLIES 3
TDK
Super User

> 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.

 

If you feel a post has answered your question, please click "Accept as Solution".

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.

Screenshot (19).png

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

TDK
Super User

Might want to erase the chip so any CM4 firmware isn't active.

If you feel a post has answered your question, please click "Accept as Solution".