When you receive your Meadow board, it will need to have the latest Meadow.OS uploaded, or flashed, to it.

Go to the instructions for your development system

  1. Windows
  2. macOS
  3. Linux (Debian, Ubuntu)

Windows

Install .NET SDK

Download and install the latest .NET 6 SDK.

Install or update Meadow CLI

To install Meadow CLI, execute the following command in your console:

dotnet tool install WildernessLabs.Meadow.CLI --global

To update Meadow CLI, if already installed, execute the following command in your console:

dotnet tool update WildernessLabs.Meadow.CLI --global

Install dfu-util

From a console with admin rights, execute following command:

meadow install dfu-util

Update USB driver for ST devices

In order to flash Meadow OS, dfu-util is recommended. However, the default Windows USB driver for ST devices is not compatible with dfu-util, so it needs to be replaced. For more in-depth information on this, check out Scott Hanselman’s post.

  1. Download and run Zadig
  2. Connect a Meadow device in bootloader mode
  3. In Zadig, click Options > List All Devices
  4. Select STM32 BOOTLOADER in the dropdown
  5. Click Replace Driver

    Zadig showing STM32 Bootloader device selected and WinUSB driver chosen with a Replace Driver button.
    Zadig showing STM32 Bootloader device selected and WinUSB driver chosen with a Replace Driver button.
  6. After the installation is complete, driver should be WinUSB

    Zadig showing the replaced driver as WinUSB with a Reinstall Driver button.
    Zadig showing the replaced driver as WinUSB with a Reinstall Driver button.

Download Meadow OS and network binaries

Execute the following command in your console:

meadow download os

Put the device into DFU Bootloader mode.

To update the OS, Meadow must be in DFU bootloader mode. To enter this mode, the BOOT button needs to be held down while the board boots up. This can be accomplished one of two ways.

If the board is disconnected: hold the BOOT button down and connect the board to your computer via a Micro USB Cable.

If the board is connected: hold the BOOT button down, and then press and release the RST (Reset) button. Then release the BOOT button.

Meadow board with boot button labeled at the end of the header on the battery JST side of the board.

Flash Meadow.OS and Coprocessor Firmware

Now you have two options, please try option 1 first:

Option 1 (from bootloader mode)

Once connected the Meadow device via the USB cable and having put the device into DFU Bootloader mode, execute the following command in your console:

meadow flash os

Option 2 (from normal mode)

This following will only work if you have a newer version of Meadow OS installed. It is recommended to try option 1 first. Reset the device (push the RST button or disconnect and reconnect) and identify the serial port name that the Meadow is connecting on.

  • Open Device Manager; the Meadow device should show up as USB Serial Device [COMXX]:

Screenshot of Device Manager Ports section expanded showing the Meadow as USB Serial Device on port COM5.

Once you’ve identified the port name, run the following command in your console replacing [PORT] with the serial port name:

meadow flash os -s [PORT]

NOTE: If the process hangs on Opening port ‘[PORT]’…, hit the RST button on the device.

Unplug and reconnect the Meadow board to give it a full restart. Your board is now ready to have a Meadow application deployed to it!

macOS

Install .NET SDK

Download and install the latest .NET 6 SDK for your Mac’s processor architecture.

Even if you are working on an ARM-based computer, such as Apple M1, M1 Pro, or M2 CPUs, you should still install the x86 version of the .NET SDK.

Install or update Meadow CLI

To install Meadow CLI, execute the following command in your terminal:

dotnet tool install WildernessLabs.Meadow.CLI --global

To update Meadow CLI, if already installed, execute the following command in your terminal:

dotnet tool update WildernessLabs.Meadow.CLI --global

Install dfu-util

To install dfu-util, we’ll be using Homebrew. If you don’t have it yet, install Homebrew first.

Execute the following command in your terminal:

brew install dfu-util

Download Meadow OS and network binaries

Execute the following command in your terminal:

meadow download os

NOTE: If the meadow command returns an error: command not found:

If your terminal cannot find the meadow command, it means the .NET SDK didn’t add the global tool installation location to your shell’s PATH variable. Run the following command to add that location to your PATH variable so your terminal knows where to find the meadow command. Then run the OS download command from above one more time.

export PATH="$PATH:$HOME/.dotnet/tools"

Put the device into DFU Bootloader mode.

To update the OS, Meadow must be in DFU bootloader mode. To enter this mode, the BOOT button needs to be held down while the board boots up. This can be accomplished one of two ways.

If the board is disconnected: hold the BOOT button down and connect the board to your computer via a Micro USB Cable.

