Links

Getting Started

How to flash your SuperB using either a USB adapter board or an M2

Overview

SuperB can be flashed using an XBee USB adapter board or using M2. As of right now only the USB adapter board supports flashing through the ESP desktop tool; flashing through M2 can only be done through the Arduino IDE.

Step 1 - Hardware Prep

USB Adapter Board
M2
For the instructions that follow, the SuperB is connected to the computer with an XBee USB Adapter board (with one modification), available here.
Before the board can be used with the SuperB, VREF and DIO11 need to be bridged on the rear of the board as shown below.
At this point the board can be connected to the computer via USB with the RESET and BOOT buttons controlling EN and IO0, respectively.
  • 1) Plug SuperB into M2 with the antenna trace/U.FL connector towards the USB port and then plug M2 into computer. (Note the button nomenclature and board orientation)
  • 2) Select "Macchina M2" as board type and upload the sketch below:
int buttonState1 = 0;
int buttonState2 = 0;
void setup() {
pinMode(DS2, OUTPUT);
pinMode(DS3, OUTPUT);
pinMode(XBEE_RST, OUTPUT);
pinMode(XBEE_MULT4, OUTPUT);
pinMode(Button1, INPUT);
pinMode(Button2, INPUT);
SerialUSB.begin(115200);
Serial.begin(115200);
}
char rx_byte = 0;
void loop() {
if (SerialUSB.available() > 0) {
rx_byte = SerialUSB.read();
Serial.write(rx_byte);
}
if (Serial.available() > 0) {
rx_byte = Serial.read();
SerialUSB.write(rx_byte);
}
buttonState1 = digitalRead(Button1);
if (buttonState1 == LOW) {
digitalWrite(DS2, LOW);
digitalWrite(XBEE_RST, LOW);
} else {
digitalWrite(DS2, HIGH);
digitalWrite(XBEE_RST, HIGH);
}
buttonState2 = digitalRead(Button2);
if (buttonState2 == LOW) {
digitalWrite(DS3, LOW);
digitalWrite(XBEE_MULT4, LOW);
} else {
digitalWrite(DS3, HIGH);
digitalWrite(XBEE_MULT4, HIGH);
}
}

Step 2 - Software

USB Adapter Board + Arduino IDE
USB Adapter Board + ESP Tool
M2 + Arduino IDE
  • 1) Follow the instructions here to set up the board manager for ESP32.
  • 2) Connect the SuperB with the USB adapter board and select the correct port.
  • 3) Place the SuperB into bootloader mode by holding down the BOOT button, pressing and releasing the RESET button, and then releasing the BOOT button.
  • 4) Select "ESP32 Dev Module" as board type.
  • 5) Upload a sketch. An easy sketch to adapt is the "Blink" sketch found in File>Examples>Basics>Blink.
  • 6) Change the three instances of "LED_BUILTIN" to "26":
    void setup() {
    // initialize digital pin LED_BUILTIN as an output.
    pinMode(26, OUTPUT);
    }
    // the loop function runs over and over again forever
    void loop() {
    digitalWrite(26, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000); // wait for a second
    digitalWrite(26, LOW); // turn the LED off by making the voltage LOW
    delay(1000); // wait for a second
    }
  • 7) Upload the sketch and reset the SuperB with the RESET button.
The ESP tool "Flash Download Tools (ESP8266 & ESP32)" can be downloaded here. The binary files used can be downloaded here. (Right click>Save link as)
  • 1) Open the tool and select "ESP32 DownloadTool".
Image showing tool selection screen, "ESP32 DownloadTool" is selected
  • 2) Enter the binary files and their addresses, and configure the remaining settings as shown below, selecting the corresponding COM port.
Image showing settings for the ESP tool
  • 3) Place the SuperB into bootloader mode by holding down the BOOT button, pressing and releasing the RESET button, and then releasing the BOOT button.
  • 4) Press start to begin flashing. (~10sec)
  • 5) An easy way to test the SuperB's functionality after flashing is to send it AT commands.
  • 1) Follow the instructions here to set up the board manager for ESP32.
  • 2) Modify the file "platform.txt" found at: (Windows) C:\Users\YourUsername\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\platform.txt (MacOS) /Users/you/Library/Arduino15/packages/esp32/hardware/esp32/1.0.3/platform.txt
Replace "default_reset" with "no_reset" once on line 100 and once on line 101.
  • 3) Replace the file "boards.txt" found at:
    (Windows) C:\Users\YourUsername\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\boards.txt (MacOS) /Users/you/Library/Arduino15/packages/esp32/hardware/esp32/1.0.3/boards.txt
Replace the existing "boards.txt" file with the one available here.****
  • 4) Restart the IDE.
  • 5) Open the serial monitor. Place the SuperB into bootloader mode by holding down the BOOT (SW2) button, pressing and releasing the RESET (SW1) button, and then releasing the BOOT (SW2) button. The serial monitor output should look like the one below:
  • 6) Select "SuperB on M2" as board type:
  • 7) A good example sketch can be found in File>Examples>Examples for SuperB on M2>WiFi>WiFiScan. Upload it.
  • 8) Close and reopen the serial monitor with "Macchina M2" as the board type. Press RESET (SW1) to begin scanning for access points: