Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great job! Do you have a plan to adjust it for Platformio? #66

Closed
vladkozlov69 opened this issue Mar 31, 2021 · 125 comments
Closed

Great job! Do you have a plan to adjust it for Platformio? #66

vladkozlov69 opened this issue Mar 31, 2021 · 125 comments
Labels
help wanted Extra attention is needed platformio Platform.IO support

Comments

@vladkozlov69
Copy link

Hello Earle,

your codebase looks really great. Do you have a plan to adjust it for Platformio? i.e. adding board definition and platformio-specific packages/platforms?

@earlephilhower
Copy link
Owner

@vladkozlov69 I don’t use Platform IO but I do know of it from my other Arduino core.

It would be great if you or another user sent a PR for this. I know it’s not a big project, but doubt I’ll have time soon on my own to look at it.

@earlephilhower earlephilhower added the help wanted Extra attention is needed label Mar 31, 2021
@jhmaloney
Copy link

Has anyone else taken this on? If not, I can give it a shot.

@jhmaloney
Copy link

Unfortunately, after consulting with Valerii Koval from PlatformIO, I've concluded that this project is more than I care to take on, especially since I'd need to learn a lot about creating build scripts. I also found that PlatformIO does not want to support two Arduino Pico frameworks, so PlatformIO support for this package would be an ongoing community effort.

That said, PlatformIO does have a way to pull unsupported packages from GIT repositories, so adding PlatformIO support could still be useful. This community project has support for things that are not (yet?) in the official Arduino Pico framework, including the LittleFS and Servo libraries, which my project (MicroBlocks) depends on. My sincere thanks to Earle and others who have contributed to this package!

Here are the steps Valerii outlined, in case someone else wants to give this a go.

This integration might need a substantial amount of effort. Here are the steps I think will be needed.

First, the community package uses a custom toolchain with a very recent version of the newlib library, so it is not compatible with the toolchain used in the official Arduino core. That means that you will need to repack and upload to the PlatformIO registry all the necessary toolchains. (I assume there are also other auxiliary tools that should be uploaded (e.g. elf to uf2 converter, some python scripts etc.))

Second -- and most important -- is the build script. The Arduino IDE build logic must be adapted the PlatformIO build system API. This isn't going to be an easy task. All that logic will go to a new python file in this folder https://github.com/platformio/platform-raspberrypi/tree/develop/builder/frameworks/arduino . You can take a look at similar scripts in the STM32 platform, for example https://github.com/platformio/platform-ststm32/blob/develop/builder/frameworks/arduino/mxchip.py

Finally, you will need to implement some logic so users can switch between cores. Usually, we do this using the "build.core" option. Here is how it described in our docs for STM32:
https://docs.platformio.org/en/latest/platforms/ststm32.html#configuration

And here is the code responsible for switching cores (look how we change packages, their versions, build scripts, etc)
https://github.com/platformio/platform-ststm32/blob/develop/platform.py#L41

@earlephilhower
Copy link
Owner

@jhmaloney it may not be as bad as it sounds, but it's your call.

I based this core off of my work w/the ESP8266 Arduino core (https://github.com/esp8266/Arduino) and I have a feeling the actual build script there could be used here with minor mods. The toolchain packaging AFAIK isn't much, either, as I'm using the same GCC and newlib there and it didn't seem to be a big deal to the PIO-esp8266 maintainer.

@maxgerhardt
Copy link
Contributor

I've opened the matching issue in platformio/platform-raspberrypi#13. I can actually also help with the needed builder script and PR into this repo.. they are not too difficult to write, mostly all the same with some core-specific configuration options added mostly.

@earlephilhower
Copy link
Owner

Cool, @maxgerhardt . If there are any changes, let me know! I've followed the ESP8266 tools and core packaging setup, which already supports it, so we should be more than half way there.

I'd do it myself, but I've never been able to get PIO working for me, except to build Marlin. There, it "just worked." But using a git repo instead of a d/l'd package, I could never get it to work...

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jul 14, 2021

FYI, today I've forked the core and added a builder script, along with the needed platform modifications to use your toolchain-pico and being able to do a core-selection in the platformio.ini in https://github.com/maxgerhardt/platform-raspberrypi. A test firmware repo is at https://github.com/maxgerhardt/pio-pico-core-earlephilhower-test.

The current state is that I can successfully build the firmware (with the linker script also generated by simplesub.py) and it runs :). Tested with a blinky and USB serial sketch.

