How to do a full stack Meadow update

In this post shows you how I performs a full stack update, meaning updates for the Meadow.CLI, Meadow.OS binaries, Visual Studio extensions, and Meadow.Foundation drivers and updates. Check out our Release Notes to see all the latest changes in every beta release.

Updating your Meadow board

As I’ve seen numerous ways folks update their Meadow boards, I’m breaking it down in this step-by-step guide showing the way I do it and its proven to be most reliable to me, and I do hope you get similar results when following along. This guide is focused to Windows users, but macOS users can also follow along running the same Meadow.CLI commands.

Meadow Pre-requisite (Windows)

To ensure that your board is in a good state to flash it with the latest and greatest, when connecting it in bootloader mode (connecting the board while holding the BOOT button), it should show up as STM32 BOOTLOADER under the Universal Serial Bus devices, when connecting it normally it should show up as a USB Serial Device (COMX) under the Ports (COM & LPT) section section in the Device Manager.

If your board appears as Meadow F7 Micro (COMX) in regular mode, right-click on it and select Uninstall Device, and make sure to select Attempt to remove the driver for this device.

Once its done, connect your board in bootloader mode again, and run the Zadig Tool. Click on Options->List All Devices, and you should see STM32 BOOTLOADER in the dropdown menu. Click the install driver button, and wait until you get the Driver Installation: SUCCESS message.

Replace it with WinUSB

At this point, your Meadow device should be good to go for a proper flash of Meadow.OS.

Meadow.CLI

Start updating Meadow.CLI by using the following command in your terminal of choice:

dotnet tool update Wildernesslabs.Meadow.CLI --global

Once complete, it should show you the version of the latest version available.

Meadow.OS

Download the latest Meadow.OS binaries, by using the command:

meadow download os

To flash your Meadow with the latest version of Meadow.OS, disconnect and reconnect your board holding the BOOT button to power it on in Bootloader mode. Now run the following command:

meadow flash os

Note: This process takes about 2-3 minutes, as it needs to erase the Flash memory of the STM32, then transfer the Meadow.OS.Runtime file along with the binaries for the ESP coprocessor. In my experience flashing boards several times, this process might show exceptions and errors, failing to complete successfully. When that happens, disconnect and reconnect the board in bootloader mode (or press and release the RST button while holding down the BOOT button), and try again.

When the board flashing process is completed, the console output should look something like this, confirming you have both Meadow.OS, Mono and ESP updated to the latest version.

Visual Studio (for Windows) Extension

In case your Visual Studio (for Windows) Extensions are set to update automatically, you might have picked up our latest version!

Not only this update includes several fixes under the hood, we replaced the Meadow Device Panel with a much simpler and handy toolbar widget. To enable it, right click anywhere in the toolbar area and you’ll see Meadow Device List in the dropdown. Click on it, and it will be added to your toolbar. 

That’s it! Plug in a Meadow device, and whenever you click on the dropdown, it will refresh the list of COM ports automatically so you can choose which port corresponds to your board and start deploying apps.

Testing your Meadow board

Now its time to test the board. Lets deploy a template project on your board:

  1. Open Visual Studio and do a File -> new Meadow Application to create a new Meadow App project.
  2. Select the right COM port in the Meadow Device List toolbar dropdown selector.
  3. In the Solution Explorer panel, right-click the project and click Deploy

Note: Remember we ran the flash erase command to wipe out the entire internal memory on the board, so all the dlls files will need to be deployed again. This means that this first deploy will take some time (up to 5 minutes approximately), as there are a lot of files that need to be transferred, including heavy ones like mscorlib.dll, System.Core.dll, System.dll and more, so you will need to be patient.

At times, you might see in the Output Panel in Visual Studio that it stopped transferring files. When that happens, press the RST button and try deploying again. The extension will pick up where it left off to transfer all the necessary files.

If you see your board pulsing colors like this, and the output says Meadow StdOut: Cycle colors… you are running a Meadow app in the latest beta version available!

Now if you do any changes on the app, you will see the extension will only transfer only the files that have been changed, so deployment process is much faster.

Problems Updating?

If you’re still running into problems trying to update your boards, head over to our #Support channel on our Public Slack, and we’ll try to help you get up and running. You can also check our Troubleshooting section and see if any of the possible solutions there could unblock you.

Happy hacking,
Jorge