Tutorial/blog to Get Start With STM32 Black Pill and STM Cube IDE to Blink External LED Using HAL Programming.

by ayush4514be23 in Circuits > Electronics

145 Views, 0 Favorites, 0 Comments

Tutorial/blog to Get Start With STM32 Black Pill and STM Cube IDE to Blink External LED Using HAL Programming.

STM32F411CEU6_WeAct_Black_Pill_V3.0-1.jpg

The STM32 Black Pill board is a low-cost, high-performance microcontroller board that is widely used in embedded systems. The board is based on the powerful STM32F103C8T6 microcontroller, which is part of the STM32 family of microcontrollers.


Supplies

  1. STM 32 BOARD
  2. USB TYPE C CABLE

Installing STM32 Cube Ide

Step 1: Installing STM 32 Cube IDE

Download the STM 32 cube IDE in order to perform this task

The file can be downloaded from the following link:

https://github.com/eziya/STM32_HAL_I2C_HD44780/blob/master/Src/liquidcrystal_i2c.h


Making the File

As we head into programming in the CUBE IDE head over to the top left and create a new STM32 project by clicking on "FILE" and then "NEW" then after on new "STM32 Project"

Setting Pin Configuration

Once the file is created select the required STM board and then after set the pin configuration as shown.

(In this task we set the pin 13 as the required pin because in the STM board pin 13 is built in LED)

Clock Configuration

In any synchronous circuit, clock frequency plays an integral part thereby we set the frequency as shown in order to execute the task.

Generating the Code

One of the major advantages of using STM32 IDE is that the code is automatically adjusted according the the clock configuration and then we just have to make a little bit of changes using the required syntax.


Using the Binary File

One of the tricky part is that we will require the binary file i.e. .elf file.

For that, we simply open the .elf file created in the system explorer by Right clicking on the project and clicking on show in system explorer and copying the path on the STM32Cube PROGRAMMER.

Execution

In the last step we just need to connect the STM32 Board with the system and upload the code to get the required results.

Result

inally after completing all the steps we will see that the LED on the STM board will blink with a delay of 1 second