maxgerhardt / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
Apache License 2.0
107 stars 54 forks source link

The newer method of using this on the arduino-pico wiki doesn't work #14

Closed MrYorkiebar closed 1 year ago

MrYorkiebar commented 2 years ago

I created a new project and followed the wiki for arduino-pico on platformio usage. It stated that the platform packages section was no longer needed, so now the ini should look like this.

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

I have used this but get this error

Error: Could not find the package with 'maxgerhardt/framework-arduinopico @ ~1.10902.0' requirements for your system 'windows_amd64'

Using the line pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi.git as recommended gave this error:

Platform Manager: Updating raspberrypi @ 1.2.0+sha.74a6e8a
git version 2.33.1.windows.1
Fetching submodule builder/frameworks/arduino/mbed-core
error: Your local changes to the following files would be overwritten by merge:
        .github/workflows/examples.yml
        README.md
        boards/adafruit_feather.json
        boards/adafruit_itsybitsy.json
        boards/adafruit_kb2040.json
        boards/adafruit_macropad2040.json
        boards/adafruit_qtpy.json
        boards/adafruit_stemmafriend.json
        boards/adafruit_trinkeyrp2040qt.json
        boards/arduino_nano_connect.json
        boards/challenger_2040_lte.json
        boards/challenger_2040_wifi.json
        boards/challenger_nb_2040_wifi.json
        boards/cytron_maker_nano_rp2040.json
        boards/cytron_maker_pi_rp2040.json
        boards/generic.json
        boards/ilabs_rpico32.json
        boards/melopero_shake_rp2040.json
        boards/nanorp2040connect.json
        boards/pico.json
        boards/rpipico.json
        boards/solderparty_rp2040_stamp.json
        boards/sparkfun_promicrorp2040.json
        boards/upesy_rp2040_devkit.json
        boards/wiznet_5100s_evb_pico.json
        builder/frameworks/_bare.py
        builder/main.py
        examples/arduino-blink/README.md
        examples/arduino-blink/platformio.ini
        examples/arduino-blink-earlephilhower/.gitignore
        examples/arduino-blink-earlephilhower/README.md
        examples/arduino-blink-earlephilhower/include/README
        examples/arduino-blink-earlephilhower/lib/README
        examples/arduino-blink-earlephilhower/platformio.ini
        examples/arduino-blink-earlephilhower/src/main.cpp
        examples/arduino-blink-earlephilhower/test/README
        misc/svd/rp2040.svd
        platform.json
        platform.py
Please commit your changes or stash them before you merge.
Aborting
Updating 74a6e8a..aa79bc5
Error: VCS: Could not process command ['git', 'pull', '--recurse-submodules']

I'd appreciate any kind of help with this 🙂. I'm not sure whether this is the correct place to ask this or whether it should be on the arduino-pico github or on platformio forums.

MrYorkiebar commented 2 years ago

I tried deleting the framework-arduinopico, toolchain-pico and tool-rp2040tools folders from the packages folder in .platformio. I then tried to build with this in the ini, updating the reference for toolchain-pico to the latest version:

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0m
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.4.0-c/x86_64-w64-mingw32.arm-none-eabi-0196c06.220714.zip

It redownloaded everything but now I'm getting this error:

CONFIGURATION: https://docs.platformio.org/page/boards/raspberrypi/pico.html
PLATFORM: Raspberry Pi RP2040 (1.2.0+sha.74a6e8a) > Raspberry Pi Pico
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, picoprobe, raspberrypi-swd)
PACKAGES:
 - framework-arduinopico @ 1.20504.0+sha.4cc6c36
 - tool-rp2040tools @ 1.0.2
 - toolchain-pico @ 5.100300.220714 (10.3.0)
KeyError: '__fetch_fs_size':
  File "C:\Users\mryor\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 188:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\mryor\.platformio\platforms\raspberrypi@src-ff76a3915224135aafad379817f41edd\builder\main.py", line 222:
    target_elf = env.BuildProgram()
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Util.py", line 737:
    return self.method(*nargs, **kwargs)
  File "C:\Users\mryor\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 60:
    env.ProcessProgramDeps()
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Util.py", line 737:
    return self.method(*nargs, **kwargs)
  File "C:\Users\mryor\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 120:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Util.py", line 737:
    return self.method(*nargs, **kwargs)
  File "C:\Users\mryor\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 331:
    SConscript(env.GetFrameworkScript(name), exports="env")
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 660:
    return method(*args, **kw)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\mryor\.platformio\platforms\raspberrypi@src-ff76a3915224135aafad379817f41edd\builder\frameworks\arduino\arduino.py", line 39:
    SConscript(build_script)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 660:
    return method(*args, **kw)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Script\SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\mryor\.platformio\packages\framework-arduinopico\tools\platformio-build.py", line 291:
    env["__fetch_fs_size"](env)
  File "C:\Users\mryor\.platformio\packages\tool-scons\scons-local-4.4.0\SCons\Environment.py", line 387:
    return self._dict[key]
MrYorkiebar commented 2 years ago

After several hours, in the end I uninstalled platformio then vscode then git for windows. I restarted and installed them again vscode first then platformio. I tried to build a new project with the earlephilhower core and received an error saying git doesn't exist then installed git and restarted.

I then had the issue of loading tasks lasting forever as soon as I change the core. Restarting and reinstalling did not help.

I solved this by turning off internet, loading up my platformio project with this core, attempting to build, let it fail to reach github then enable wifi and spam the build button until it starts downloading from git. This downloaded it from github properly with no issues relatively quickly.

I have no idea why this happened or even what I did to fix, all I know is this worked for me