There's also some ToDos left for being able to select the "partition table" / flash size options, and adding support for uploading files as e.g. supported in ESP8266 & ESP32. But overall, this won't be a big deal, most of the work is already done.

After that's done I'll PR into this repo and do the PRs for the platform-raspberrypi and the documentation, then we'll have it in mainstream PlatformIO.

@earlephilhower
Copy link
Owner

Great news! If you're feeling lucky, IIRC platformIO supports debugging and we distribute both GDB and OpenOCD in the tools tarball. But that's definitely a "nice to have" not a "need to have!" :)

Once your PR is in, I think it should be simple enough to add any platformIO specific packaging stages to the automated release process. So when I push a tag to generate a release, the CI system will generate whatever else is needed for PIO, too.

@maxgerhardt
Copy link
Contributor

IIRC platformIO supports debugging and we distribute both GDB and OpenOCD in the tools tarball. But that's definitely a "nice to have" not a "need to have!" :)

Debugging support is handled on the platform level (platform-raspberrypi), independent of the framework, (Would also be cumbersome to re-add the same debugging logic / commands for every framework.) There, (here, here) it already has support for debugging via JLink (JLink.exe) and OpenOCD (with picotool, cmsis-dap, raspberrypi-swd or any other debug adapter). So that's actually automatically already there and PlatformIO already has the packages for it (with GDB being sourced from toolchain-pico then). I'll of course verify this with my own Pico :)

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jul 14, 2021

I am moving towards the final steps of the builder script refinements and platform code modifications.

It is now working that a user can specify the sketch and filesystem size in the platformio.ini, via a e.g. board_build.filesystem_size = 1M parameter. From that, the linker script input variables are calculated just like in this core.

Also I've added the code in the platform to create LittleFS images with the config that this core uses and the ability to flash those images via picotool to the device via the usual "Build Filesystem" and "Upload Filesystem" project tasks. It is all working pretty nicely :)

grafik

The final steps are making it work via OpenOCD / JLink.exe upload methods and verifying that debugging works.

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Aug 8, 2021

I'm making progress regarding adding debugging support using Picoprobe, but it's not 100% working yet.

grafik

The stacktrace doesn't reach back to the actual user function (in the sketch I do Serial.printf() and the furthest in the stacktrace is SerialUART::write() and doesn't halt in e.g. setup() or loop(). Interestingly it sees both Cortex-M0+ cores as hardware threads and I can inspect them individually, with only Core 0 running a firmware for now.

PR #250 has been opened in the meantime for the builder script for this core.

EDIT: Hm interesting, changing the linker script to comment out that stuff is placed in RAM.. has caused all functions to be placed in RAM.. and with that debugging is working better.

grafik

@JonnyHaystack
Copy link

To me, #501 seems like the biggest issue with using this on PlatformIO right now. Adafruit TinyUSB isn't working at all, meaning USB functionality is severely limited. I couldn't figure out a way of using Pico SDK tinyusb directly either.

@Laserjones
Copy link

Laserjones commented May 8, 2022

Sorry if this is not the right place for my issue (please let me know in that case).

I have tried to use the core in PlatformIO, but I get an error in the line #include Arduino.h that says:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\micro\Documents\PlatformIO\Projects\Amigo\src\main.cpp).C/C++(1696)
cannot open source file "stdint.h" (dependency of "Arduino.h")C/C++(1696)

