Introduction: Bharat Pi 'Redpill' and STMCUBE IDE Integration for Blynk LED Control

About: Bharat Pi is an IoT prototyping platform for students, innovators, startups and developers. A simplified board with an all in one compute network and storage on a single board to build rapid prototypes, colleg…

The "RedPill" in Bharat Pi is a development board designed for prototyping Internet of Things (IoT) projects. It is based on the STM32G0 series microcontrollers (MCUs) from STMicroelectronics, specifically the STM32G071CBT6TR.

Bharat Pi RedPill STM32 Development Board

The RedPill's key feature is that it provides access to all 48 pins of the MCU. This allows you to connect a wide variety of sensors and other devices to the board for your IoT projects.

Here are some of the other features of the Bharat Pi RedPill:

  • Low-power consumption
  • Compact size
  • Breadboard compatible

The RedPill is a good option for developers who are looking for a versatile and affordable development board for their IoT projects. It is especially well-suited for projects that require low power consumption or a small form factor.

Supplies

Step 1: Create New Project Using STM32CubeMX

  • Run STM32CubeMX tool.
  • Click New Project or Menu -> File -> New Project.

Step 2: Selecting Pin Number/configuration

  • Please search for the commercial part number "STM32G071CBR" and select the appropriate module.
  • Click Start Project to continue.
  • Answer Yes Initialize all peripherals with their default Mode . popup.
  • Please navigate to the pin labelled PC13 and select it as a GPIO output.

The corresponding pins PA13 and PA14 are assigned and configured automatically.

  • When a board is selected, STM32CubeMX allows automatically the pinout setting for the board with the pin assignments for the communication interfaces, LEDs, and other functions.


Step 3: Click on the Project Manager

Switch to the Project Manager tab to configure the project. In the Project tab:

  • Fill the Project Name and Project Location fields
  • Set Toolchain/IDE to STM32CubeIDE.

In the Code Generator tab, ensure that the following options are checked:

  • In STM32Cube Firmware Library Package section: Copy all used libraries into the project folder.
  • In Generated files section: Keep user code when regenerating the C code option, which only applies to the user sections within the STM32CubeMX generated files.


Step 4: Click on the Generate Code

To generate the project in STM32CubeIDE:

  • Click on Generate Code.
  • Click on Open Project to open the project with STM32CubeIDE.


Step 5: In the STMCube IDE

In STM32CubeIDE, from the Project Explorer tab, open the main.c file, in Src folder and add the adequate functions for the LED blinking, using HAL functions with the STM32CubeL4 firmware package.


Step 6: Build the Project

Click on the project from the project explorer, then right click and select Build Project, to compile the project (or click on Build button on the toolbar).

Step 7: Verify the Output in Console Window