Introduction: Steps to Start With STM Cube IDE and to Blink On-board LED Using HAL Programming by STM32 Black Pill.

Technical tutorial on harnessing the capabilities of STM32CubeIDE to control the on-board LED of the STM32 Black Pill microcontroller. This guide is meticulously crafted to provide professionals with a clear and concise walkthrough for engaging the LED, demonstrating the STM32 Black Pill's functionalities and the versatility of STM32CubeIDE.


Supplies

To commence with the embedded programming, the following equipment and software installations are essential:

1. A laptop or desktop computer equipped with STM32CubeIDE and STM32CubeProgrammer.

2. An STM32 Black Pill development board.

3. A compatible USB cable for connection and programming purposes.

Please ensure that these prerequisites are met prior to beginning the tutorial to facilitate a smooth and efficient programming experience.

Attachments

Step 1: Install STM-32 CUBE IDE

As per the Laptop/PC specifications install the software.

Step 2: Install STM-32 CUBE Programmer

As per the Laptop/PC specifications install the software.

Step 3: Create a New Project in Stm-32 CubeIDE

Select "File">>"New"

Click on STM32 Project under the dialog box open.

Step 4: Select Stm-32 Part

Fill "STM32F401CE" in the blank space of commercial part number.

Choose the part and click on "Next"

Step 5: Setup STM32 Project

Click on "Finish".

As a result, New project with "LED HAL PROGRAM" title would be formed.

Step 6: Setup SYS Mode & Configuration

Select "Serial Wire" in Debug dialog box.

Step 7: Setup RCC Mode & Configuration

Select "Crystal/Ceramic Resonator" in High Speed Clock dialog box and disable the Low Speed Clock.

Step 8: Open Source Code File

In the "Project Explorer" select the project name and under that choose "SRC" under "core".

Click on "main.c file" to generate code file and update the code.

Step 9: Update the Code of HAL Program

Fill the following code under the "While" statement:

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, 1);

HAL_Delay(500);

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, 0);

HAL_Delay(500);

Step 10: Copy Path of Project File Generated

Click on "System Explorer" to copy path of file.

Step 11: Open STM32 Cube Programmer

Beside the "Device Memory" and click on "Open File".

Fill the copied file path name.

Step 12: Uploading Program in STM32

Connect the STM Board Via USB.

After the connection click on "Download" and fill the blank space with file path. Select the checkboxes and click on "Start Automatic Mode".


Step 13: LED Starts Blinking