Failing to build for F446RE

When i write an App for my stm32 Nucleo F446RE and try to upload it it fails in the build state.
Every time I try to compile it or upload it or try “platformio run” in the integrated Powershell it shows this log:

Processing nucleo_f446re (platform: ststm32; board: nucleo_f446re; framework: mbed)
Verbose mode can be enabled via -v, --verbose option
PLATFORM: ST STM32 > ST Nucleo F446RE
SYSTEM: STM32F446RET6 180MHz 128KB RAM (512KB Flash)
DEBUG: CURRENT(stlink) ON-BOARD(stlink) EXTERNAL(blackmagic, jlink)
Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 27 compatible libraries
Scanning dependencies…
Dependency Graph
|--
|--
| |--
Compiling .pioenvs\nucleo_f446re\src\main.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Compiling .pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\events\queue\main.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Compiling .pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\integration\basic\main.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Compiling .pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\mbed_drivers\c_strings\main.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Compiling .pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\mbed_drivers\dev_null\main.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
*** [.pioenvs\nucleo_f446re\src\main.o] Error 1
*** [.pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\events\queue\main.o] Error 1Compiling .pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\mbed_drivers\echo\main.o

*** [.pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\integration\basic\main.o] Error 1
*** [.pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\mbed_drivers\c_strings\main.o] Error 1
*** [.pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\mbed_drivers\dev_null\main.o] Error 1
arm-none-eabi-g++: error: CreateProcess: No such file or directory
*** [.pioenvs\nucleo_f446re\lib778\mbed-os_ID2499\TESTS\mbed_drivers\echo\main.o] Error 1
============================================================================================== [ERROR] Took 157.85 seconds ==============================================================================================

I googled the Errors and found nothing…

  • Windows 10

  • VS Code 1.28.1 (system wide)

  • pip 18.0 from c:\users\user.platformio\penv\lib\site-packages\pip (python 2.7)

If you have any Ideas what is causing this problem would be nice if you could help me.
Thank’s in advance
Herobone

Post your full platformio.ini and application code.

Code:
#include “mbed.h”
DigitalOut myled(LED1);

int main() {
    while(1) {
        myled = 1;
        wait(1);
        myled = 0;
        wait(1);
    }
}

platformio.ini
[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = mbed

Platformio Version:

  • PlatformIO, version 3.6.1a5

Can you try adding lib_ignore = mbed-os to your platformio.ini?

Thank’s that worked! But if I try to use a Thread it fails because the dependency is unknown

src\main.cpp: At global scope:
src\main.cpp:9:1: error: ‘Thread’ does not name a type; did you mean ‘read’?
Thread statusThread;
^~~~~~

Code:

#include “mbed.h”
#include “PinDetect.h”
//#include “Thread.h”

PinDetect pin ( PC_13 );
int watplzfor = 1000;
int stage = 1;

Thread statusThread;
void blink() {
for(DigitalOut led(LED1);; Thread::wait(watplzfor)) {
led = !led;
}
}

void keyPressed( void ) {
if (stage == 1) {
watplzfor = 50;
stage = 2;
} else if (stage == 2) {
watplzfor = 100;
stage = 3;
} else if (stage == 3) {
watplzfor = 200;
stage = 4;
} else if (stage == 4) {
watplzfor = 400;
stage = 5;
} else if (stage == 5) {
watplzfor = 800;
stage = 1;
}
}

int main() {

statusThread.start(callback(blink));

pin.mode( PullDown );
pin.attach_asserted( &keyPressed );
pin.setSamplesTillAssert( 10 );
pin.setSamplesTillHeld( 100 );
pin.setSampleFrequency(1000);

}

platformio.ini

[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = mbed
lib_ignore = mbed-os

Threading needs the RTOS activated. Add the line build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT to your platformio.ini.

Refer to the documentation (Mbed — PlatformIO latest documentation).

Thank’s!
It works somehow…

Same code line added to platformio.ini but now it shows this error log

Error Log - Pastebin.com (moved to pastebin because it’s quite large)

Thnak’s in advance

You have two main C files. Remove mainOld.c.

1 Like

Thank’s! All problems are fixed now!

Herobone