B-G431B-ESC1: Beginner guide + I2C guide

And some of the components, like the FETs, are not normally orderable… :frowning: but its still a nice reference design.
I think for SimpleFOC experimentation it is not the best choice because of the lack of easily usable IO. Its not easy to interface with sensors. etc…

Correct. I don’t want to turn it into bashing the board, this is simply the wrong tool for my job. I can repurpose the PWM, and TX/RX and if I run sensor-less, the three hall sensors. That’s butchering. I wanted to add custom logic with external sensors. Plus as you mentioned, if you add up the BOM for the board, it greatly exceeds the $18 I paid, so if you carefully read the licensing this is an evaluation carrot before someone orders a 10,000 batch at five times the price. At which point we enter the realm of GPL’ed VESC 6 MKV. Which itself has issues but that’s tangential. Very educational though.

BTW has anyone tried running SimpleFOC on the dozens of VESC compatible Chinese boards floating around on Amazon? I ordered one to evaluate, but just curious.

Thanks for the insights by the way. Very interesting to read it more from a work - instead of hobby perspective!

I know that @Owen_Williams got SimpleFOC running on VESC. Maybe the following thread is interesting for you: VESC Support - 1kW of Power! - SimpleFOC Community

I will look into this, thank you. Good pointer.

I received my B-G431B boards and gave it a first try, here my findings:

  • Setting it up on PlatformIO was working nicely with the instructions by Wittecactus, of course it will get easier once stm32duino 2.0 makes it into PlatformIO, until then the instructions are great!
  • I could not program the board through PlatformIO with stlink directly, I had to manually install OpenOCD 0.11.0 and make a custom .cfg file for the G431. I can share instructions and the config file if there is any interest, just let me know
  • My sensors have not arrived yet, I connected a 2450kV, 6 polepair motor and tested velocity_openloop on a 3s LiPo. I can turn the motor and command it through commander on the USB port on the daughterboard. But the motor and FET’s get super hot very quick and I am affraid to burn the board. Any advice what I could do to avoid it (without sensor for the moment). I share my current code below.

Thank you!

#include <Arduino.h>
#include "SimpleFOC.h"

