Do you really have to replug the USB every time to reload your code ?
If so I can see a lot of broken usb sockets in the near future...
PeterO
Have I missed something...
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
You need to power down in some way = could be by unplugging. Hold the BOOTSEL button down when powering back up and you will go in to MSD mode.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: Have I missed something...

Seems like you've spoilt an otherwise fine product with a totally inappropriate download scheme...
I'll wait until you've come up with something appropriate before going any further with this....
Very dissapointed

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
No, you don't.
https://github.com/raspberrypi/picotool
This is a command-line tool that interacts with the bootloader. Note the "reboot" command.
Edit: it's installed by default if you have installed the SDK correctly.
https://github.com/raspberrypi/picotool
This is a command-line tool that interacts with the bootloader. Note the "reboot" command.
Edit: it's installed by default if you have installed the SDK correctly.
Rockets are loud.
https://astro-pi.org
https://astro-pi.org
Re: Have I missed something...
Come on Peter, you should know better than that.PeterO wrote: ↑Fri Jan 22, 2021 3:41 pmReally ... This is 2021 you know, not 1980...
Seems like you've spoilt an otherwise fine product with a totally inappropriate download scheme...
I'll wait until you've come up with something appropriate before going any further with this....
Very dissapointed
PeterO
You can use the debugger, you'll never need to turn it off again. I use a bench top power supply, it has a switch. You can use Picotool.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: Have I missed something...
I'm working my way through the "getting started" manual.... No mention of debuggers yet and all I wanted to do was flash the led slower...
I asked "Do you really have to replug the USB every time to reload your code ?"
You didn't say anything about debuggers in your reply, so I find your ""Come on Peter" comment to be highly insulting !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
- aallan
- Raspberry Pi Trading Employee & Forum Moderator
- Posts: 125
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
- Contact: Website Twitter
Re: Have I missed something...
Chapter 5, "Getting started with Raspberry Pi Pico" and onwards..?
Technical Documentation Manager
Raspberry Pi (Trading) Limited
About me, http://alasdairallan.com
Raspberry Pi (Trading) Limited
About me, http://alasdairallan.com
Re: Have I missed something...
Nothing about this in https://datasheets.raspberrypi.org/pico ... h_pico.pdfjdb wrote: ↑Fri Jan 22, 2021 3:44 pmNo, you don't.
https://github.com/raspberrypi/picotool
This is a command-line tool that interacts with the bootloader. Note the "reboot" command.
Edit: it's installed by default if you have installed the SDK correctly.
TBH the documentation I've read so far is verbose but not very well though out...
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
Repeated plugging becomes an issue in Chapter 3, so why is it not mentioned there ? As I said, I'm finding the docs are poorly thought out....

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
I can only assume that you designed and built this product without anyone who has used an Arduino saying "Hold on, this download method is a crock !"

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
https://www.amazon.co.uk/dp/B08D92G7TF/ref=dp_prsubs_1
Been using these on Pis and ESP32 dev boards for a couple of years.
Been using these on Pis and ESP32 dev boards for a couple of years.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.
Re: Have I missed something...
Tedious negging aside...
Ah, turns out there are a few gotchas with picotool. It only interacts with a RP2040 in the USB bootloader mode, so only if BOOTSEL was pressed when the chip came out of reset. Most code downloads will automatically reboot into the SPI flash code after completing, so unless they also expose the bootloader interface over USB, picotool won't do anything.
Resetting the chip is all that is required to re-run the ROM and sample the BOOTSEL pin. Unplug isn't (but unplugging implies power-on reset).
Use the RUN pin (pin 30) to reset the RP2040 without un-powering the board. Force low to reset the chip, press BOOTSEL, and disconnect to "run". See the Pico datasheet:
https://datasheets.raspberrypi.org/pico ... asheet.pdf
Ah, turns out there are a few gotchas with picotool. It only interacts with a RP2040 in the USB bootloader mode, so only if BOOTSEL was pressed when the chip came out of reset. Most code downloads will automatically reboot into the SPI flash code after completing, so unless they also expose the bootloader interface over USB, picotool won't do anything.
Resetting the chip is all that is required to re-run the ROM and sample the BOOTSEL pin. Unplug isn't (but unplugging implies power-on reset).
Use the RUN pin (pin 30) to reset the RP2040 without un-powering the board. Force low to reset the chip, press BOOTSEL, and disconnect to "run". See the Pico datasheet:
https://datasheets.raspberrypi.org/pico ... asheet.pdf
Rockets are loud.
https://astro-pi.org
https://astro-pi.org
-
- Posts: 25
- Joined: Thu Nov 13, 2014 2:52 pm
Re: Have I missed something...
Thick alert... You've been warned....
Maybe because it's Friday and I can't wait to leave.....
So... I have a raspberry pi and a PICO locked in a box... The only thing that comes out of that box is an ethernet cable that gives me ssh access and access to a samba share on the raspberry. There is a usb cable connecting the raspberry and the pico...
Without fitting relays and air pistons pressing down on BSEL buttons... can I or can I not program and reprogram the PICO via ssh...?
thanks, sorry and have a nice weekend
Maybe because it's Friday and I can't wait to leave.....
So... I have a raspberry pi and a PICO locked in a box... The only thing that comes out of that box is an ethernet cable that gives me ssh access and access to a samba share on the raspberry. There is a usb cable connecting the raspberry and the pico...
Without fitting relays and air pistons pressing down on BSEL buttons... can I or can I not program and reprogram the PICO via ssh...?
thanks, sorry and have a nice weekend

