Building the firmware

See the MicroPython Getting Started for more detailed information on building the MicroPython firmware.

Clone the Repositories

$ git clone git@github.com:micropython/micropython.git
$ git clone https://github.com/russhughes/gc9a01_mpy.git

Compile the cross compiler if you haven’t already

$ make -C micropython/mpy-cross

ESP32 MicroPython 1.14 thru 1.19

Change to the ESP32 port directory

$ cd micropython/ports/esp32

Compile the module with specified USER_C_MODULES dir

$ make USER_C_MODULES=../../../../gc9a01_mpy/src/micropython.cmake all

Erase the target device if this is the first time uploading this firmware

$ make USER_C_MODULES=../../../../gc9a01_mpy/src/micropython.cmake erase

Upload the new firmware

$ make USER_C_MODULES=../../../../gc9a01_mpy/src/micropython.cmake deploy

ESP32 MicroPython 1.20 and later

Change to the ESP32 port directory, and build the firmware

$ cd micropython/ports/esp32

$ make \
    BOARD=ESP32_GENERIC \
    BOARD_VARIANT=SPIRAM \
    USER_C_MODULES=../../../../gc9a01_mpy/src/micropython.cmake \
    FROZEN_MANIFEST=../../../../gc9a01_mpy/manifest.py \
    clean submodules all

Erase the flash and deploy on your device

$ make \
    BOARD=ESP32_GENERIC \
    BOARD_VARIANT=SPIRAM \
    USER_C_MODULES=../../../../gc9a01_mpy/src/micropython.cmake \
    FROZEN_MANIFEST=../../../../gc9a01_mpy/manifest.py \
    erase deploy

RP2040 MicroPython 1.20 and later

Change to the RP2 port directory, and build the firmware

$ cd micropython/ports/rp2
$ make \
    BOARD=RPI_PICO \
    FROZEN_MANIFEST=../../../../gc9a01c/manifest.py \
    USER_C_MODULES=../../../gc9a01c/src/micropython.cmake \
    submodules clean all

Flash the firmware.uf2 file from the build-${BOARD} directory to your device.