PlatformIO Community

[MBED] Thread not defined

Hello,

Today I needed to compile an old code (4month old) that used to work/compile in platfomio without issue.

today after a PIO update, the code got mad at me and decided that line was not valid anymore:

use “mbed.h”
Thread envent1,t2;

return “Thread is not defined” error in the editor but the compiling worked.

The platformio.ini is like that:

[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = mbed
build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT 
debug_tool = stlink

I checked [https://docs.platformio.org/en/latest/frameworks/mbed.html](http://pio mbed doc) and couldn’t find anything helpful.

Any help will be appreciated !

Thanks

Try to add the rtos header file explicitly: #include "rtos.h"

It works but I got the same with ‘EventQueue’.
I added Event.h but nothing changed.

Thanks for your support!

Try #include "mbed_events.h"

1 Like