-
Notifications
You must be signed in to change notification settings - Fork 426
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
Comments
@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. |
Has anyone else taken this on? If not, I can give it a shot. |
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.
|
@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. |
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. |
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... |
FYI, today I've forked the core and added a builder script, along with the needed platform modifications to use your The current state is that I can successfully build the firmware (with the linker script also generated by 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. |
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. |
Debugging support is handled on the platform level ( |
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 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 The final steps are making it work via OpenOCD / JLink.exe upload methods and verifying that debugging works. |
I'm making progress regarding adding debugging support using Picoprobe, but it's not 100% working yet. The stacktrace doesn't reach back to the actual user function (in the sketch I do 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. |
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. |
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
Here's my platformio.ini:
When trying to compile, the terminal says that various commands all named 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? |
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 |
Here's what I use on Mac OS: platform_packages = Hope that helps! |
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.
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 ...? |
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 ... |
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 |
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! |
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 ... |
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 ( |
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? |
The |
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: The German error messages say that |
Is the folder Do you have antivirus active? The only two possibilities I see is a corrupted download or an AV blocking execution. |
Thank you, that solved my problem! |
Okay good, I also cross verified it just now to be working with |
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).
|
Yes, per documentation, you can fixate the platform version in place too by the commit or branch name, using the 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..) |
thanks. Do I understand this right, your plattform refers an exact version of erale's core ? |
Exactly, |
I have a 4MB waveshare rp2040 plus. |
The board definition contained in Arduino-Pico, but I haven't pulled the update into platform-raspberrypi yet. Will be fixed in a moment. |
Oh, that would be very nice. I struggle a bit with manually adjusting files. |
Fixed in maxgerhardt/platform-raspberrypi@1b96272. Please issue an update command through the CLI with
then a board called "RP2040 Plus 4MB" should be available in the board selection. Or, directly set the [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 |
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" |
|
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" |
Unfortunately after moving the uf2 file into the rp2 disk. It does not start at all. |
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); } ? |
Yes that works on the 4MB setup. [env:waveshare_rp2040_plus_4mb] Now I will analyse your suggestions about the different pin definitions. Maybe there is a discrepancy? |
Inspect the |
In the mean time I changed the platform.ini file to: [env] [env:pico] And that also works. and this also works: [env] [env:waveshare_rp2040_plus_4mb] I'll check the pin_arduino.h for both versions |
Yes, you are right. If I change the pins in pins_arduino.h of the waveshare version, will that revert after an update of your install base? |
Yes, a local The Wire library allows runtime modification of the pins per source code. Can you try calling this a first thing in 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. |
Thats an idea. But I'm an old school c guy. I have no clue yet about classes. The pins are not wrong, the rp2040 has several pin options for e.g. I2C0 and they are assigned to another set. |
#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 */ } |
Many thanks - that really works! |
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.
but, that compiles now with error:
why is that? where is that missing dependency? what changed that this does not work anymore? PIO? Now we are using
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.. |
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. |
thanks max! that worked.
do you think build breaks again on some point? |
I use this: [env] platform = https://github.com/maxgerhardt/platform-raspberrypi.git framework = arduino [env:waveshare_rp2040_plus_4mb] Q for Ing-Dom Why do you use #9f8c10 in your platform? Is that needed? |
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. |
@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. |
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?
The text was updated successfully, but these errors were encountered: