-
Notifications
You must be signed in to change notification settings - Fork 1
Setting Up Raspberry Pi OS for MPRemote Visual Studio Code
This page details the steps for setting up a Raspberry Pi board for MicroPython development using Visual Studio Code and the MPRemote VS Code extension. Some knowledge of Raspberry Pi is assumed, but most steps should have plenty of detail for the first time user. The steps are geared toward reusing older generations of donated Raspberry Pi hardware. The procedure is tested on a 32-bit Raspberry Pi 2 with 1G of RAM.
This step will require the following:
- A PC or Mac with a Micro SD card slot (or appropriate adapter.)
- Access to the internet for downloading.
You may skip this step if this isn't the first time you're flashing a Micro SD card with Raspberry Pi OS.
- Visit https://www.raspberrypi.com/software/ to download the version of the tool for your operating system.
- Install the tool by double-clicking the installer file.
- To run the tool, find Raspberry Pi Imager in the list of installed applications for your PC.
If this is your first time using Raspberry Pi Imager, learn more about it by reading and watching the short video on the Raspberry Pi Imager announcement page. Keep in mind there have been improvements made to the tool since the vdeo, so things will look slightly different. This differences will be highlighted in the procedure below.
There are three things you must choose to create a Micro SD card for use with your Raspberry Pi. There is also a fourth grouping of options that will pre-configure the system for you.
- Choose the Raspberry Pi device. Because there are several generations of Raspberry Pi, it's important to get this right.
- Choose an Operating System. In all cases, you will want Raspberry Pi OS. 32-bit or 64-bit depends on the generation of Raspberry Pi hardware.
- Choose the storage device. This is the easiest step. It is the Micro SD card on your system and is often the only device in the list.
- Choose additional configuration options. Press CTRL + SHIFT + X to bring up the super secret options page. Visit each tab and fill in as appropriate.
If a picture is worth a thousand words, this section is money in the bank. These screenshots give some examples of what to expect while using the Raspberry Pi Imager. Choices shown are for the older Raspberry Pi 2 hardware. If you're using a 2nd generation Pi 3 or later, you'll want to select a 64-bit OS.
If this isn't your first time using Raspberry Pi Imager, go ahead and scroll past the pictures to the section entitled Booting Your Raspberry Pi.

Figure 1: Finding the app (Windows OS example)

Figure 2: Raspberry Pi Imager started up and awaiting your choices

Figure 3: Choosing a device of Raspberry Pi 2

Figure 4: Choosing a 32-bit OS for Raspbery Pi 2

Figure 5: Choosing the Micro SD card

Figure 6: The General tab of customization (CTRL + SHIFT + X)

Figure 7: The Services tab for enabling Secure Shell (SSH) connections if desired

Figure 8: Default options showing the Micro SD will be ejected when writing is finished

Figure 9: Raspberry Pi Imager writing after all options have been selected
After writing the Raspberry Pi OS image, you can remove the Micro SD card from your PC and insert it into the slot on the Raspberry Pi.
- Ensure the Raspberry Pi is not plugged into power.
- Insert the Micro SD card into the slot taking care to orient it the correct way.
- Attach an HDMI monitor with the appropriate cable for your device (standard or micro HDMI).
- Plug in an appropriate power supply for your device (Official Raspberry Pi or Canakit power supplies are a good choice.)
- Watch the monitor for signs of life.
Booting could take several minutes the first time. If you see a Raspberry Pi Desktop logo on the monitor, things are moving in the right direction. Just be patient.
Staying current on Operating System updates is key to maintaining a stable and secure environment. This step shows how to update Raspberry Pi OS using command-line tools. This can either be done by opening a command prompt from the Raspberry Pi Desktop or you can use Secure Shell (SSH) from a remote machine to do this.
The first update will take some time. After the first update, establish a habit of weekly updates. This will not only keep you secure, it will shorten the time required for each update.
- Open a command prompt (either from the desktop or using SSH.)
- Update the list of available software with
sudo apt-get update - Install any available upgrades with
sudo apt-get upgrade - Reboot the system when finished.
A successful update will look like the following example, though much of the output has been trimmed for brevity.
$ sudo apt-get update
Reading package lists... Done
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
Do you want to continue? [Y/n] y
$ sudo shutdown -r now