This is the first project done to familiarize with STM development environment.
Youtube Video
Development kit:
- STM32CubeMX
- STM32CubeIDE
Instruction
- A new project name LED_BLINKING is created using STM32CubeIDE and STM32CubeMX.
- Board is selected from the board selector in CubeMX so that it can pre-populate all pins that are connected on the board.
- The LED that will be used for this project is determined which is at PA5 and declared it as GPIO Output and the user label is LD2[green_Led].
- Code is generated after all configuration is done.
- In the main loop, HAL functions are called to make the desired LED to blink:
- HAL_Init(); //Reset of all peripherals, Initializes the Flash interface and the Systick.
- SystemClock_Config(); //called the SystemClock function to configure the system clock
- MX_GPIO_Init(); MX_USART2_UART_Init(); //Initialize all configured peripherals
- HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); //Toggle the LED
- HAL_Delay(500); // Delay
- 500ms is used to make the LED blink every 1 second
- The code is pushed to the board.
- Reset button is pressed to make the board execute the blinky code.