A Step by Step Tutorial to Get Started With STM32 Black Pill and STM Cube IDE to Blink External Connected LED Using HAL Programming.

by vanshika4566_be23 in Circuits > Microcontrollers

112 Views, 0 Favorites, 0 Comments

A Step by Step Tutorial to Get Started With STM32 Black Pill and STM Cube IDE to Blink External Connected LED Using HAL Programming.

Screenshot 2024-05-07 092100.png

Hello, this is a blog that gives you a step by step tutorial to get started with STM32 black pill and STM cube IDE to blink

external connected LED using HAL programming.

Supplies

  • STM32 black pill board with in-built LED
  • USB –Type C cable
  • LED
  • Bread-board

Setting Up STM32CubeIDE

  • Download and install STM32CubeIDE from the STMicroelectronics website.
  • Launch STM32CubeIDE.
  • Create a new STM32 project by selecting File > New > STM32 Project.

Setting Up Project

  • Enter a project name and choose a location to save your project.
  • Select the appropriate toolchain (e.g., Ac6 STM32 MCU GCC) and click "Next."
  • Configure the project settings such as HAL, CMSIS, and middleware. For this tutorial, we will leave the default settings.
  • Click "Finish" to create the project.

Building and Flashing the Firmware

  • Build the project by clicking on the hammer icon in the toolbar.
  • Connect your STM32 Black Pill board to your computer via USB.
  • Flash the firmware by clicking on the lightning bolt icon in the toolbar.

Hardware Setup

  • Connect the LED to the breadboard.
  • Connect one leg of the LED to PC13 pin of the STM32 Black Pill board via a resistor.
  • Connect the other leg of the LED to the ground (GND) pin of the STM32 Black Pill board.

Testing

  • Power on the STM32 Black Pill board.
  • The LED should start blinking at a 1-second interval.
  • The STM32 Black Pill is successfully set up and programmed to blink the external LED using HAL Programming.