Here's my platformio.ini:

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.f_cpu = 133000000L
board_build.filesystem_size = 0.5m
platform_packages = 
	maxgerhardt/framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
	maxgerhardt/toolchain-pico@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.arm-none-eabi-ed6d983.220212.zip

When trying to compile, the terminal says that various commands all named arm-none-eabi-... (seems to be the compiler itself?) cannot be found.

The entire folder .pio\build\pico\FrameworkArduino is empty, as well as the other folders under pico. I assume this is not how it's supposed to be ...

Can anyone help with this?

@maxgerhardt
Copy link
Contributor

Which operating system are you using? The platformio.ini has a Windows-specific download link, if you have a different one you need to adapt it.

You can also try and force a redownload of the components by removing the <home folder>/.platformio/.cache and <home folder>/.platformio/packages/toolchain-pico folders and building the project again.

@jhmaloney
Copy link

Here's what I use on Mac OS:

platform_packages =
maxgerhardt/framework-arduinopico@https://github.com/maxgerhardt/arduino-pico.git
maxgerhardt/toolchain-pico@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.2-a/x86_64-apple-darwin14.arm-none-eabi-9d55fd1.220202.tar.gz

Hope that helps!

@Laserjones
Copy link

Sorry, I should have mentioned that I'm using Windows 10, 64-bit. I used the current link provided on https://github.com/earlephilhower/pico-quick-toolchain/releases.

You can also try and force a redownload of the components by removing the /.platformio/.cache and /.platformio/packages/toolchain-pico folders and building the project again.

I emptied the two folders. When trying to rebuild, they were filled again as expected. But the error remains, and the .pio\build\pico\FrameworkArduino folder is still empty. I then even created a new project from scratch with the above platformio.ini and the default barebone main.cpp file, but the problem still persists.

So it looks like the toolchain is not copied into the project for some reason ...?

@Laserjones
Copy link

Here's what I use on Mac OS:

platform_packages = maxgerhardt/framework-arduinopico@https://github.com/maxgerhardt/arduino-pico.git

That's interesting, this is not the link stated by Earle in his documentation, which is https://github.com/earlephilhower/arduino-pico.git (is there a specific reason for this change?). Anyway, I now tried using your link instead, but it did not solve the problem either ...

@Laserjones
Copy link

Laserjones commented May 8, 2022

The IntelliSense C/C++ Configuration of PlatformIO says that there is no valid compiler path found. I can specify a path manually, but shouldn't this be handled automatically?

Doing a Windows search, I found the following path and entered it in the configuration: C:\Users\ (...) .platformio\packages\[email protected]\bin\arm-none-eabi-g++.exe

This removed the includePath error in the line #include Arduino.h, but when trying to build, I still get messages that "arm-none-eabi-gcc" and "arm-none-eabi-g++" cannot be found.

@Laserjones Laserjones mentioned this issue May 8, 2022
@jhmaloney
Copy link

That's interesting, this is not the link stated by Earle in his documentation, which is https://github.com/earlephilhower/arduino-pico.git (is there a specific reason for this change?). Anyway, I now tried using your link instead, but it did not solve the problem either ...

I was an early user of using Earle's framework with platformio and I'm using the platform_packages that Earle and Max recommended at the time. There may be a better way to do things now, but this is still working for me.

When I was first getting the toolchain set up I got errors like the one's you report because I had the wrong toolchain link. It's been a while, but I believe I picked the toolchain for my operating system from:

https://github.com/earlephilhower/pico-quick-toolchain/releases

Good luck!

@Laserjones
Copy link

Could it depend on the way I created the original project before I adapted the platformio.ini? When I selected the board, there were several entries called "Raspberry Pico" or similar. I have no idea what the differences are, so I just picked the first one ...

@maxgerhardt
Copy link
Contributor

maxgerhardt commented May 9, 2022

board = pico is perfectly valid. This is in fact the very first board in my example.

