edit

Overview

This wiki introduce how to update the latest firmware for the Wireless Core Realtek RTL8720 on Wio Terminal, as well as installing all the dependent libraries for Wio Terminal to enable wireless connectivity.

Update the Wireless Core Firmware

First, we need to update the firmware for the Realtek RTL8720 Wireless core on Wio Terminal. This is essential and must update to the latest firmware before proceeding to examples.

attention icon

Attention

Please update the Wi-Fi Core before usage!

Step 1 - Arduino Configuration

To be able to update the firmware on the RTL8720, we need to enable the Serial connection from SAMD51 to RTL8720. This is done by a simple Arduino Program.

uf2 Method

For convenience, we the provide uf2 methods of uploading Wio Terminal's firmware. Simply download the uf2 files from below.

Entering the bootloader mode by sliding the power switch twice quickly. For more reference, please also see here.

An external drive named Arduino should appear in your PC. Drag the the downloaded rtl8720_update.uf2 files into the Arduino drive and it will reset the Wio Terminal and loaded loaded the sketch!

Step 2 - Download the Latest Firmware

Download the latest RTL8720 Firmware Here.

CLI Methods

Now, you can flash the RTL8720 firmware to Wio Terminal using the CLI methods.

Download the CLI firmware flash tools for your OS:

CLI Example Usage

Let's take macOS as an example. Unzip the downloaded file into your drive.

  • Open terminal and navigate to the file location:
  • Run ./amebad_flash_tools in the location you should see the help usage:
  • To erase the initial firmware inside the RTL8720, run:
./amebad_flash_tools erase --port /dev/cu.usbmodem*

Replace /dev/cu.usbmodem* with the port name in your PC.

Note

For Linux, the port name should be something like: /dev/ttyACM*.

NOTE: The initial erase process may take a while. Please be patient and do not close windows.

It should look something like this:

  • To flash the new downloaded firmware into the RTL8720, run:
./amebad_flash_tools flash -d [RTL8720-firmware-path] --port /dev/cu.usbmodem*

Replace [RTL8720-firmware-path] with the path you downloaded the RTL8720 from above.

This location should contain km0_boot_all.bin, km0_km4_image2.bin and km4_boot_all.bin these 3 files.

Also replace /dev/cu.usbmodem* with the port name in your PC.

If everything goes well, you should see all a successful message. Now you have flashed the new RTL8720 firmware into the RTL8720 core!

Libraries Installation

There are few Arduino Libraries that are needed for the Wireless connectivity. Follow through to install all the libraries needed:

1. Install the Seeed_Arduino_atWiFi

  1. Visit the Seeed_Arduino_atWiFi repositories and download the entire repo to your local drive.

  2. Now, the Seeed_Arduino_atWiFi library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the Seeed_Arduino_atWiFi file that you've have just downloaded.

InstallLibrary

2. Install the Seeed-Arduino-FreeRTOS

  1. Visit the Seeed-Arduino-FreeRTOS repositories and download the entire repo to your local drive.

  2. Now, the Seeed-Arduino-FreeRTOS library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the Seeed-Arduino-FreeRTOS file that you've have just downloaded.

3. Install the Seeed_Arduino_atUnified

  1. Visit the Seeed_Arduino_atUnified repositories and download the entire repo to your local drive.

  2. Now, the Seeed_Arduino_atUnified library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the Seeed_Arduino_atUnified file that you've have just downloaded.

4. Install the Seeed-Studio/esp-at-lib

  1. Visit the Seeed-Studio/esp-at-lib repositories and download the entire repo to your local drive.

  2. Now, the esp-at-lib library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the esp-at-lib file that you've have just downloaded.

5. Install the Seeed_Arduino_mbedtls

  1. Visit the Seeed_Arduino_mbedtls repositories and download the entire repo to your local drive.

  2. Now, the Seeed_Arduino_mbedtls library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the Seeed_Arduino_mbedtls file that you've have just downloaded.

6. Install the Seeed_Arduino_atWiFiClientSecure

  1. Visit the Seeed_Arduino_atWiFiClientSecure repositories and download the entire repo to your local drive.

  2. Now, the Seeed_Arduino_atWiFiClientSecure library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the Seeed_Arduino_atWiFiClientSecure file that you've have just downloaded.