Skip to content

odudex/Kern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

253 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kern

Kern is an experimental project that explores the capabilities of the ESP32-P4 as a platform to perform air-gapped Bitcoin signatures and cryptography.

Hardware

Kern supports three Waveshare ESP32-P4 boards:

Board Display Touch Camera
ESP32-P4-WiFi6-Touch-LCD-4B (wave_4b) 720x720 MIPI DSI GT911 OV5647 + DW9714 autofocus
ESP32-P4-WiFi6-Touch-LCD-3.5 (wave_35) 320x480 SPI FT5x06 OV5647 (no autofocus)
ESP32-P4-WiFi6-Touch-LCD-5 (wave_5) 720x1280 MIPI DSI GT911 OV5647 (no autofocus)

ESP32-P4 does not contain radio (WiFi, BLE), but these boards have a radio in a secondary chip (ESP32-C6 mini). Later the project will migrate to use radio-less, simpler and cheaper boards with ESP32-P4 only.

An OV5647 camera module is required for both boards.

Prerequisites

Checkout ESP-IDF to Commit

Checkout to an early 6.1 version which has bugfixes we need for Kern

cd <your ESP-IDF installation dir>
git checkout 44c77cbf46844cd056c923277ece745173cb270d
git submodule update --recursive
./install.sh esp32p4

Build

Cloning the Repository

This project uses git submodules. You have two options:

Option 1: Clone with submodules (Recommended)

When cloning the project for the first time, make sure to clone it recursively to include all submodules:

git clone --recursive https://github.com/odudex/Kern.git

Option 2: Initialize submodules after cloning

If you've already cloned the repository without the --recursive flag, you can initialize and update the submodules with:

git submodule update --init --recursive

Building the Project

Build with just (recommended) or idf.py directly. All just commands accept a board parameter — wave_4b (default), wave_35, or wave_5:

just build              # Build for wave_4b (default)
just build wave_35      # Build for wave_35
just build wave_5       # Build for wave_5
just flash wave_5       # Flash for wave_5
just monitor            # Serial monitor
just clean              # Required when switching boards

Or using idf.py directly:

# wave_4b
idf.py -D 'SDKCONFIG_DEFAULTS=sdkconfig.defaults;sdkconfig.defaults.wave_4b' build

# wave_35
idf.py -D 'SDKCONFIG_DEFAULTS=sdkconfig.defaults;sdkconfig.defaults.wave_35' build

# wave_5
idf.py -D 'SDKCONFIG_DEFAULTS=sdkconfig.defaults;sdkconfig.defaults.wave_5' build

Note: Switching between boards requires a clean build (just clean) because sdkconfig is board-specific.

Desktop Simulator

The simulator renders the full LVGL UI in an SDL2 window, matching each board's resolution:

just sim                # Run simulator as wave_4b (720x720)
just sim wave_35        # Run simulator as wave_35 (320x480)
just sim wave_5         # Run simulator as wave_5 (720x1280)
just sim-build wave_35  # Build only
just sim-clean          # Remove simulator build artifacts
just sim-reset          # Wipe simulator data (factory reset)
just sim-qr IMG         # Run with a QR image
just sim-webcam         # Run with real webcam (V4L2)

Switching simulator boards also requires just sim-clean first. See simulator/README.md for details.

Full Clean

After updating ESP-IDF or switching branches with significant build changes, do a full clean to avoid stale artifacts:

idf.py fullclean
rm sdkconfig
idf.py set-target esp32p4
idf.py build

Build Options

Enable/disable Auto-focus

To enable camera auto-focus, enable camera focus motor on menuconfig:

CONFIG_CAM_MOTOR_DW9714=y
CONFIG_CAMERA_OV5647_ENABLE_MOTOR_BY_GPIO0=y

Flashing Pre-releases

Pre-release firmware is provided for testing purposes only. Do not use pre-release builds as a signer for real savings.

Supported Devices

Device Board Display
wave_4b Waveshare ESP32-P4-WiFi6-Touch-LCD-4B 720x720 MIPI DSI
wave_35 Waveshare ESP32-P4-WiFi6-Touch-LCD-3.5 320x480 SPI
wave_5 Waveshare ESP32-P4-WiFi6-Touch-LCD-5 720x1280 MIPI DSI

Requirements

  • Python 3
  • USB cable connected to the board

Steps

  1. Download the zip for your device from the Releases page (e.g. kern-wave_4b-v0.0.3.zip).

  2. Unzip the package:

unzip kern-wave_4b-v0.0.3.zip

The zip contains:

  • bootloader.bin — bootloader
  • partition-table.bin — partition table
  • firmware.bin — application firmware
  • kern-v0.0.3.bin — merged binary (all of the above)
  1. Create a Python virtual environment and install esptool:
python3 -m venv venv
source venv/bin/activate
pip install esptool
  1. Flash the merged binary (clean install):
esptool --chip esp32p4 --baud 460800 write-flash 0x0 kern-v0.0.3.bin

Note: Flashing the merged binary from offset 0x0 erases the entire flash range it covers, including the NVS partition where PIN and settings are stored. To preserve NVS data when updating, flash the individual binaries instead:

esptool --chip esp32p4 --baud 460800 write-flash \
  0x2000 bootloader.bin \
  0x8000 partition-table.bin \
  0x20000 firmware.bin

References

Kern is strongly inspired by Krux, sharing similar but simplified UI elements and flow.

Blockstream Jade was a strong inspiration for the decision to use C language for efficient use of the hardware. Additionally, Kern uses the same core library Jade does, libwally, is shared with Jade.

The simplicity and UI polish of SeedSigner and the security focus of the pioneering Specter-DIY were also strong inspirations.

License

MIT

About

Experimental project to explore ESP32-P4 as a C-based, air-gapped Bitcoin signer

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors