Program Particle Argon

Program Directly - Built-in ESP32 Module on Particle ARGON

Some boards like the Particle ARGON have an ESP32 wired directly in place, so you can only program it via CircuitPython.

Download the ESP32 for particle_argon firmware bundle above, unzip it, and place the esp32 folder in the root directory of your CIRCUITPY drive.

Note that unlike the ESP8266 firmware, this is a bundle of files. The ESP8266 firmware is 'combined' but we wouldn't be able to fit the combined ESP32 firmware on a 2MB flash disk so we kept the files separate.

Save the following as on your board. Open the serial terminal, and connect to the REPL.

import time
import board
import busio

from digitalio import DigitalInOut, Direction # pylint: disable=unused-import
import adafruit_miniesptool

print("ESP32 mini prog")

# With a Metro or Feather M4
#uart = busio.UART(TX, RX, baudrate=115200, timeout=1)
#resetpin = DigitalInOut(board.D5)
#gpio0pin = DigitalInOut(board.D6)

# With a Particle Argon, we need to also turn off flow control
uart = busio.UART(board.ESP_RX, board.ESP_TX, baudrate=115200, timeout=1)
resetpin = DigitalInOut(board.ESP_WIFI_EN)
gpio0pin = DigitalInOut(board.ESP_BOOT_MODE)
esp_cts = DigitalInOut(board.ESP_CTS)
esp_cts.direction = Direction.OUTPUT
esp_cts.value = False

esptool = adafruit_miniesptool.miniesptool(uart, gpio0pin, resetpin,
esptool.debug = False

print("Found:", esptool.chip_name)
if esptool.chip_name != "ESP32":
    raise RuntimeError("This example is for ESP32 only")
esptool.baudrate = 912600
print("MAC ADDR: ", [hex(i) for i in esptool.mac_addr])

# 0x10000 ota_data_initial.bin
esptool.flash_file("esp32/ota_data_initial.bin", 0x10000,

# 0x1000 bootloader/bootloader.bin
esptool.flash_file("esp32/bootloader/bootloader.bin", 0x1000,
# 0x20000 at_customize.bin
esptool.flash_file("esp32/at_customize.bin", 0x20000,

# 0x24000 customized_partitions/server_cert.bin
esptool.flash_file("esp32/customized_partitions/server_cert.bin", 0x24000,

# 0x26000 customized_partitions/server_key.bin
esptool.flash_file("esp32/customized_partitions/server_key.bin", 0x26000,

# 0x28000 customized_partitions/server_ca.bin
esptool.flash_file("esp32/customized_partitions/server_ca.bin", 0x28000,

# 0x2a000 customized_partitions/client_cert.bin
esptool.flash_file("esp32/customized_partitions/client_cert.bin", 0x2a000,

# 0x2c000 customized_partitions/client_key.bin
esptool.flash_file("esp32/customized_partitions/client_key.bin", 0x2c000,

# 0x2e000 customized_partitions/client_ca.bin
esptool.flash_file("esp32/customized_partitions/client_ca.bin", 0x2e000,

#  0xf000 phy_init_data.bin
esptool.flash_file("esp32/phy_init_data.bin", 0xf000,

# 0x100000 esp-at.bin
esptool.flash_file("esp32/esp-at.bin", 0x100000,

# 0x8000 partitions_at.bin
esptool.flash_file("esp32/partitions_at.bin", 0x8000,


From the REPL, type the following then press enter:

import miniesptool_esp32argon

This'll start the uploading process, it'll take a few minutes. 

ESP32 programming is similar but more advanced, and the files are bigger. We recommend adding md5 sums for each file, you can calculate these with command line tools on your computer.  That way, each file is checksummed after writing to avoid mis-writes!

If you aren't using the exact same firmware we are, all the MD5's will need re-calculating! We don't calculate them in-chip since CircuitPython doesn't have built-in MD5 and we wanted to keep the code simple.

This guide was first published on Dec 16, 2018. It was last updated on Dec 16, 2018. This page (Program Particle Argon) was last updated on Jan 22, 2020.