platform-raspberrypi icon indicating copy to clipboard operation
platform-raspberrypi copied to clipboard

Temporary solution for FW uploading in windows

Open Gusev-Roman opened this issue 3 years ago • 2 comments

platformio.ini [env:pico] platform = raspberrypi board = pico framework = arduino upload_protocol = mbed upload_port = E:

platforms/raspberrypi/builder/main.py

` if upload_protocol == "mbed":

upload_actions = [
    env.VerboseAction(env.AutodetectUploadPort, "Looking for upload disk..."),
    env.VerboseAction(env.UploadToDisk, "Uploading $SOURCE")
]`

must be replaced to

` if upload_protocol == "mbed":

target_firm = join("$BUILD_DIR", "${PROGNAME}.uf2")	
env.Replace(
    UPLOADER="copy",
    UPLOADERFLAGS=target_firm,
    UPLOADCMD="$UPLOADER $UPLOADERFLAGS $UPLOAD_PORT >NUL")
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]

`

now uploading works!..

Gusev-Roman avatar Feb 20 '22 09:02 Gusev-Roman

Thanks, but now I have to unplug and hold the button. Is there any way to join both actions: forcing the board into bootsel from picotool and copying the file as you described?

oomek avatar Mar 12 '22 13:03 oomek

upload_protocol = mbed UF2 upload is fixed by #36.

Is there any way to join both actions: forcing the board into bootsel from picotool and copying the file as you described?

Once a firmware from the Arduino core has been uploaded, it accepts a 1200bps reset-to-bootloader through the USB Serial interface it creates. Just delete any upload_protocol = .. line from the platformio.ini after, it's the default protocol. You don't need to re-plug / reset your board manually.

maxgerhardt avatar Jun 09 '22 21:06 maxgerhardt