maxgerhardt / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
Apache License 2.0
94 stars 46 forks source link

FreeRTOS support #43

Open mchacher opened 8 months ago

mchacher commented 8 months ago

Hi, while browsing the web I have been able to compile a project (not tested yet) with FreeRTOS. I would like to leverage SMP / dual core capability of the RP2040.

Thanks a lot.

; with FreeRTOS support
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi
; platform = raspberrypi
board = pico
framework = arduino
board_build.core = earlephilhower

vs.

; without FreeRTOS support
[env:pico]
platform = raspberrypi
board = pico
framework = arduino
mchacher commented 8 months ago

Adding to my previous post, I have a compilation issue on a large project that I don't understand.

<command-line>: error: expected identifier before numeric constant
/Users/mchacher/.platformio/packages/framework-arduinopico/cores/rp2040/RP2040Support.h:155:7: note: in expansion of macro 'RP2040'
  155 | class RP2040;

I am working with platformio / vscode on MacOS. Looking at the file RP2040Support.h it looks like this file is old, and not in sync https://github.com/earlephilhower/arduino-pico.

I wonder whether my setup is correct.

Thanks for your support.

maxgerhardt commented 8 months ago

FreeRTOS should be fully working in the Arduino-Pico core per https://arduino-pico.readthedocs.io/en/latest/freertos.html with the exact first platformio.ini in your original post. If not, please post the exact project files.

Make sure you have a reasonable fresh copy of everything by doing

rm -rf /Users/mchacher/.platformio/packages/framework-arduinopico
rm -rf /Users/mchacher/.platformio/platforms/raspberrypi*

On the other Arduino core (https://github.com/arduino/ArduinoCore-mbed) as supported by the standard platform, there is the RTX5 RTOS. Not FreeRTOS, but equivalently capable of starting threads. Whether that's possible on the second core, idk, since I don't work that much with that core, so you'll have to ask https://github.com/arduino/ArduinoCore-mbed/issues.

AgainPsychoX commented 3 months ago

Is there maybe good write up about differences between Arduino-Pico (aka earlephilhower version) and PlatformIO supported one, the ArduinoCore-mbed? Or anything you suggest I should read/look up?