If the board is connected: hold the BOOT button down, and then press and release the RST (Reset) button. Then release the BOOT button.

Meadow board with boot button labeled at the end of the header on the battery JST side of the board.

Flash Meadow.OS and Coprocessor Firmware

Now you have two options, please try the option 1 first:

Option 1 (from bootloader mode)

Once connected the Meadow device via the USB cable and having put the device into DFU Bootloader mode, execute the following command in your terminal:

meadow flash os

Option 2 (from normal mode)

This following will only work if you have a newer version of Meadow OS installed. It is recommended to try option 1 first. Reset the device (push the RST button or disconnect and reconnect) and identify the serial port name that the Meadow is connecting on.

Execute the following command in your terminal:

ls /dev/tty.usb*

The port should be something like /dev/tty.usbmodem01. Once you’ve identified the port name, run the following command in your console replacing [PORT] with the serial port name:

meadow flash os -s [PORT]

NOTE: If the process hangs on Opening port ‘[PORT]’…, hit the RST button on the device.

Unplug and replug Meadow to give it a full restart. Your board is now ready to have a Meadow application deployed to it!

Linux (Debian, Ubuntu)

Please note: Linux may require sudo to access USB devices.

Install .NET SDK

Download and install the latest .NET 6 SDK.

Install or update Meadow CLI

To install Meadow CLI, execute the following command in your terminal:

dotnet tool install WildernessLabs.Meadow.CLI --global

To update Meadow CLI, if already installed, execute the following command in your terminal:

dotnet tool update WildernessLabs.Meadow.CLI --global

Install dfu-util

Execute the following command in your terminal:

sudo apt-get install dfu-util

Install libusb

Execute the following command in your terminal:

sudo apt-get install libusb-1.0-0-dev

Download Meadow OS and network binaries

Execute the following command in your terminal:

meadow download os

Put the device into DFU Bootloader mode.

To update the OS, Meadow must be in DFU bootloader mode. To enter this mode, the BOOT button needs to be held down while the board boots up. This can be accomplished one of two ways.

If the board is disconnected: hold the BOOT button down and connect the board to your computer via a Micro USB Cable.

If the board is connected: hold the BOOT button down, and then press and release the RST (Reset) button. Then release the BOOT button.

Meadow board with boot button labeled at the end of the header on the battery JST side of the board.

Enable access to the device

To be able to access the device a udev rule needs to be added.

  • Go to the folder /etc/udev/rules.d
  • Create the file 50-meadow.rules
  • Add the following to the file:
SUBSYSTEM=="usb", ATTR{idProduct}=="df11", ATTR{idVendor}=="0483", MODE="0666", GROUP="user", TAG+="uaccess"

To verify the Product ID and Vendor ID execute the following command in your terminal:

lsusb

You should be able to find a entry similar to the following:

Bus 001 Device 009: ID 0483:df11 STMicroelectronics STM Device in DFU Mode

The format for the IDs is idVendor:idProduct. Please note that you need to disconnect and reconnect the Meadow to make the rules take affect.

Flash Meadow.OS and Coprocessor Firmware

Now you have two options, please try the option 1 first:

Option 1 (from bootloader mode)

Once connected the Meadow device via the USB cable and having put the device into DFU Bootloader mode, execute the following command in your terminal:

meadow flash os

Option 2 (from normal mode)

This following will only work if you have a newer version of Meadow OS installed. It is recommended to try option 1 first. Reset the device (push the RST button or disconnect and reconnect) and identify the serial port name that the Meadow is connecting on.

To get access to the port your user needs to be added to the group dialout.
This is done with the command:

sudo adduser {your_user} dialout

Replace {your_user} with the user name. You need to logout and login again to make the changes affect.

To find the Port where the Meadow is connected execute the following command in your terminal:

ls -l /dev

look for

ttyAMC0

or similar. The port might change between reboots of the Meadow so make sure to check it after a reboot. If you can’t detect which port the meadow belongs to run the command once with the Meadow disconnected and once with the Meadow connected to spot the difference.

Once you’ve identified the port name, run the following command in your console replacing [PORT] with the serial port name:

meadow flash os -s [PORT]

NOTE: If the process hangs on Opening port ‘[PORT]’…, hit the RST button on the device.

Unplug and replug Meadow to give it a full restart. Your board is now ready to have a Meadow application deployed to it!

Next - Hello, Meadow

 


These docs are open source. If you find an issue, please file a bug, or send us a pull request. And if you want to contribute, we'd love that too!