Turns a Tanmatsu badge into a USB MSC device. The device enumerates as a standard USB Full-Speed (USB 1.1) mass-storage (MSC) device on the host PC, exposing both the FAT filesystem on the internal flash as well as the SD card if inserted.
Note: this app was generated using Claude.
The ESP32-P4 inside Tanmatsu has two USB controllers sharing one physical port:
- USB Serial JTAG — used for debug/flashing (default at boot)
- USB OTG Full-Speed (1.1) — used by this application
On startup the firmware switches the shared PHY from the JTAG controller to the OTG 1.1 controller (USB_DEVICE mode), then initialises TinyUSB as a MSC device.
make DEVICE=tanmatsu
Flash and monitor:
make flashmonitor DEVICE=tanmatsu PORT=/dev/ttyACM0
Note: Once the firmware is running, the USB port enumerates as a keyboard and the JTAG console is no longer available over USB. Use a UART adapter for serial logs if needed.
PS/2 scan code set 1 make/break codes are translated to USB HID keycodes. All standard keys are supported including:
- Full alphanumeric and symbol keys
- Modifier keys: Ctrl, Shift, Alt, GUI/Meta (left and right variants)
- Function keys F1–F12
- Navigation: arrows, Home, End, Page Up/Down, Insert, Delete
- Numpad (with Num Lock)
- Extended keys via the 0xE0 prefix
The Fn key (BSP-specific, scancode 0x55) has no USB HID equivalent and is silently ignored.
The contents of this repository may be considered in the public domain or CC0-1.0 licensed at your disposal.
At Nicolai Electronics we love open source so we recommend licensing your work based on this template under terms of the MIT license.