//Motor and driver instance
BLDCMotor motor = BLDCMotor(6); 
BLDCDriver6PWM driver = BLDCDriver6PWM(PHASE_UH, PHASE_UL, PHASE_VH, PHASE_VL, PHASE_WH, PHASE_WL);`

// Commander instance
Commander command = Commander(Serial);

void doTarget(char* cmd) { command.scalar(&motor.target, cmd); }

void setup() {

    pinMode(LED_BUILTIN, OUTPUT);
    Serial.begin(115200);

    //Driver initialization
    driver.voltage_power_supply = 12;
    driver.init();

    //Limiting motor movements
    //motor.phase_resistance = 3.52 // [Ohm]
    //motor.current_limit = 2;   // [Amps] - if phase resistance defined
    motor.voltage_limit = 1;   // [V] - if phase resistance not defined
    //motor.velocity_limit = 5; // [rad/s] cca 50rpm
    //motor.voltage_limit = 1;

    //Control loop setup
    motor.controller = MotionControlType::velocity_openloop;

    //Init motor
    motor.linkDriver(&driver);
    motor.useMonitoring(Serial);
    motor.init();

    // add target command T
    command.add('T', doTarget, "target");
    command.add('t', doTarget, "target");

    Serial.println("Motor ready!");
    Serial.println("Set target velocity [rad/s]");

    delay(1000);
}

void loop() {

    //Motor loop, as quick as possible
    motor.move();

    //User communication
    command.run();

    //Monitoring
    //motor.monitor();
}

I suspect your phase resistance is a lot lower than 3.52 ohms. Probably more like 0.1 ohms.

I suspect it’ll run a lot cooler at 20 rad/s as bemf will reduce current. Have you tried a voltage_limit of 0.5 or lower?

You’ll notice it’ll be a lot cooler if you can get closed loop working.

I had a look at the gerber files from ST. Im not surprised you had to put liquid cooling on it @Valentine.

It is a pity, since those mosfets can handle much more.

quote: * Output peak motor current (maximum peak current tested with propeller to have an air-forced cooling): 40 A.

I guess if one design with propeller cooling in mind, then thermal management is a different story.

Indeed Owen,

going down to 0.5 is working ok in openloop with this motor (FET’s just barely warm), but it brings me to another question: I think I understand that velocity_openloop is just calculating the desired angle over time, and puts the voltage (voltage_limit) to the phases according the desired angle (same as angle_openloop but with changing angle). Is it possible with this library, to have something like a voltage_openloop control, where we could target the motor to a certain voltage (or a certain pwm duty cycle), and the control is commutating the phases as quick as the motor “naturally” wants to go? It would require detection of bemf zerocrossing tough, as kind of a sensor.

I love the library honestly, but then people could start using it in sensorless projects as well (there may be plenty out there). I was reading the docs and think it is not in yet, maybe it is not the goal of this lib even, but it would be very nice.

btw: any quick tip how to make the motor sound at a cerain frequency?

Regards
Christian

Sensorless is possible but typically requires shunt resistors and opamps. This is definitely an aim of this library.

Do you mean ‘play a tone’? I created a video about 6 months ago where i got a few motors playing tunes. It’s pretty simple, you just ask the motor to move between two angles at the frequency you want. This makes a square wave sound. You can play with sine and triangular waves too.

On simplefoc 2.0 i guess you’d mostly be interacting with bldc driver and not use ‘control modes’

@Chris,

Check out my post about cooling above. Had the exact same issue. Dunk it in Fluorinert or Novec ($$$$).

The control theory experts could say more on this, but I think https://docs.simplefoc.com/voltage_torque_control
voltage mode is what you want for that.
But what you really want is closed loop, which will get you the same speed at much lower power consumption.

So do we need hall pullups for this board?

@Owen_Williams @Wittecactus
First of all, thank you very much to have this topic posted here for sharing the information.

For the past three days I am almost scratched my head off to just to turn the BLDC motor with this B-G431B-ESC1 to work. I have being using VSC+platformIO for a while and I am not really a newbie. But I just couldn’t get it to work properly. I can get the 5048A encoder PWM output and the serial comms is also working, but I just could make the motor to turn.

I thought this driver should work out of box directly with what I am trying to test. When I try to debug this code. I found my driver has been assigned to a set of totally different pins instead these.

// #define PHASE_UH PA8
// #define PHASE_UL PC13
// #define PHASE_VH PA9
// #define PHASE_VL PA12
// #define PHASE_WH PA10
// #define PHASE_WL PB15

Please kindly let me know what part I did wrong. It driving me crazy :frowning:

I am using VSC with Ubuntu 18, Here is what in my platormio.ini

[env:disco_b_g431b_esc1]
platform = ststm32
board = disco_b_g431b_esc1

framework = arduino
monitor_speed = 115200
lib_deps = https://github.com/simplefoc/Arduino-FOC.git

My main.cpp is like this:

#include <Arduino.h>
#include <SimpleFOC.h>

const int motorPolePairs = 14;

// Motor and driver instance
BLDCMotor motor = BLDCMotor(motorPolePairs);
BLDCDriver6PWM driver =
    BLDCDriver6PWM(A_PHASE_UH, A_PHASE_UL, A_PHASE_VH, A_PHASE_VL, A_PHASE_WH, A_PHASE_WL);
MagneticSensorPWM sensor = MagneticSensorPWM(PB6, 4, 904);

void doPWM() { sensor.handlePWM(); }

float targetSpeed = 20;
Commander command = Commander(Serial);

void doTarget(char *cmd) { command.scalar(&targetSpeed, cmd); }

void setup() {

  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  sensor.init();
  sensor.enableInterrupt(doPWM);
  // sensor.enableInterrupts(doA, doB, doC);
  Serial.println("Sensor ready");
  delay(1000);

  // Init motor
  motor.linkSensor(&sensor);
  motor.linkDriver(&driver);
  motor.useMonitoring(Serial);
  motor.init();

  driver.voltage_power_supply = 12;
  driver.init();

  motor.phase_resistance = 0.1; // [Ohm]
  motor.current_limit = 2;      // [Amps] - if phase resistance defined
                           //    motor.voltage_limit = 0.5; // [V] - if phase
                           //    resistance not defined
  motor.velocity_limit = 50; // [rad/s] 5 rad/s cca 50rpm

  // Control loop setup
  motor.controller = MotionControlType::angle;

  // controller configuration
  // default parameters in defaults.h

  // controller configuration based on the control type
  // velocity PID controller parameters
  // default P=0.5 I = 10 D =0
  motor.PID_velocity.P = 0.2;
  motor.PID_velocity.I = 20;
  motor.PID_velocity.D = 0.001;
  // jerk control using voltage voltage ramp
  // default value is 300 volts per sec  ~ 0.3V per millisecond
  motor.PID_velocity.output_ramp = 1000;

  // velocity low pass filtering
  // default 5ms - try different values to see what is the best.
  // the lower the less filtered
  motor.LPF_velocity.Tf = 0.01;

  // angle P controller -  default P=20
  motor.P_angle.P = 20;

  //  maximal velocity of the position control
  // default 20
  motor.velocity_limit = 4;
  // default voltage_power_supply
  motor.voltage_limit = 10;

  // align encoder and start FOC
  //  motor.initFOC();
  motor.initFOC(2.15, Direction::CW);

  // add target command T
  command.add('T', doTarget, "target");
  command.add('t', doTarget, "target");

  Serial.println("Motor ready!");
  Serial.println("Set target velocity [rad/s]");

  delay(1000);
}

// angle set point variable
float target_angle = 1;
// timestamp for changing direction
long timestamp_us = _micros();

void loop() {
  // Motor loop, as quick as possible
  motor.move(targetSpeed);

  // User communication
  command.run();

  // each one second
  if (_micros() - timestamp_us > 1e6) {
    timestamp_us = _micros();
    // inverse angle
    target_angle = -target_angle;
    Serial.print(sensor.getAngle());
    Serial.print("\t");
    Serial.print(target_angle);
    Serial.print("\t");
    Serial.println(sensor.getVelocity());
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
    if (target_angle > 0) {
      // digitalWrite(PHASE_UL, LOW);
      // analogWrite(PHASE_UH, 10);
      //driver.setPwm(3, 6, 5);
    } else {
      // digitalWrite(PHASE_UH, LOW);
      // analogWrite(PHASE_UL, 10);
      //driver.setPwm(6,3, 5);
    }
  }

  // main FOC algorithm function
  motor.loopFOC();

  // Motion control function
  motor.move(target_angle);

  // Monitoring
  // motor.monitor();
}

You’re calling motor.move() twice in the main, although I’m sure that isn’t the problem.

Is the board pulling any sort of power over the 12v bus? Does the motor move or hold when powered at all?

I’ve had some issues with recent releases. Specifically https://github.com/simplefoc/Arduino-FOC/issues/99 prevents the pwm driver from initializing correctly. Could you remove all weakly declared implementations in src/drivers/hardware_specific/generic_mcu.cpp to see if this changes anything?

Hey,

You could try adding

lib_archive = false

to your platformio.ini file… this solved the issue with the weak bindings in STM32 for me.

Hi Chris - I’m having trouble programming the B-G431B board through platformio and your comment about the custom .cfg for OpenOCD caught my eye. Do you mind sharing instructions/the config file?

Thanks!
Brian

Hello everybody,
first of all thank you for the great library and the work for this outstanding library.
Unfortunately trying to get the B-G431B running with platformio board drives me totally nuts…:

I try to run the simple code:

#include <Arduino.h>

void setup() {

// put your setup code here, to run once:

}

void loop() {

// put your main code here, to run repeatedly:

}

and this is the result in the terminal:

Executing task in folder 20211029_ESC1_G431B_Test: C:\Users\dika.platformio\penv\Scripts\platformio.exe run <

Processing disco_b_g431b_esc1 (platform: ststm32; board: disco_b_g431b_esc1; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: ST STM32 (14.2.0) > ST B-G431B-ESC1 Discovery
HARDWARE: STM32G431CBU6 170MHz, 32KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

  • framework-arduinoststm32 4.20000.210603 (2.0.0)
  • framework-cmsis 2.50700.210515 (5.7.0)
  • toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 11 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- 1.0
    |-- 1.0
    |-- 2.2.0
    | |-- 1.0
    | |-- 1.0
    Building in release mode
    Compiling .pio\build\disco_b_g431b_esc1\src\main.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib6e2\SPI\SPI.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib68c\Wire\Wire.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib544\Simple FOC\BLDCMotor.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib544\Simple FOC\StepperMotor.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib544\Simple FOC\common\base_classes\CurrentSense.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib544\Simple FOC\common\base_classes\FOCMotor.cpp.o
    Compiling .pio\build\disco_b_g431b_esc1\lib544\Simple FOC\common\base_classes\Sensor.cpp.o
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\libraries\SPI\src\SPI.h:15,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\libraries\SPI\src\SPI.cpp:12:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from src\main.cpp:1:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\libraries\Wire\src\Wire.h:26,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\libraries\Wire\src\wire.cpp:28:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\BLDCMotor.h:4,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\BLDCMotor.cpp:1:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes…/foc_utils.h:4,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes\Sensor.cpp:2:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes\BLDCDriver.h:4,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes\CurrentSense.h:4,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes\CurrentSense.cpp:1:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\StepperMotor.h:9,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\StepperMotor.cpp:1:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    In file included from C:\users\dika.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:29,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/USBSerial.h:24,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/WSerial.h:6,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:47,
    from C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes\FOCMotor.h:4,
    from .pio\libdeps\disco_b_g431b_esc1\Simple FOC\src\common\base_classes\FOCMotor.cpp:1:
    C:\users\dika.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb/usbd_conf.h:36:2: error: #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    36 | #error “This board does not support USB High Speed! Select ‘Full Speed’ in the ‘Tools->USB interface’ menu”
    | ^~~~~
    *** [.pio\build\disco_b_g431b_esc1\lib6e2\SPI\SPI.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\src\main.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\lib68c\Wire\Wire.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\lib544\Simple FOC\BLDCMotor.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\lib544\Simple FOC\common\base_classes\Sensor.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\lib544\Simple FOC\StepperMotor.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\lib544\Simple FOC\common\base_classes\CurrentSense.cpp.o] Error 1
    *** [.pio\build\disco_b_g431b_esc1\lib544\Simple FOC\common\base_classes\FOCMotor.cpp.o] Error 1
    ====================================================================================================== [FAILED] Took 4.90 seconds ======================================================================================================
    Der Terminalprozess “C:\Users\dika.platformio\penv\Scripts\platformio.exe ‘run’” wurde mit folgendem Exitcode beendet: 1.

Das Terminal wird von Aufgaben wiederverwendet, drücken Sie zum Schließen eine beliebige Taste.

+++++++++++++++
unfortunately I’m not a platformio expert and have no clue what I have to modifiy. Any help is kindly appreciated! Best regards, Dirk

Hey Dirk,

Looks like a misconfiguration regarding the USB setup… I think the B-G431B doesn’t have any USB port.

Would you mind sharing your platformio.ini file?

Hi runger,
thank you very much for your fast response. Sure I like to share my platformio.ini:

; PlatformIO Project Configuration File

;

; Build options: build flags, source filter

; Upload options: custom upload port, speed and extra flags

; Library options: dependencies, extra library storages

; Advanced options: extra scripting

;

[env:disco_b_g431b_esc1]

platform = ststm32

board = disco_b_g431b_esc1

framework = arduino

build_flags =

-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC

-D PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF

-D PIO_FRAMEWORK_ARDUINO_USB_HIGHSPEED_FULLMODE

; lib_deps =

; SPI

; Wire

; askuric/Simple FOC@^2.2

Here also an image with the screenshot from my ‘Geräte-Manager’, mybe another hint for you, what might be wrong with my setup ?

Bild_2021-10-30_065529

Thank you very much in advance,
best regards, Dirk

Lieber Dirk,

Unfortunately I’m on holidays, and can’t try it out right now, but I think the problem might be these build flags:

If I’m not wrong the ESC discovery board has USB only for the STLink daughterboard, but not for the main MCU. So removing these options might help, but it’s just a guess.

Beste Grüße aus Kap Verde,

Richard