zmk icon indicating copy to clipboard operation
zmk copied to clipboard

Proof of Concept: ZMK works with ESP32-S3

Open tywtyw2002 opened this issue 1 year ago • 2 comments

This week, I did some tests on my ESP32-S3 (ESP32-S3R2) corne/corneish clone with the ZMK firmware.

  • 16M SPI FLASH
  • 2M Internal PRAM

The positive outcome is that the ESP32-S3 SoC can run ZMK directly without any code modifications with Zephyr v3.6.

  • [X] Single Keyboard Bluetooth
  • [X] Split Keyboard Bluetooth

At present, the ESP32-S3 can only communicate with the host via Bluetooth. This is because Zephyr v3.6 does not yet support ESP32 USB OTG.

A few things need to be mentioned.

  • The ESP32-S3 does not yet support usbd; instead, it uses usb_serial for jtag/serial. To enable ZMK_USB_LOGGING, you need to comment out USB_DEVICE_STACK and USB_CDC_ACM in Kconfig.
  • Regarding Settings, only the FCB is functional. The NVS leads to a core dump. I haven't thoroughly investigated this issue, but my best guess is that there are some bugs related to the NVS API at the hal_espressif level.
  • It's possible to use UF2 firmware on the esp32-s3 with the tinyuf2 bootloader. However, I was unable to successfully build the UF2 ZMK firmware.

I would like to note that I don't believe the ESP32-S3 is a suitable MCU for keyboards at this point. This is primarily because Zephyr does not fully support the ESP32 yet, particularly the USB OTG. I'm also unsure about the practicality of a keyboard that connects via BLE but is powered by USB.

Regarding power consumption, my keyboard uses approximately 0.1A@5V when active.

The ESP32-C3 should also works with ZMK as it has ble5

Reference: https://github.com/tywtyw2002/zmk/tree/z/esp32

tywtyw2002 avatar Feb 24 '24 09:02 tywtyw2002