-
- Posts: 385
- Joined: Fri Apr 12, 2013 9:27 am
- Location: Essex, UK
- Contact: Website
Re: Have I missed something...
I have a 5 inch male to female USB extension cable stapled to my desktop. My main worry at the time was reinserting the main cable sometimes dislodged the monitor cable and I was doing this a few times a minute developing C programs.
Re: Have I missed something...
I was just about to ask about the run pin to do this. That seems like a good option. Two pins away from a GND so a push button could probably fitted to the board to make this easy in development.jdb wrote: ↑Fri Jan 22, 2021 4:15 pmUse the RUN pin (pin 30) to reset the RP2040 without un-powering the board. Force low to reset the chip, press BOOTSEL, and disconnect to "run". See the Pico datasheet:
https://datasheets.raspberrypi.org/pico ... asheet.pdf
Re: Have I missed something...
This might be a really, really bad idea, but I don't immediately see why you couldn't tie a Pi GPIO to TP4 and one to pin 30 on the Pico, to simulate pressing the button (which seems to be tied to the flash chipselect, which is neat) and reset the uC.papatrexasgre wrote: ↑Fri Jan 22, 2021 4:38 pmSo... I have a raspberry pi and a PICO locked in a box... The only thing that comes out of that box is an ethernet cable that gives me ssh access and access to a samba share on the raspberry. There is a usb cable connecting the raspberry and the pico...
Without fitting relays and air pistons pressing down on BSEL buttons... can I or can I not program and reprogram the PICO via ssh...?
[Edit: I misread the schematic. It is, as has been pointed out, TP6, not TP4. Apologies.]
Last edited by dickon on Mon Jan 25, 2021 7:02 pm, edited 1 time in total.
As it is apparently board policy to disallow any criticism of anything, as it appears to criticise something is to criticise all the users of that something, I will no longer be commenting in threads which are not directly relevant to my uses of the Pi.
Re: Have I missed something...
Just used the quickstart instructions to build the SDK on my Linux laptop. It complained at the end about some missing packages.
Anyhow cmake works from the command line and my LED blinks much faster now!
Code: Select all
The following packages have unmet dependencies.
code:armhf : Depends: libnss3:armhf (>= 2:3.26) but it is not installable
Depends: apt:armhf but it is not installable
Depends: libxkbfile1:armhf but it is not installable
Depends: libsecret-1-0:armhf but it is not installable
Depends: libgtk-3-0:armhf (>= 3.10.0) but it is not installable
Depends: libxss1:armhf but it is not installable
Depends: libgbm1:armhf but it is not installable
E: Unable to correct problems, you have held broken packages.
Re: Have I missed something...
Both would restart the Pico when brought low.
TP6 is the BOOTSET, holding that and pin 30 low, then releasing TP6 shortly after releasing pin30 should have the desired effect.
Last edited by BMS Doug on Sun Jan 24, 2021 9:17 am, edited 1 time in total.
Doug.
Building Management Systems Engineer.
Building Management Systems Engineer.
Re: Have I missed something...
TP4 changes the regulator between Pulse Width and Frequency control to provide best efficiency, it does not turn off the 3V3 supply.
I seems several people have now worked out that the boot/load process is a weak point and are looking at similar solutions.
PeterO
I seems several people have now worked out that the boot/load process is a weak point and are looking at similar solutions.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
It's not likely to bother me much, I only started looking at it out of academic interest, because people were asking.
Seems like they thought about it during design and provided both hardware (TP6) and software solution options.
Very nice piece of engineering.
Doug.
Building Management Systems Engineer.
Building Management Systems Engineer.
Re: Have I missed something...
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Have I missed something...
Fair enough.
But to return to your original question in this thread:
No, the pico can be readied for new code by either software or hardware.PeterO wrote: Do you really have to replug the USB every time to reload your code ?
PeterO
Your software would need to be compiled with PICO_ENTER_USB_BOOT_ON_EXIT then a condition that ends the main loop will set the Pico back, ready to load new software.
A hardware solution would be to reset the Pico by pulling the run pin (pin 30) low and either hold the BOOTSET button down when releasing pin 30 or pulling down TP6 until after pin 30 is released.
Having a single physical button that sets the Pico into a Boot ready mode would risk occasional accidental boot conditions, something that would receive a lot of criticism I'm sure.
Software solution, hardware solution.
All that is lacking is the clarity of documentation (which I'm sure will improve).
It's not always easy to remember that the other person doesn't know it already when writing documentation, so stuff does get missed, or need a re-write to clarify.
Doug.
Building Management Systems Engineer.
Building Management Systems Engineer.
Re: Have I missed something...
I just pull the USB plug at the laptop end.
-
- Posts: 2888
- Joined: Sat Aug 18, 2012 2:33 pm
Re: Have I missed something...
the usb ports on my desktop have been getting a bit loose lately, they still work but i can feel the wear
to avoid making things worse, ive taken the reset switch out of an old x86 pc case, and plugged it into the RUN header on my pi0, so i can just hard-reset it with a simple button
the RP2040 datasheet says it also has a RUN pin, so its just a matter of knowing which TP or pin its routed to
edit:
ah, and there it is, pin 30 on the main set of pins
Last edited by cleverca22 on Sun Jan 24, 2021 11:50 am, edited 1 time in total.
Re: Have I missed something...
cleverca22 wrote: ↑Sun Jan 24, 2021 11:45 amthe usb ports on my desktop have been getting a bit loose lately, they still work but i can feel the wear
to avoid making things worse, ive taken the reset switch out of an old x86 pc case, and plugged it into the RUN header on my pi0, so i can just hard-reset it with a simple button
the RP2040 datasheet says it also has a RUN pin, so its just a matter of knowing which TP or pin its routed to
" its just a matter of knowing which TP or pin its routed to"
From earlier in this same thread... viewtopic.php?f=144&t=299746#p1801991