Skip to content

ESP32 Micropython firmware for eLITe-Connect

Choose a tag to compare

@rf-eng rf-eng released this 27 May 08:46

Requirements

esptool.py (it might be required to use a special version from here: https://github.com/eliteboard/esptool)

Flashing procedure

  • Run the following script on the eLITe-Board (STM32) to enable UART passthrough (connect to /dev/ttyACMx using Thonny, screen, or any terminal software)
from pyb import UART
import select

uart4 = UART(4, 115200, timeout=0, rxbuf=1024)  # to/from PC
uart7 = UART(7, 115200, timeout=0, rxbuf=1024)  # to/from eLITe-Connect

def pass_through(uart1, uart2):
    while True:
        select.select([uart1, uart2], [], [])
        if uart1.any():
            uart2.write(uart1.read(1020))
        if uart2.any():
            uart1.write(uart2.read(1020))

pass_through(uart4, uart7)
  • The ESP32 needs to be put into flash mode by pressing and holding the boot button. After a short press of reset (while still holding boot) it should be in flash mode. Then you need to:
  • Delete flash: esptool.py --chip esp32 --port /dev/ttyACMy erase_flash (check the correct port number)
  • Write binary to flash: esptool.py --chip esp32 --port /dev/ttyACMy --baud 115200 write_flash -z 0x1000 firmware.bin (note that 115200 bps is the only valid speed)

Further hints

The flash mode can also be activated while esptool is running. This approach gives you immediate feedback.
So far it was observed that the STM32 port is /dev/ttyACM2 whereas the ESP can be accessed over /dev/ttyACM1 (while above passthrough script is running)