Try โ€‚โ€‰HackMD

Part 1: Update Firmware on Raspberry Pi Pico W

tags: TA Stuff RP2 Raspberry Pi Pico

In this tutorial, we walk you through the hardware configuration, so you are up and running for your journey in IoT. If you own a Raspberry Pi Pico W Board you should follow this tutorial.

This microcontroller goes also by the name of "RP2" or "RP2040"

You will:

  • Download and update the board micropython firmware
  • Try some test code to confirm everything is set properly

We'll continuously update this walkthrough. Is there anything that needs to be clarified, or have you experienced some issues? Please add a comment. You do this by highlighting the text and then you can write a comment on the highlighted part. You need to log in/create an account on HackMD first.

0. Prerequisites

  • You should be finished with the IDE installation tutorial before proceeding with this tutorial.
  • Have your Raspberry Pi Pico board ready
  • USB Cable

Make sure the USB cable has four pins and is capable of data transferring. If you get the bundle with cable it will be supported

1. Firmware update

Follow these steps:

  • Step 1: Remove the ESD sponge from the Pico before proceeding. (The black sponge attached under your pico).

  • Step 2: Download the micropython firmware from this website. You will get a uf2 file, be sure to download the latest one from the Releases category and not Nightly Builds.

  • Step 3: Connect the micro-usb end of your cable (the small side) into the Raspberry Pi Pico, be sure to firmly hold the back of the USB slot so that by pushing you will not bend it. The USB won't have to be entered fully, it's normal that a small gap will be left out from the slot.

  • Step 4: While holding the BOOTSEL key down on the board, connect the USB type A end of your cable (the big side) into your computer's USB port. If you want to be extra safe avoid using a USB hub and prefer the ports on your desktop/laptop computer. You can release the BOOTSEL after connecting it to your computer.

  • Step 5: You will see a new drive open in your file system named RPI-RP2 which is the Raspbbery Pi Pico storage. You can copy/paste the uf2 in this storage.

  • Step 6: Wait until your board automatically disconnects from your computer (new drives disappear).

  • Step 7: To confirm the board is ready, please unplug and plug back the USB cable.

Do not disconnect the device from your computer during firmware installation. It may cause firmware damages and you will have to redo the above steps.

Extra Step

You will have to do this step exclusively if you are currently operating on a Linux machine. If you are using Windows or MacOS please proceed to the next step now, ignoring this one.

  • If you are on a Debian/Fedora based operating system enter this command into your favorite terminal emulator:
sudo usermod -a -G dialout $USER
  • If you are on an Arch based operating system enter this command into your favorite terminal emulator:
sudo usermod -a -G uucp $USER

You will need to reboot your machine before you can continue with the next steps.

2. Testing the board

Be sure you have properly installed an IDE before proceeding on this step, following this guide if you want to use VSCode and this guide if you want to use Thonny instead.

Thonny

  • Step 1: Input the following string in the shell after the >>> symbols
print("Good luck with your studies, from LNU!")
  • Step 2: You should have the same text responded back to you from the connected board like in the picture below:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

Visual Studio Code

  • Step 1: Open up VSCode and open the Pymakr extension in the left bar

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

  • Step 2: Plug in your Raspberry Pico W while taking a look at the list of devices. The new device that pops up will be the Pico.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

  • Step 3: Hover your mouse over the device and press the lightning button to connect the Pico.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

  • Step 4: After the board is connected, hover over the device again and now press the terminal button to upen up a terminal.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

  • Step 5: Input the following string in the shell after the >>> symbols
print("Good luck with your studies, from LNU!")
  • Step 6: You should have the same text responded back to you from the connected board like in the picture below:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

You are now successfully finished Part 2 of four part tutorial, It is a good idea to read more about MicroPython Tutorials and Examples from Raspberry Pi Documentation (here) and try different code to learn more.
Good Luck!

3. Troubleshooting

Be sure to have a copy of your project saved on your computer before proceeding!

Follow this part if your device is stuck and there is no other way to recover it.

According to the Raspberry Pi team there is no way to brick this board through software alone, that's because no matter what you will always be able to reset it back by following the procedure described before. In case you think your board is stuck please follow the procedure for firmware update linked below, but instead of the usual firmware from before, you should use this one instead. This will ensure that the memory will be completely erased.

After this, you may proceed from step 1 to flash the firmware again.

You are now ready to move to the next tutorial (here) to get familiar with terms and project structure.