Friday, April 11, 2025

Repair a defective bootselector switch on a Raspberry Pi Pico

For an index to all my stories click this text

I wanted to install the latest version of MicroPython on a Raspberry Pi Pico W when disaster struck. The bootselector switch broke.



This is how the bootselector normally looks



This is how mine looked.

The bootselector switch is the switch you have to press, and connect USB at the same time, to get the Pico in a state where you can upload new firmware. No bootselector: no new firmware !!! So this is a rather important switch.

So I wanted a solution and started looking at the Raspberry Pi forum. It seems that a couple of guys had the same problem. But they offered no solution.

Then I turned to the Pico's datasheet. Everyone seems to see manuals and datasheets as a last resort, but it should be the first......... Here is a link to the datasheet: https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf

 

At the bottom side of the Pico there are several contacts. TP4 TP5 and TP6.



And the datasheet shows that TP6 is the contact to the bootselector switch.



And this is how it looks in the real world. So the solution is easy. Solder a wire to TP6.



The TP6 pad is large enough to solder with a normal soldering iron with a small tip.

And yes: I am a sloppy solderer and the wire is too long.

The easy way is to start with putting some solder on TP6. Then put some solder on your wire. Then solder the wire to TP6.

When all your projects are breadboard based sacrifice a dupond wire for this. I used a simple flexible wire so I can use that on a breadboard but also solder it to a pushbutton when needed.

To get the Pico in bootselector mode just connect the wire to GND and plug in your USB cable. Then disconnect the wire and you can upload the new firmware.

Till next time
have fun


Luc Volders







Friday, April 4, 2025

Linux webserial and webusb problem

For an index to all my stories click this text.

Lately I have been looking into web-based programs that allow to program a Raspberry Pi Pico or ESP32. There are two block-programming based programs called Ioty and Bipes. They work a bit like MIT's App Inventor.

Another thing I have been looking at is Viper Ide. This is an editor for MicroPython programs. I normally use Thonny for creating programs in MicroPython. Thonny is a program that you download onto your computer and then run it. Just like all regular programs.

Viper IDE runs in your browser. You do not need to download anything. Just point your browser to https://viper-ide.org/ and start programming.

This all sounds fine, however I ran into a problem with these web-programs.

Webserial and Webusb

At one time or another you need to connect your microcontroller to your computer with a USB connection. This is to transfer the program from your computer to the microcontroller. And to use USB from your browser, the browser must be able to use Webserial or Webusb. So you can not use Firefox. Chrome does the job.

I am not running a Windows computer (anymore), my system runs Linux. So there is no Chrome browser but there is a derivative called Chromium.


And there I was stuck. Viper IDE told me that it wanted to connect but no compatible devices were found.
As Thonny operated flawless I knew there was nothing wrong with my USB ports. So there must be something wrong with the communication between the webbrowser and the microcontroller.

Safety first

Linux is an operating system that focuses on safety and user rights. Users can not access files, folders and ports without first getting the rights to access them from the administrator (root). And then root can grant access to only read or read and write. This may seem like an annoyance but it makes sure that nobody can get to your data, or delete it, without explicit permission.

And that is what here is the case. We have to grant the webbrowser access to the USB ports. That can be done as follows:


sudo snap connect chromium: raw-usb

This is the command for Kubuntu. Kubuntu is based on Debian so, I presume, this will work on  most Debian derivative distributions.

It works

And now it works.


Chromium lists all USB ports and the Raspberry Pico was the first listed,

Play it safe

Although Linux is a really safe operating system it is always better to be safe then sorry. A lot of hackers are around who want to do nasty things on your machine. So what I do is to disconnect the USB port from the web-browser when I am done programming. The command for that is:

sudo snap connect chromium: raw-usb

That's all for now
Till next time


Luc Volders