I’m trying to import an Arduino project into PlatformIO and I get the following error message:
Could not import Arduino project
PIO Core Call Error: “The following files/directories have been created in C:\\Users\\jtgar\\~Software\\Arduino\\PlatformIO Source\\260405-145213-adafruit_macropad2040\r\ninclude - Put project header files here\r\nlib - Put project specific (private) libraries here\r\nsrc - Put project source files here\r\nplatformio.ini - Project Configuration File\r\nResolving adafruit_macropad2040 dependencies…\r\n\n\nUnknownBoard: Unknown board ID ‘adafruit_macropad2040’”
The board I’m selecting in the Import Arduino Project dialog is MacroPad RP2040 (Adafruit).
Also, the test code imports and runs correctly using the Arduino IDE.
Thank you for your help; it looks like I’m closer, but not quite there yet.
Yes, it did create the platformio.ini file and I made your change. It also created the project file structure but did not populate it. I created a simple main.cpp (blink program so I could test). It builds without errors, but will not download.
This is the build log:
Processing adafruit_macropad2040 (platform: https://github.com/maxgerhardt/platform-raspberrypi.git; board: adafruit_macropad2040; framework: arduino)---------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via \`-v, --verbose\` option
CONFIGURATION: https://docs.platformio.org/page/boards/raspberrypi/adafruit_macropad2040.html
PLATFORM: Raspberry Pi RP2040 (1.19.0+sha.79ce473) > MacroPad RP2040
HARDWARE: RP2040 133MHz, 256KB RAM, 8MB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, picoprobe, raspberrypi-swd)
PACKAGES:
- framework-arduinopico @ 1.50501.0+sha.275e73d
- tool-mklittlefs-rp2040-earlephilhower @ 5.100300.230216 (10.3.0)
- tool-openocd-rp2040-earlephilhower @ 5.140200.250530 (14.2.0)
- tool-picotool-rp2040-earlephilhower @ 5.140200.250530 (14.2.0)
- tool-pioasm-rp2040-earlephilhower @ 5.140200.250530 (14.2.0)
- toolchain-rp2040-earlephilhower @ 5.140200.250530 (14.2.0)
Flash size: 8.00MB
Sketch size: 8.00MB
Filesystem size: 0.00MB
PSRAM size: 0.00MB
Maximium Sketch size: 8384512 EEPROM start: 0x107ff000 Filesystem start: 0x107ff000 Filesystem end: 0x107ff000
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder \~ chain, Compatibility \~ soft
Found 74 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\\build\\adafruit_macropad2040\\firmware.elf
Checking size .pio\\build\\adafruit_macropad2040\\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 3.3% (used 8732 bytes from 262144 bytes)
Flash: [ ] 0.7% (used 58268 bytes from 8384512 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, picoprobe, picotool, raspberrypi-swd
CURRENT: upload_protocol = picotool
Looking for upload port...
Error: Please specify \`upload_port\` for environment or use global \`--upload-port\` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
\*\*\* \[upload\] Explicit exit, status 1
========================================== \[FAILED\] Took 6.99 seconds ==========================================
\* The terminal process "C:\\Users\\jtgar\\.platformio\\penv\\Scripts\\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.
\* Terminal will be reused by tasks, press any key to close it.
I tried various upload protocols and com ports without success.
Thanks for your reply. As I said in my original post, I can download using the Arduino IDE, therefore I assume that I have all the correct drivers installed. I read the post you linked to and tried the suggestions in that post without success.
No, the Arduino IDE with Arduino-Pico by default uses a UF2 upload method (“copy uf2 file to USB BOOTSEL drive”), which needs no drivers and thus doesn’t go through picotool. The conclusion is wrong.
You can equally make PlatformIO use that method by setting
upload_protocol = mbed
in the platformio.ini and putting the board into BOOTSEL mode once.
That should not be possible. Can you show a screenshot of Zadig, with your board pluged in in BOOTSEL mode and the “RP2 Boot2 (Interface 1)” selected, having loaded WinUSB or libusb32 drivers? If that holds, picotool should be able to interact with it just fine.