That's interesting, this is not the link stated by Earle in his documentation, which is https://github.com/earlephilhower/arduino-pico.git (is there a specific reason for this change?). Anyway, I now tried using your link instead, but it did not solve the problem either ...

I would actually recommend using the earlephilhower original core, my fork of it is just for some testing (e.g. RAM linker scripts, debugging, ..) and present in my test projects, use this repo (https://github.com/earlephilhower/arduino-pico.git) to get the latest things.

@Laserjones
Copy link

Laserjones commented May 9, 2022

board = pico is perfectly valid. This is in fact the very first board in my example.

I know, but my thought was that besides the platformio.ini file, there might be other parts of the project set up differently depending which of the "Rapberry Pico" board entries I select in advance? Or does the platformio.ini control everything?

Image1

@maxgerhardt
Copy link
Contributor

The platformio.ini controls all base build configuration options, nothing else you selected in the UI matters. In fact one can create an "Arduino Uno" project then change the platformio.ini to the one you posted above and it will compile for a pico. No traces of an Arduino Uno then.

@Laserjones
Copy link

Laserjones commented May 9, 2022

The platformio.ini controls all base build configuration options, nothing else you selected in the UI matters. In fact one can create an "Arduino Uno" project then change the platformio.ini to the one you posted above and it will compile for a pico. No traces of an Arduino Uno then.

Good to know. But then I have absolutely no idea why the compiler is not found ... Shouldn't it be installed along with the other stuff? Where would it usually be located?

Here's a portion of the terminal output, maybe it helps:

image

The German error messages say that arm-none-eabi-... is misspelled or not found. (Any idea how I can enforce English error messages? PlatformIO is set to English already.)

@maxgerhardt
Copy link
Contributor

Is the folder <home folder>/.platformio/packages/toolchain-pico still empty after that? Even after removing toolchain-pico and that .cache folder referenced above?

Do you have antivirus active?

The only two possibilities I see is a corrupted download or an AV blocking execution.

@DomiGib
Copy link

DomiGib commented Dec 1, 2022

Make sure you're using the rpipicow board, not the rpipico one in your .ini file.

Thank you, that solved my problem!

@maxgerhardt
Copy link
Contributor

Okay good, I also cross verified it just now to be working with rpipicow correctly.

@Ing-Dom
Copy link
Contributor

Ing-Dom commented Jan 14, 2023

I came across the question if it is possible and if it is usefull to specify the platform more specifc ;)

I really hate if something changes and maybe breaks something, so thats why a specified a exact core version in platform_packages (2.5.4).
can I do this for platform also ? pic some version / branch / commit ?

[RP2040]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
platform_packages = framework-arduinopico @ https://github.com/earlephilhower/arduino-pico/releases/download/2.5.4/rp2040-2.5.4.zip
board = pico
; Arduino-Pico core
board_build.core = earlephilhower

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jan 14, 2023

Yes, per documentation, you can fixate the platform version in place too by the commit or branch name, using the #<commit / branch> syntax.

platform = https://github.com/maxgerhardt/platform-raspberrypi.git#9f8c10e50b5acd18e7bfd32638199c655be73a5b

Note that sometimes this does not protect from breakage. When e.g. new toolchains are uploaded which invalidate the old version, and you have a platform version that doesn't reference the new version, compilation will simply break with a "no such package found" error. It does however fix everything else in place (board definitions, platform.py, main.py build logic..)

@Ing-Dom
Copy link
Contributor

Ing-Dom commented Jan 15, 2023

thanks.
while browsing your latest commits, I came accros this line:
https://github.com/maxgerhardt/platform-raspberrypi/blob/develop/platform.json#L50
"version": "https://github.com/earlephilhower/arduino-pico.git#aeb41f3e70628e63ed1cf13f2031cdaf61d65ad0"

