|
| 1 | +--- |
| 2 | +title: Board Installation |
| 3 | +description: A list of Arduino boards compatible with MicroPython and how to install them. |
| 4 | +author: Francesca Sanfilippo, Karl Söderby & Jacob Hylén |
| 5 | +micropython_type: basics |
| 6 | +featured: micropython |
| 7 | +hero_image: "./hero-banner.png" |
| 8 | +--- |
| 9 | + |
| 10 | +So what do you need to start your first project with MicroPython and Arduino? First, you will need a compatible board. In this page, you will find the compatible boards, with instructions on how to install them. |
| 11 | + |
| 12 | +In order to understand which board is more suitable to your project, you can visit the documentation of each board. |
| 13 | + |
| 14 | +## Nano 33 BLE & Nano 33 BLE Sense |
| 15 | + |
| 16 | +- [Nano 33 BLE documentation](/hardware/nano-ble). |
| 17 | +- [Nano 33 BLE Sense documentation.](/hardware/nano-ble-sense) |
| 18 | +- [Nano 33 BLE Sense Rev2 documentation.](/hardware/nano-ble-sense-rev2) |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +The process for flashing the firmware on the Nano 33 BLE requires to first update the bootloader and SoftDevice. Once this is done you can flash the MicroPython firmware to your board. |
| 23 | + |
| 24 | +This process requires a version of the [Arduino IDE](https://www.arduino.cc/en/main/software) installed, which is explained in the next step. |
| 25 | + |
| 26 | +**Step 1: Installing the Core** |
| 27 | + |
| 28 | +Start by making sure that you have the respective core installed. Open the **Arduino IDE** (not Arduino Lab for MicroPython) and navigate to the boards manager. Search for your board (Nano 33 BLE), and make sure you have the latest version of the core installed. More detailed information about this step can be found [here](/software/ide-v2/tutorials/ide-v2-board-manager). |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +This is not only needed to upload the next sketch, but you're also going to dive into the core files themselves to find a specific tool in an upcoming step. |
| 33 | + |
| 34 | +**Step 2: Update Bootloader** |
| 35 | + |
| 36 | +In the Nano 33 BLE core is an example sketch that you will use to update the bootloader and SoftDevice of your board. Go back to the Arduino IDE and navigate to `File > Examples > Nano33BLE_System > Nano33_updateBLandSoftDevice` and open the sketch. |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +Upload the sketch to your board. Beware! the bootloader is not updated just yet! Once the sketch is uploaded, you can interface with your board through the serial monitor to actually update the bootloader. |
| 41 | + |
| 42 | +In the Serial monitor, you are asked to confirm that you want to update the bootloader. In the message text box in the top of the serial monitor, write a **"y"** and press enter to send it to your board. |
| 43 | + |
| 44 | +You can now watch as the bootloader update process progresses, **do not disconnect or reset your board during this process** or you could brick your board. |
| 45 | + |
| 46 | +Once this bar completes, you will be prompted with another choice. This time it asks if you want to update the SoftDevice on your board. Repeat the process of sending a **"y"** to the board, and watch the progress of this too. |
| 47 | + |
| 48 | +When this bar fills and the SoftDevice update completes, the board will restart, and you've successfully made it through the procedure. |
| 49 | + |
| 50 | +***Note: An important thing to do at this point which is easily forgotten is to close the serial monitor, we will need to use the serial port for other things very soon and if you leave the monitor open it will be busy and won't be able to receive any new interactions.*** |
| 51 | + |
| 52 | +**Step 3: Download Firmware** |
| 53 | + |
| 54 | +Now you will need to find the specific firmware that you need to flash to your board. You can find the available firmware on the [MicroPython](/micropython) Documentation site. |
| 55 | + |
| 56 | +Download the `.bin` file that corresponds to the board you have. |
| 57 | + |
| 58 | +Now you will need to dive into the core files you downloaded in the first step to find a command line tool that is included called BOSSAC. This process will be different for you depending on if you're on a Windows or MacOS computer. |
| 59 | + |
| 60 | + |
| 61 | +**Step 4a: Flash Firmware (Windows)** |
| 62 | + |
| 63 | +>Instructions for MacOS are available just below this section. |
| 64 | +
|
| 65 | +The file you will is named `bossac.exe` and can be found in the following directory: |
| 66 | + |
| 67 | +``` |
| 68 | +C:\Users\[your-username]\AppData\Local\Arduino15\staging\packages\bossac-1.9.1-arduino2-windows.tar.gz\bossac-1.9.1-arduino2-windows.tar\bin\` |
| 69 | +``` |
| 70 | + |
| 71 | +One you've found the file, extract it from the `.tar` archive and copy it somewhere else, your desktop for example. |
| 72 | + |
| 73 | +Open a command terminal and start typing in `start`, now drag and drop the bossac.exe file you've found into the terminal, and press enter. |
| 74 | + |
| 75 | +If successful, another command terminal window should open in which you are able to execute the command that will flash your board with the MicroPython firmware. |
| 76 | + |
| 77 | +Execute the following command, but replace the port with the name of the port where your board is connected, and the firmware file with the directory where you have placed the firmware you downloaded previously: |
| 78 | + |
| 79 | +``` |
| 80 | +bossac -e -w --offset=0x16000 --port=[port] -i -d -U -R [firmware] |
| 81 | +``` |
| 82 | + |
| 83 | +Don't disconnect or power off your board during this part of the process, watch the progress of flashing the firmware to your board. Once complete, you're all set and you're ready to start programming the board in MicroPython. |
| 84 | + |
| 85 | +Go to the Arduino Lab MicroPython IDE and press connect in the top left, choose the port, and you are now ready to program your Nano 33 BLE. |
| 86 | + |
| 87 | +**Step 4b: Flash Firmware (MacOS)** |
| 88 | + |
| 89 | +The file you will need to access is called `bossac` and can be found in the following directory: |
| 90 | + |
| 91 | +``` |
| 92 | +Users/[your-user]/Library/Arduino15/packages/arduino/tools/bossac/1.9.1-arduino2 |
| 93 | +``` |
| 94 | + |
| 95 | +***Note: The `"Library"` directory is hidden, press `Shift + Command + . ` to reveal hidden directories.*** |
| 96 | + |
| 97 | +Open a terminal window and drag and drop the `bossac` file into the terminal window. |
| 98 | + |
| 99 | +Now, you should be able to execute the command that will flash your board with the MicroPython firmware. |
| 100 | + |
| 101 | +Execute the following command, but replace the port with the name of the port where your board is connected, and the firmware file with the directory where you have placed the firmware you downloaded previously: |
| 102 | + |
| 103 | +``` |
| 104 | +bossac -e -w --offset=0x16000 --port=[port] -i -d -U -R [firmware] |
| 105 | +``` |
| 106 | + |
| 107 | +Again, don't disconnect or power off your board during this part of the process, watch the progress of flashing the firmware to your board. Once complete, you're all set and you're ready to start programming the board in MicroPython. |
| 108 | + |
| 109 | +Go to the Arduino Lab MicroPython IDE and press connect in the top left, choose the port, and you are now ready to program your Nano 33 BLE! |
| 110 | + |
| 111 | +## Nano RP2040 Connect |
| 112 | + |
| 113 | +- [Arduino Nano RP2040 Documentation](https://docs.arduino.cc/hardware/nano-rp2040-connect) |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +To program your Nano RP2040 Connect board with MicroPython, follow the instructions below. The installation for Nano RP2040 Connect requires no additional software tools for installation. |
| 118 | + |
| 119 | +Follow the steps below to install MicroPython on the Nano RP2040 Connect board. |
| 120 | + |
| 121 | +1. Download the `.uf2` firmware file from the [MicroPython](/micropython) page. |
| 122 | +2. Connect the `REC` pin to `GND` (they are placed next to each other) and press the reset button. This exposes the board's file system to your computer. |
| 123 | +3. Drag and drop the firmware file onto the boards flash storage which shows up as an external storage device on your computer |
| 124 | +4. Go to the Arduino Lab MicroPython IDE and press connect in the top left, choose the port. |
| 125 | + |
| 126 | +Congratulations, you are now ready to program your Nano RP2040 Connect with MicroPython. |
| 127 | + |
| 128 | +## GIGA R1 WiFi |
| 129 | + |
| 130 | +- [Arduino GIGA R1 WiFi documentation](/hardware/giga-r1-wifi) |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +The installation instructions for the **GIGA R1 WiFi** is identical to the **Portenta H7** instructions found just below. |
| 135 | + |
| 136 | +You will however need a different firmware, which you can download from the link below: |
| 137 | + |
| 138 | +- [Download GIGA R1 WiFi MicroPython firmware (dfu)](/resources/firmware/GIGAR1_MP_FW.dfu) |
| 139 | + |
| 140 | +***The GIGA R1 WiFi and Portenta H7 boards are based on the same microcontroller, [STM32H747XI](static/resources/datasheets/stm32h747xi.pdf) and therefore share the same installation instructions.*** |
| 141 | + |
| 142 | +## Portenta H7 |
| 143 | + |
| 144 | +- [Arduino Portenta H7 Documentation](https://docs.arduino.cc/hardware/portenta-h7) |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | +To install MicroPython on the Portenta H7 you will first need to install the corresponding core which also installs the required command line tool, called `dfu-util`. |
| 149 | + |
| 150 | +This tool can be used to directly flash a binary to your board, in this case, a MicroPython build. |
| 151 | + |
| 152 | +***The instructions below uses the `dfu-util` that is bundled with the Arduino IDE. You can also obtain the `dfu-util` directly, through the [dfu-util home page](https://dfu-util.sourceforge.net/) or via package management systems such as [Homebrew](https://formulae.brew.sh/formula/dfu-util) (MacOS / Linux).*** |
| 153 | + |
| 154 | +**Step 1: Install Arduino IDE** |
| 155 | + |
| 156 | +First, download and install the [Arduino IDE](https://arduino.cc/en/software) for your operating system. |
| 157 | + |
| 158 | +Open the Arduino IDE (not Arduino Lab for MicroPython) and navigate to the boards manager. Search for "Portenta H7", and make sure you have the latest version of the core installed. |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | +**Step 2: Download Firmware** |
| 163 | + |
| 164 | +Now you will need to find the specific firmware that you need to flash to your board. You can find the available firmware on the [MicroPython with Arduino](https://docs.arduino.cc/micropython/) home page. The firmware is available as a `.dfu` file for the Portenta H7. |
| 165 | + |
| 166 | +In the next step you will be diving into the core files you downloaded in the first step to find a command line tool called **dfu-util**. This process is differs depending on if you're on a Windows or MacOS computer. MacOS instructions are available further below. |
| 167 | + |
| 168 | +**Step 3a: Install Firmware (Windows)** |
| 169 | + |
| 170 | +To flash your board, you will need a file named `dfu-util.exe`. This is found in your following directory: |
| 171 | + |
| 172 | +``` |
| 173 | +C:\Users\<your-username>\AppData\Local\Arduino15\staging\packages\dfu-util-0.10.0-arduino1-windows.tar.bz2\dfu-util-0.10.0-arduino1-windows.tar\windows\ |
| 174 | +``` |
| 175 | + |
| 176 | +One you've found the file, extract it from the .tar archive and copy it somewhere else, your desktop for example. |
| 177 | + |
| 178 | +Open a command terminal and start typing in `start`, now drag and drop the dfu-util.exe file you've found into the terminal, and press enter. |
| 179 | + |
| 180 | +If successful, another command terminal window should open in which you are able to execute the command that will flash your board with the MicroPython firmware. |
| 181 | + |
| 182 | +Double tap the reset button on your board to put it in DFU mode, and execute the following command, but replace the path of the firmware file with the directory where you have placed the firmware you downloaded previously: |
| 183 | + |
| 184 | +``` |
| 185 | +dfu-util -a 0 -d 0x2341:0x035b -D <firmware>.dfu |
| 186 | +``` |
| 187 | + |
| 188 | +Again, don't disconnect or power off your board during this part of the process, watch the progress of flashing the firmware to your board. |
| 189 | + |
| 190 | +You should now see **two** progress bars appear in one after the other. The first one is showing the progress of erasing the firmware that was previously on the board, and the second one is showing the progress of flashing the new firmware. |
| 191 | + |
| 192 | +Once complete, you're all set and you're ready to start programming the board in MicroPython. |
| 193 | + |
| 194 | +Go to the Arduino Lab MicroPython IDE and press connect in the top left, choose the port, and code away! |
| 195 | + |
| 196 | +**Step 3b: Install Firmware (MacOS)** |
| 197 | + |
| 198 | +The file you will need to access is named `dfu-util` and can be found in the following directory: |
| 199 | + |
| 200 | +``` |
| 201 | +Users/[your-username]/Library/Arduino15/packages/arduino/tools/dfu-util/0.10.0-arduino1/dfu-util |
| 202 | +``` |
| 203 | + |
| 204 | +***Note: The `"Library"` directory is hidden, press `Shift + Command + . ` to reveal hidden directories.*** |
| 205 | + |
| 206 | +Open a terminal window and drag and drop the dfu-util file into the terminal window. |
| 207 | + |
| 208 | +Now, you should be able to execute the command that will flash your board with the MicroPython firmware. |
| 209 | + |
| 210 | +Double tap the reset button on your board to put it in DFU mode, and execute the following command, but replace the path of the firmware file with the directory where you have placed the firmware you downloaded previously: |
| 211 | + |
| 212 | +``` |
| 213 | +dfu-util -a 0 -d 0x2341:0x035b -D <firmware>.dfu |
| 214 | +``` |
| 215 | + |
| 216 | +Do not disconnect your board during this part of the process, watch the progress of flashing the firmware to your board. |
| 217 | + |
| 218 | +Once complete, you're all set and you're ready to start programming the board in MicroPython. |
| 219 | + |
| 220 | +Go to the Arduino Lab MicroPython IDE and press connect in the top left corner, choose the port and you are ready to load scripts to your board. |
0 commit comments