JoNil / elf2uf2-rs

BSD Zero Clause License
81 stars 31 forks source link

Unable to find mounted pico #3

Closed luiswirth closed 3 years ago

luiswirth commented 3 years ago

The --deploy option doesn't work on my system. Unable to find mounted pico

I'm on arch linux and lsusb does list the pico:

Bus 003 Device 014: ID 2e8a:0003 Raspberry Pi RP2 Boot
luiswirth commented 3 years ago

I tried debugging it myself and just noticed, that the pico has to be mounted.

Is it possible to automatically mount and unmount?

konk3r commented 2 years ago

Did you find a workaround for this? I'm running into it and haven't had luck finding a solution.

luiswirth commented 2 years ago

@konk3r Meanwhile I'm using picoprobe (a second pico that serves as a communication bridge between the computer and the actual pico, that can flash).

Before that I just used a small script that does the mounting for me.

#!/bin/sh

sudo mount -o uid=1000,gid=1000 /dev/pico /mnt/pico
elf2uf2-rs $1
cp $1.uf2 /mnt/pico
sudo umount /mnt/pico

And in my .cargo/config I have

runner = "script/pico-load-ocd"
headstrongsolutions commented 1 year ago

:) for anyone else who's stuck on this and see's "..that the pico has to be mounted" and spends an inordinate amount of time debugging the underlying system disks rust library to see that /proc/mounts is where the lookup happens before realising in a moment of utter stupid realisation what they've been doing, I'll shortcut it for you.

On Manjaro elf2uf2-rs looks up the mounted pico from /proc/mounts. The pico will not appear in there unless you access the automount.

Power the pico in BOOTSEL mode, then open the presented RPI-RP2 drive (so you can then see INFO_UF2.TXT). It's this that causes /proc/mounts to get populated with /dev/SDB1 or whatever it is on your machine.

elf2ufs-rs will then work :)

...I spent way too long on this, I'm still chuckling.

weiying-chen commented 8 months ago

:) for anyone else who's stuck on this and see's "..that the pico has to be mounted" and spends an inordinate amount of time debugging the underlying system disks rust library to see that /proc/mounts is where the lookup happens before realising in a moment of utter stupid realisation what they've been doing, I'll shortcut it for you.

On Manjaro elf2uf2-rs looks up the mounted pico from /proc/mounts. The pico will not appear in there unless you access the automount.

Power the pico in BOOTSEL mode, then open the presented RPI-RP2 drive (so you can then see INFO_UF2.TXT). It's this that causes /proc/mounts to get populated with /dev/SDB1 or whatever it is on your machine.

elf2ufs-rs will then work :)

...I spent way too long on this, I'm still chuckling.

@headstrongsolutions This makes sense! But this means, you'll remove INFO_UF2.TXT every time you put Rust code into Pico. And you'll have to repeat the entire process you described every time you change that code.