Mastering STM32CubeIDE: a Step-by-Step Guide to Activating the On-Board LED of the STM32 Black Pill

6320

Intro: Mastering STM32CubeIDE: a Step-by-Step Guide to Activating the On-Board LED of the STM32 Black Pill

Hi! This is the beginner-friendly technical tutorial on STM32CubeIDE which helps with the controlling over the LED attached to the STM32 Black Pill microcontroller. The guide has undergone rigorous development to create an insightful yet straightforward waking tutorial that can lead professionals to a thorough understanding of the STM32 Black Pill's STM32CubeIDE workflow with regard to both the functionality and the flexibility of the STM32CubeIDE. Guiding you through about the key aspects of embedded programming, you are able to know how to set up the development environment and Black Pill's hardware details, and write an eyes-catching code to control our LED. This starting activity, which is the fundament of working with embedded systems, not only helps with fundamental proficiency but is an essential first step for projects that go beyond. Members can enjoy the power of microcontroller programming knowledge as it covers the issue called precision as well as the issue governed by the principles of professionalism.

STEP 1: Making a New Project File in STM32CubeIDE

GOTO->> File>New>STM32 Project

STEP 2: ADD Configurations for Your STM Board

Search For Component- STM32F401CEY6TR click on "Next"

STEP 3: Configuring Your Board

Configure Your Board As Shown

STEP 4: Configure Your Clock

STEP 5: Open Main.c File

GOTO Project and find main.c file

STEP 6: Goto While(1) in Main() and Add Your Code

I use GPIO Pin 13 you may use other GPIO Pins


HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, 1);

HAL_Delay(500);

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, 0);

HAL_Delay(500);

STEP 7: Debug

Open and Click On Debug(1)

STEP 8: Copy Path of .elf File Generated

Right click on Project and click on show in system explorer and copy the path

STEP 9: Open STMCubeProgrammer and Connect to STM Board Via USB

STEP 10: Click on Open File and Paste the Copied Path

STEP 11: Go to Download Options (Found in Toolbar on the Left)

STEP 12: Change Download Options and Click on "Start Automatic Mode"

STEP 13: The Final Step

The LED starts blinking