Programming - padraigfl/awesome-arcade-coder GitHub Wiki

Connecting to a computer

The board does not seem to have any data connections on the USB port so it must be programmed via the UART connections.

The board also does not contain the circuitry to automatically go into programming mode. This can be done manually by shorting the GPIO0 pin (located at the bottom of the left edge) to ground. This only needs to be done for a short time while the board is turned on.

Looking at the back of the board, there are 6 pads at the bottom-left of the board. The pins seem to be unconnected other than TX, RX and ground. TX and RX are the labelled pads - pad 2 and 3 respectively. The final pad is ground.

Hook up a USB to UART adapter to the pins for programming.

Programming Reset Hack

To aid with programming, you can create jumpers from the GPIO0 and EN pads (located at the bottom of the left edge) to any of the unused pads.

If using PlatformIO, you can set the option upload_resetmethod = ck. On your UART adapter, connect RTS to EN on the board and DTR to GPIO0. When uploading, PlatformIO will now automatically put the board into programming mode, and reset it afterwards.

You may need to add the options monitor_dtr = 0 and monitor_rts = 0 so that you can use the serial monitor without it putting the board into programming mode?

Arduino IDE

The library at https://github.com/padraigfl/twsu-arcade-coder-esp32/tree/master/src is usable within Arduino IDE using the generic ESP32 Dev Module board. The library relies on several Arduino library commands and therefore cannot currently be used with ESP-IDF

Circuit Python

[!NOTE] The CircuitPython build used here is generic for the same chip as used in the Arcade Coder. There won't be any nice features or libraries that you may get with other boards.

The ESP32 does not have support for the CIRCUITPY drive, so you will need to program using the REPL with a UART adapter, or with the web-based code editor.

  1. Download the BIN file for the ESP32-DevKitC-V4-WROOM-32E CircuitPython board.
  2. Connect a UART to USB adapter to your board (see here). You will need to put the board into programming mode before continuing by shorting GPIO0 to ground when turning on the board for a short while.
  3. Find your UART adapter's serial port this will be COM... on Windows and /dev/tty.usb... on Linux/macOS.
  4. Install esptool
  5. Erase the board's flash using the following command:
    esptool.py -p [PORT] erase_flash
    
  6. Flash the CircuitPython firmware:
    esptool.py -p [PORT] write_flash -z 0x0 adafruit-circuitpython-espressif_esp32_devkitc_v4_wroom_32e-en_GB-9.2.6.bin
    

This guide is a good overview to getting started.

Use this guide for setting up the web-based code editor, allowing wireless programming over Wi-Fi.

Rust

@jake-walker has written a highly performant Rust library for the board at https://github.com/jake-walker/rs-arcade-coder This is the best reference point if you are wishing to adapt an existing library for another language.