B-G431B-ESC1: Beginner guide + I2C guide

Hi All!

!!! EDIT: Most of these steps are not necessary anymore because the board is added to STM32duino for arduino IDE already, it will remain here for people who want to add the board manually !!!

Past month was a frustrating experience for me. I had lots of inconsistencies when uploading code from Platform.IO. Sometimes codes that worked the other day, would not work anymore the other day. After watching a video from Andreas Spies about debugging, he also said that he had some inconsistencies with Platform.IO. So I switched back to Arduino IDE and almost all inconsistencies seem to be gone (for now?).

Platform.IO has many advantages, but if you have the feeling that 80 percent of your time is going into making code runnable and you do not know anymore how to fix it? Then maybe this guide can be something for you!

B-G431B-ESC with Arduino IDE guide:

  1. Go to Arduino IDE -> Preferences -> Additional Board URL and add the STM32duino library: https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/STM32/package_stm_index.json

  2. Go to Arduino IDE -> Tools -> Boards -> Boards Manager
    and install STM32 Cores

  3. After that open file explorer and go to:
    C:\Users\wittecactus\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\variants

  4. Make a new folder there and name it DISCO_B_G431B_ESC1

  5. Add/replace the following files created by @Owen_Williams : PeripheralPins.c , PinNamesVar.h, ldscript.ld, variant.cpp, variant.h

  6. Go to:
    C:\Users\wittecactus\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0 and and update the boards.txt file

  7. Download driver for Windows (available here) and update the ST-Link adapter to the latest firmware (application to upgrade the firmware).

  8. Download STM32CubeProgrammer

The board is now fully installed and operational. When uploading use the following settings:

Settings

You can now use Arduino IDE and the B-G431B-ESC1 board. It made programming a lot easier for me .

I hope to update the guide soon for full-FOC mode. :slight_smile:

Greetings,

Wittecactus

Usefull links:

#Edit 1: Added missing step, thanks @Valentine!
#Edit 2: Added warning because board has been added in STM32duino 2.0

2 Likes