All my previous project were based on PIC microcontrollers or Arduino board, however recently I’ve been experimenting with STM32 MCU
ST microelectronics also provides development and debugging IDE for STM32 MCU like Attolic True STUDIO and Cube MX to help in development of high-quality embedded software. For this basic design you’ll need to download and install these programs. As the first step open Cube MX and create a new project and select your board.
Verify under Configuration tab that I/O with connected LED is defined as push pull low speed output, for NUCLEO-L011K4
HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_3);
HAL_Delay(1000);
Now your code should look similar to this figure.
Now select —> Project build All. Run —> Debug As —> Embedded C/C++ Application. At this point you should see Resume, Terminate and pause button. Click Restart or Resume to run the code. If no errors were found and the board is connected you should see a green LED blinking with 1 sec intervals.