Do I understand this right, your plattform refers an exact version of erale's core ?
And when I do something like this
platform_packages = framework-arduinopico @ https://github.com/earlephilhower/arduino-pico/releases/download/2.5.4/rp2040-2.5.4.zip
this is overwritten ?

@maxgerhardt
Copy link
Contributor

Exactly, platform_packages overrides what I set in the platform.json.

@NickDolfin
Copy link

NickDolfin commented Feb 10, 2023

I have a 4MB waveshare rp2040 plus.
Unfortunately it is not in the boards directory. No json file.
Anyone know what to do?

@maxgerhardt
Copy link
Contributor

The board definition contained in Arduino-Pico, but I haven't pulled the update into platform-raspberrypi yet. Will be fixed in a moment.

@NickDolfin
Copy link

Oh, that would be very nice. I struggle a bit with manually adjusting files.

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Feb 10, 2023

Fixed in maxgerhardt/platform-raspberrypi@1b96272.

Please issue an update command through the CLI with

pio pkg update -g -p "https://github.com/maxgerhardt/platform-raspberrypi.git"

then a board called "RP2040 Plus 4MB" should be available in the board selection. Or, directly set the platformio.ini to

[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

[env:waveshare_rp2040_plus_4mb]
board = waveshare_rp2040_plus_4mb

@NickDolfin
Copy link

I get an error:

PS C:\Users\nick\Documents\PlatformIO\Projects\pico8-tmp117> pio pkg update -g -p "https://github.com/maxgerhardt/platform-raspberrypi.git"
Platform Manager: Updating raspberrypi @ 1.7.0+sha.3cf9e1a
git version 2.39.1.windows.1
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 15 (delta 12), reused 12 (delta 10), pack-reused 0
Unpacking objects: 100% (15/15), 2.54 KiB | 42.00 KiB/s, done.
From https://github.com/maxgerhardt/platform-raspberrypi
3cf9e1a..1b96272 develop -> origin/develop
Fetching submodule builder/frameworks/arduino/mbed-core
error: The following untracked working tree files would be overwritten by merge:
boards/waveshare_rp2040_plus_4mb.json
Please move or remove them before you merge.
Aborting
Updating 3cf9e1a..1b96272
Error: VCS: Could not process command ['git', 'pull', '--recurse-submodules']
PS C:\Users\nick\Documents\PlatformIO\Projects\pico8-tmp117>

@maxgerhardt
Copy link
Contributor

git pull doesn't like it when you have manually altered the files after download. But you don't need these local modifications anymore.

  1. Close VSCode
  2. Remove the whole folder C:\Users\nick\.platformio\platforms\raspberrypi
  3. Reopen VSCode and wait for it to reload intellisense

@NickDolfin
Copy link

Ahh, stupid me. I manually made that file. Just removed it and started the first command again. No errors visible:

PS C:\Users\nick\Documents\PlatformIO\Projects\pico8-tmp117> pio pkg update -g -p "https://github.com/maxgerhardt/platform-raspberrypi.git"
Platform Manager: Updating raspberrypi @ 1.7.0+sha.3cf9e1a
git version 2.39.1.windows.1
Fetching submodule builder/frameworks/arduino/mbed-core
Updating 3cf9e1a..1b96272
Fast-forward
boards/0xcb_helios.json | 54 ++++++++++++++++++++++++++++++++++
boards/nullbits_bit_c_pro.json | 54 ++++++++++++++++++++++++++++++++++
boards/vccgnd_yd_rp2040.json | 54 ++++++++++++++++++++++++++++++++++
boards/viyalab_mizu.json | 54 ++++++++++++++++++++++++++++++++++
boards/waveshare_rp2040_lcd_0_96.json | 54 ++++++++++++++++++++++++++++++++++
boards/waveshare_rp2040_lcd_1_28.json | 54 ++++++++++++++++++++++++++++++++++
boards/waveshare_rp2040_one.json | 54 ++++++++++++++++++++++++++++++++++
boards/waveshare_rp2040_plus_16mb.json | 54 ++++++++++++++++++++++++++++++++++
boards/waveshare_rp2040_plus_4mb.json | 54 ++++++++++++++++++++++++++++++++++
platform.json | 2 +-
10 files changed, 487 insertions(+), 1 deletion(-)
create mode 100644 boards/0xcb_helios.json
create mode 100644 boards/nullbits_bit_c_pro.json
create mode 100644 boards/vccgnd_yd_rp2040.json
create mode 100644 boards/viyalab_mizu.json
create mode 100644 boards/waveshare_rp2040_lcd_0_96.json
create mode 100644 boards/waveshare_rp2040_lcd_1_28.json
create mode 100644 boards/waveshare_rp2040_one.json
create mode 100644 boards/waveshare_rp2040_plus_16mb.json
create mode 100644 boards/waveshare_rp2040_plus_4mb.json
Tool Manager: [email protected] is already up-to-date
Tool Manager: [email protected] is already up-to-date
Tool Manager: [email protected] is already up-to-date
Tool Manager: [email protected] is already up-to-date
Tool Manager: [email protected] is already up-to-date
PS C:\Users\nick\Documents\PlatformIO\Projects\pico8-tmp117>

@NickDolfin
Copy link

Unfortunately after moving the uf2 file into the rp2 disk. It does not start at all.
When I compile it as a standard pico (2MB), it works (blinky+ i2c stuff +2 uarts).

@maxgerhardt
Copy link
Contributor

The pin definitions may be different for I2C/UART causing a crash. Does it also not blink with the simplest possible sketch of

#include <Arduino.h>
#define LED 25u
void setup() { pinMode(LED, OUTPUT); }
void loop() { digitalWrite(LED, LOW); delay(1000); digitalWrite(LED, HIGH); delay(1000); }

?

@NickDolfin
Copy link

Yes that works on the 4MB setup.

[env:waveshare_rp2040_plus_4mb]
platform = raspberrypi
board = waveshare_rp2040_plus_4mb
framework = arduino

Now I will analyse your suggestions about the different pin definitions. Maybe there is a discrepancy?

@maxgerhardt
Copy link
Contributor

Inspect the pins_arduino.h of that variant. Are you trying to set pins different than those? Try only adding one thing it a time to see where it fails.

@NickDolfin
Copy link

NickDolfin commented Feb 10, 2023

In the mean time I changed the platform.ini file to:

[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0m

[env:pico]
board = pico

And that also works.

and this also works:

[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0m

[env:waveshare_rp2040_plus_4mb]
board = waveshare_rp2040_plus_4mb

I'll check the pin_arduino.h for both versions

@NickDolfin
Copy link

Yes, you are right.
There is a difference in the pin definitions of the two I2C pins in the pins_arduino.h for both versions. The pin layout of both boards (original pico and waveshare) are the same.

If I change the pins in pins_arduino.h of the waveshare version, will that revert after an update of your install base?
What to do?

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Feb 10, 2023

Yes, a local pins_arduino.h change in the PlatformIO packages would be reverted after an update.

The Wire library allows runtime modification of the pins per source code. Can you try calling this a first thing in setup() to redirect the pins to where you want them?

If you think the Waveshare Plus 4MB pins are wrong at the source, you can also create an issue or a PR in this repository to correct them.

@NickDolfin
Copy link

NickDolfin commented Feb 10, 2023

Thats an idea. But I'm an old school c guy. I have no clue yet about classes.
What is the exact syntax to redirect wire0 sda to pin 4 and wire 0 scl to pin 5 to put in setup() ?

The pins are not wrong, the rp2040 has several pin options for e.g. I2C0 and they are assigned to another set.
But after thinking about it. Perhaps its wise to have them assigned just like the standard Pico's - just to make life easier for everyone.

@maxgerhardt
Copy link
Contributor

#include <Arduino.h>
#include <Wire.h>

void setup() {
  Wire.setSDA(4); //GP4
  Wire.setSCL(5); //GP5
  /* rest of the original code */
}

void setup() { /* original code */ }

@NickDolfin
Copy link

Many thanks - that really works!

@Ing-Dom
Copy link
Contributor

Ing-Dom commented Feb 25, 2023

That is maybe a general question, but anyway, I'm sure you can help me.

We from OpenKNX try to have a maximum on reproducability in our releases.
That is why we used to ref the platform like this, thinking that would be sufficient:

platform = https://github.com/maxgerhardt/platform-raspberrypi.git#9f8c10e

but, that compiles now with error:

 *  Executing task: scripts/OpenKNX-Build.ps1 build_RP2040 

OpenKNX pre-build-steps:
  - Copying 'src/Logikmodul.h' into search path 'lib/OGM-Common/include/knxprod.h'
  - Copying 'src/LogikmodulHardware.h' into search path 'lib/OGM-Common/include/hardware.h'
Processing build_RP2040 (platform: https://github.com/maxgerhardt/platform-raspberrypi.git#9f8c10e; board: pico; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Tool Manager: Installing earlephilhower/toolchain-rp2040-earlephilhower @ 5.100300.221223
Error: Could not find the package with 'earlephilhower/toolchain-rp2040-earlephilhower @ 5.100300.221223' requirements for your system 'windows_amd64'
 *  Terminal will be reused by tasks, press any key to close it. 

why is that? where is that missing dependency? what changed that this does not work anymore? PIO?

Now we are using

platform = https://github.com/maxgerhardt/platform-raspberrypi.git
platform_packages = framework-arduinopico @ https://github.com/earlephilhower/arduino-pico/releases/download/2.7.1/rp2040-2.7.1.zip

but I'm not sure if that is enough or if there may be some update thats breaks stuff again...

At first, I just want to understand the dependencies and why that happens..

@maxgerhardt
Copy link
Contributor

The PlatformIO staff deletes the old packages (toolchain etc.), only keeps the latest one until is platformio/platform-raspberrypi#36 is merged. We can't affect that. So old platform versions that references deleted toolchain packages break.

The toolchain it refernced (based on the date) is https://github.com/earlephilhower/pico-quick-toolchain/releases/tag/1.5.0-a.
Try adding toolchain-rp2040-earlephilhower@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/x86_64-w64-mingw32.arm-none-eabi-5007782.221223.zip to the platform_packages.

@Ing-Dom
Copy link
Contributor

Ing-Dom commented Feb 25, 2023

thanks max!

that worked.
For the future - when we define both, like

platform = https://github.com/maxgerhardt/platform-raspberrypi.git#9f8c10e
platform_packages = toolchain-rp2040-earlephilhower@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-a/x86_64-w64-mingw32.arm-none-eabi-5007782.221223.zip
board = pico

do you think build breaks again on some point?

@NickDolfin
Copy link

I use this:

[env]

platform = https://github.com/maxgerhardt/platform-raspberrypi.git
platform_packages = toolchain-rp2040-earlephilhower@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.5.0-b/x86_64-w64-mingw32.arm-none-eabi-c7bab52.230216.zip

framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

[env:waveshare_rp2040_plus_4mb]
board = waveshare_rp2040_plus_4mb

Q for Ing-Dom

Why do you use #9f8c10 in your platform? Is that needed?

@Riffer
Copy link

Riffer commented Apr 8, 2023

For people like me, here is currently the best starting point for the installation:

https://arduino-pico.readthedocs.io/en/latest/platformio.html

Installation by platform_packages is deprecated now.

@maxgerhardt
Copy link
Contributor

@earlephilhower can we close this issue? PlatformIO support is in the core now and if people encounter problems they can open a new issue with the details. By this point there must be tons of people subscribed to this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed platformio Platform.IO support
Projects
None yet
Development

No branches or pull requests