Steps to Start With STM Cube IDE and to Blink On-board LED Using HAL Programming by STM32 Black Pill.
Intro: Steps to Start With STM Cube IDE and to Blink On-board LED Using HAL Programming by STM32 Black Pill.
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".