This is some notes/scripts/etc that I've put together with the hopes of saving someone else a bunch of time if they ever want to get this thing running. I'm sure there's a better way to do this with custom board files and stuff but for the time being, this will at least serve as a starting point.
With the esp32c6 only somewhat recently getting official micropython support and the forked lv_micropython seemingly not rebasing anytime soon, kdschlosser has created a spinoff project to get things working with mainline micropython. It works great for this!
- Waveshare Wiki for ESP32-C6-LCD-1.74 - a useful reference. I was able to utilize the demos and documentation to determine which pins to fiddle with to get the screen working
- kdschlosser's lvgl_micropython repo - the meat and potatoes of the whole thing
- ampy - used to transfer files to the device
Wifithis works- SD card
- Bluetooth
LEDswork with neopixel (led is pin 8)- Screen rotation
Follow the directions to get kdschlosser's lvgl_micropython cloned. The build script for this particular board looks like this:
python3 make.py esp32 clean \
--flash-size=4 \
--enable-jtag-repl=y \
BOARD=ESP32_GENERIC_C6 \
DISPLAY=st7789
Once it's done, you'll have a bin that needs flashing. You may need to hold the boot
button while plugging in the to put it in bootloader mode for flashing.
Here's the command to do the flash. This assumes a few things:
- The lvgl_micropython repo was cloned in your home directory
- The build happened with idf 5.2 and python 3.12. Depending on your distro, and the point in time that you build this, those may need updating.
- The device shows up as /dev/ttyACM0
You may need to adjust accordingly, but here's the command as of today:
~/.espressif/python_env/idf5.2_py3.12_env/bin/python \
-m esptool \
--chip esp32c6 \
-p /dev/ttyACM0 \
-b 460800 \
--before default_reset \
--after hard_reset write_flash \
--flash_mode dio \
--flash_size 4MB \
--flash_freq 80m \
--erase-all 0x0 \
~/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_C6-4.bin
Once it's flashed, make sure micropython is running on the device by connecting a terminal emulator (I've been using gtkterm) to it:
- Port:
/dev/ttyACM0
- Baud Rate:
115200
And running: import sys; sys.version
It should return something like '3.4.0; LVGL (9.2.2) MicroPython (1.24.1) Binding compiled on 2025-02-05'
Finally, upload the included main.py
file to the device and hit the reset
button to restart it and hopefully get a HELLO WORLD!
Enjoy!