Having Issues Building on mbed framework

I’m trying to run a super simple program, main.c seen below, just to make sure my board is functioning correctly.

#include <mbed.h>
DigitalOut myled(LED1);

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

When I hit build, I am getting the error seen below:

Compiling .pioenvs\nucleo_f401re\lib7f9\filesystem\Dir.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Compiling .pioenvs\nucleo_f401re\lib7f9\filesystem\File.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
Compiling .pioenvs\nucleo_f401re\lib7f9\filesystem\FileSystem.o
arm-none-eabi-g++: error: CreateProcess: No such file or directory
*** [.pioenvs\nucleo_f401re\lib7f9\filesystem\Dir.o] Error 1
Compiling .pioenvs\nucleo_f401re\lib7f9\filesystem\bd\ChainingBlockDevice.o*** [.pioenvs\nucleo_f401re\lib7f9\filesystem\File.o] Error 1

*** [.pioenvs\nucleo_f401re\lib7f9\filesystem\FileSystem.o] Error 1
arm-none-eabi-g++: error: CreateProcess: No such file or directory
*** [.pioenvs\nucleo_f401re\lib7f9\filesystem\bd\ChainingBlockDevice.o] Error 1

I am using a Nucleo-F401RE board. This only happens in the mbed framework. When I use the stm32cube framework, a similar program compiles fine.

Please rename file to main.cpp

This did not fix the error, sorry.

Did the error change or stay the same? What is the exact platformio.ini you’re using?

One brace to much at the last line

My platformio.ini is seen below:
[env:nucleo_f401re]
platform = ststm32
board = nucleo_f401re
framework = mbed

The error stays the same after renaming to .cpp

No, it works for me when I remove the last brace } from your program.

#include <mbed.h>
DigitalOut myled(LED1);

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

I removed it, and it still does not work. I even tried just copy-pasting your code in. I should note that during build, it takes a long time to get through the “Scanning dependencies…” phase.

Well since we have the exact same platformio.ini and the eact same code in the main.cpp file within the src/ folder, we must have a different PlatformIO setup…

Try the following:

If you have the latest PIO veresion and are still unable to compile and upload the basic blink programs, remove PIO completely and reinstall it.

I reinstalled and the error is still present. It only happens when I am using the mbed framework- when I use stm32cube it works fine.

Please do pio run -t clean, pio settings set force_verbose Yes and post the output pio run on https://ghostbin.com/ when run wiithin in your project. Should look like https://ghostbin.com/paste/zpkx5

https://ghostbin.com/paste/wwykj Here is the result of that.

o_O Your dependency finder finds libraries which are definetely not in the project and should not be there. They are not found by my LDF.

Try adding this in your platformio.ini:

lib_ignore = mbed-dev mbed-netsocket mbed-rtos mbed-filesystem

Did you install any of these? Seems like you didn’t properly purge your previous PIO installation during reinstall. After [sudo] pip uninstall platformio remove your .platformio folder in your home directory (C:\Users\taylorb\.platformio\)

This worked! Thank you for your help!