Tanmatsu is the dream terminal device for hackers, makers, and tech enthousiasts. Based around the powerful ESP32-P4 microcontroller, this device provides an accessible way to make, hack, and tinker on the go.
Tanmatsu lets you program on the go and communicate over long distances using LoRa whilst also providing advanced connectivity and extendability options for hardware hacking and development.
Blog
Interested? See our blog for project updates.
Project
We have published an issue tracker on Github, where you can follow our project progress.
You can find out what we are currently working on in the Github project.
If you have a suggestion or bugreport you can create an issue on the issue tracker.
And if you have questions or just want to ask something, feel free to ask anything you want over at our Discord community.
Features
Tanmatsu is based around the upcoming ESP32-P4 SoC by Espressif: their most powerful RISC-V microcontroller yet. With its 400MHz dual-core processor and 32MB of built-in PSRAM it makes the ideal platform for powerful processing on the go whilst still maintaining the ease of use one expects form a microcontroller platform.
In addition to the powerhouse ESP32-P4 application processor we have included an ESP32-C6 WiFi, Bluetooth Low Energy, and IEEE802.15.4 wireless radio module. This module enables wireless internet access, as well as access to local mesh networking like Thread and ZigBee in a hacker friendly way.
A LoRa radio module provides access to LoRa networks such as long distance mesh network services and (G)FSK modulated classic 433 or 868MHz communication, depending on the LoRa module installed.
The device has 16MB of built-in flash storage for firmware and applications, expandable using a micro SD card. The micro SD card socket supports SD cards at 3.3v and 1.8v voltage levels (SDIO 3) for extra fast transfer speeds.
A big MIPI DSI display and the QWERTY keyboard make for great ease of use both in the workshop and on the go.
In addition to all the built-in functionality the device allows for expansion modules using its two expansion ports. The back facing expansion port allows for expanding functionality using personality modules, while the side facing expansion port allows for easily connecting a wide variety of PMOD and SAO compatible accessories.
A QWIIC style expansion connector allows connecting the device to a wide range of sensors available from manufacturers such as Sparkfun and Adafruit, it supports both the I2C and the new I3C communication bus standards.
A 3D printed case is included with every Tanmatsu, this sturdy case will allow the device to be used everywhere whilst keeping the electronics safe and protected.
Software
The launcher firmware allows starting user made applications and in addition it provides access to a marketplace for applications where developers can publish their creations. Apps can be downloaded and installed directly on the device.
Hardware features - summary
ESP32-P4 dual-core 400MHz RISC-V microcontroller with 32MB of built-in PSRAM
ESP32-C6 radio module for WiFi, BLE and IEEE 802.15.4 mesh networking connectivity
Ai-Thinker Ra-01S or Ra-01SH module for long range communication using LoRa modulation and generic (G)FSK modulation for short range classic wireless radio applications at 433MHz or 868MHz respectively
16MB of built-in flash storage for firmware and applications
Fast and big 800x480 MIPI DSI display
QWERTY keyboard
Lithium polymer battery
Audio output via headphone jack and speaker
I2C and I3C connectivity via Qwiic compatible JST SH style connector
SD card socket supporting SD cards at 3.3v and 1.8v voltage levels (SDIO 3)
Side facing expansion port with both SAO and PMOD capabilities
Back facing expansion port for expanding functionality using personality modules
Software features - summary
Launcher menu for easy access to multiple applications and firmwares
Access to user generated content and applications repository via the hub app
Open source
The hardware design will be made fully open source and available under a permissive license (CERN-OHL-P). The design can be edited using the open source PCB CAD application KiCAD, allowing everyone to edit the design without any roadblocks.
The board support package and launcher firmware will also be made open source under a permissive license (MIT), enabling modifications and improvements by the community and granting users and developers complete freedom and control.
Personality modules
Whilst the base Tanmatsu device already provides lots of functionality we plan on creating and making available multiple personality modules for extending the functioality in ways useful to you. More information about the planned personality modules will be made available soon.
1 - Tanmatsu: getting started
Introduction
Congratulations! You just got your hands on your Tanmatsu, we bet you’re excited to get started so let’s not delay and get right to it!
Turning Tanmatsu on and off
The top most button on the right side of the device is the power button.
Tanmatsu has multiple power states, some are defined by software, others by hardware. Depending on the state your device is in you will need to hold down the power button for a different duration to reach the desired state.
If your Tanmatsu is completely turned off it is in a mode where only the clock is running. This mode requires so little power that you should not notice any battery drain in years if the device is left alone. Pressing the power button for 2.5 seconds turns the device on if it is in this state.
If your Tanmatsu is turned on you can turn it off completely by holding down the power button for more than half a second.
If you keep holding down the power button after the device has powered off then the device will restart 2.5 seconds after it powered off. This allows for easily rebooting your tanmatsu by holding down the power button for 3 seconds.
Depending on the app currently running on your Tanmatsu there might be more power states available. We recommend trying a short press of the power button to enter and leave the sleep state.
Charging your Tanmatsu
You can charge your Tanmatsu by plugging in a power source (phone charger or computer) into the USB-C port. Tanmatsu will automatically power on when a power source is detected and battery charging will start automatically.
Tanmatsu will only charge when on or in sleep mode. If Tanmatsu is powered off the battery will not be charged even with a power source connected to the USB-C port. The default firmware for Tanmatsu will include a mode which turns off the radio and display and keyboard backlight before putting the ESP32-P4 application processor into deep sleep mode. You can enter this mode by pressing the power button for less than half a second. You can check if your Tanmatsu is charging by looking at the color of the power LED.
Power LED
The color of the power LED indicates the state of the power management system.
If the power LED displays a solid single color:
Blue: running on battery, no charger detected
Yellow: charger detected, battery is being charged
Green: charger detected, battery is fully charged
Red: charger detected, no battery detected
If the power LED displays a blinking color:
Slowly blinking red: the battery is almost empty, connect a charger to avoid losing work
Rapidly blinking red: a fault occured in the power management circuit
In case you encounter a fault condition please exit the currently running app and return to the launcher menu. The launcher menu will provide more detailed information about the active fault flags.
PMIC status LED
There is a small red LED on the back of the mainboard. This LED provides additional status information about the state of the power management system of Tanmatsu.
Off: the battery is not being charged
Slow blinking: a PMIC fault has occured
Rapid bliniing: Tanmatsu is trying to charge the battery but no battery is being detected
PMIC stands for “Power Management Integrated Circuit”. Tanmatsu uses a BQ25895 PMIC from Texas Instruments to manage battery charging.
Fault conditions
A fault doesn’t immediately mean there is anything wrong with your Tanmatsu and using a Lithium Polymer battery is not dangerous if the battery is handled correctly. Tanmatsu contains a multiple layers of protection to prevent any damage to your device, the battery or it’s surroundings. If charging is stopped due to a fault then most likely there is something wrong with your battery, though this doesn’t immediately have to be a problem.
The protection functions built into the Tanmatsu mainboard will, in addition to the battery protection circuit built into the battery itself, stop charging if it detects that the battery voltage is below the minimum safe threshold for a Lithium Polymer battery or above the maximum voltage threshold of a Lithium Polymer battery. In both cases the power LED will rapidly blink in red and the small red LED on the back of the mainboard will
A situation that can trigger the under-voltage protection is a situation where the battery has drained below it’s rated minimum voltage due to degradation when left completely empty for a long period of time. In this situation is is also possible that the battery simply is not detected, in which case the power LED will turn red when an external power source is connected. If the battery has accidently reached a voltage near 2.5 volt then the battery will be disconnected to protect it. Normally the battery voltage recovers a bit automatically after leaving the battery alone for a few minutes. In this situation you can safely restart start charging the battery again after the voltage has reached it’s normal level.
The battery supplied with your Tanmatsu has a built-in protection circuit preventing the battery from draining below it’s minimum rated voltage during normal use.
A Lithium Polymer battery that has reached a voltage below 2.5 volt for a prolonged period of time can become chemically unstable, we recommend replacing the battery if your battery has drained below 2.5 volt. Recharging a Lithium Polymer battery that has been subjected to a situation where it reached a voltage of less than 2.5 volt can be dangerous, the battery may for example swell up and could potentially damage the device or it’s surroundings.
1.1 - Compiling the template app
Setting up the environment on Windows
On Windows we recommend using WSL (Windows Subsystem for Linux) to create a virtual Linux environment to work in.
Step 1: download Ubuntu 24.04.1 LTS from the Microsoft store.
Click the Get button. After the Linux environment is installed you can find it in the start menu.
After starting the Ubuntu environment you should be presented by the following prompt:
Step 2: install required packages
Run the following command to install the dependencies:
Replace the URL in the command above with the URL of your repository.
Step 4: install the ESP-IDF SDK
First enter the folder into which you have cloned the repository.
cd tanmatsu-template-pax
Then run the following command to install ESP-IDF and the toolchain into subfolders of the working folder. The sdk and toolchain folders have been added to the .gitignore file so that they won’t be committed into the repository when you commit your work.
make prepare
Step 5: compile the app
Run the following command to compile the app:
make build
Optionally you can add a DEVICE= argument to select another target device. The default device is Tanmatsu. Currently only Tanmatsu and the MCH2022 badge by Badge.Team are supported.
make build DEVICE=mch2022
Build output can be found in the build/tanmatsu or build/mch2022 folders depending on the selected target.
The binary which can be installed on the target device can be found at build/tanmatsu/application.bin. This is the only file you need to run your app.
You can choose to install your app as the main firmware for the target device, however do note that this will overwrite the launcher and all other already installed data on your device.
Instead of directly flashing the application we recommend using BadgeLink either via a compatible browser or using the commandline utilities to install your application via the USB port.
The BadgeLink tools are not yet available but will be released soon. This page will be updated when the tools have been made available.
2 - Tanmatsu: hardware
This page describes all the hardware on the Tanmatsu main board, explaining how everything is connected.
The ESP32-P4 application processor is the star of the show, this is the processor that will run your applications.
It is directly connected to a lot of peripherals:
Quad SPI interface to a 16MB flash chip for storing firmware, apps and data
MIPI DSI and CSI interfaces to the display and camera ports
Multiple USB interfaces: as device to the USB-C port via the hub and as host to the USB-A port and the internal expansion header
Multiple SDIO interfaces: to the MMC card reader and the ESP32-C6 radio module
I2C/I3C interface: to the QWIIC port
I2C interface: to an I2C bus connecting all the peripherals on the main board to each other
LEDs
Tanmatu has seven LEDs, six of which are addressable RGB LEDs located on the left and right sides of the screen. The seventh LED is located on the back of the board next to the USB-C connector.
The addressable LEDs are fully user controllable by writing the relevant registers of the coprocessor via the internal I2C bus. By default the coprocessor controls the LEDs automatically, this can of course be disabled.
When in automatic control mode the LEDs have the following meaning:
the “power” LED (top left) indicates the state of the power management subsystem. Blue indicates the device is running on battery power, orange means the battery is being charged via the USB-C connector, green means the battery is fully charged and red means the device is powered via USB but no battery is detected.
The “radio” LED (middle left) indicates the state of the ESP32-C6 radio module. When the radio module is disabled the LED is off, when the radio module is enabled and running normally the led is green and when the radio module is started in bootloader mode for flashing its firmware the led turns blue.
The “A” LED (middle right) indicates the state of the USB-A port power output. It is blue when the USB-A port is enabled and off when disabled.
The “C” LED (top right) turns red when the power button is pressed.
All other LEDs are currently not automatically controlled.
The “message” LED (bottom left) is meant to allow for indicating that an unread message is available to be read, for example after the radio module receives a message via WiFi, BLE, 802.15.4 mesh or LoRa while the ESP32-P4 application processor is running an app.
The “A”, “B” and “C” LEDs are, aside from the above mentioned automatic control states for the “A” and “C” LEDs meant to show custom states defined by the running application.
The seventh LED is a single color red LED located on the back of the device. This LED is controlled by the power management chip and indicates the state of the power circuit.
It is:
Off when the battery is not charging
On when the battery is being charged
Blinks slowly when a fault has occurred (battery charging is automatically stopped)
Blinks rapidly when it attempts to charge the battery while no battery is attached
Expected behavior is that the LED blinks rapidly for a second when powering the board using the USB-C connector while there is no battery connected before turning off once the coprocessor starts up and instructs the power management chip to stop charging. If the LED continues to blink rapidly this could indicate that the coprocessor is not functioning.
Buttons
Tanmatsu has three buttons on the right side of the device. From top to bottom these buttons have the following functions:
Power button: hold for two seconds to power on or off the device
+ button: currently unused, mapped to the BSP_INPUT_NAVIGATION_KEY_VOLUME_UP navigation event in the board support package (BSP) software component
- button: functions as bootloader trigger for the ESP32-P4 when pressed while powering on the device. Otherwise currently unused, mapped to the BSP_INPUT_NAVIGATION_KEY_VOLUME_DOWN navigation event in the board support package (BSP) software component
The + button as well as all the keys of the keyboard on the front of the device are wired up as a diode matrix and connected to the coprocessor. The power button is connected directly to the PMIC power management chip and the state of the power button can be read by the coprocessor. The state of the power button is presented to the application by the board support (BSP) component as the BSP_INPUT_ACTION_TYPE_POWER_BUTTON action event.
The - button is directly connected to GPIO35 of the ESP32-P4 and is mapped to the BSP_INPUT_NAVIGATION_KEY_VOLUME_DOWN navigation event in the board support package (BSP) software component.
All the keyboard buttons are mapped to INPUT_EVENT_TYPE_SCANCODE events by the board support component (BSP), presenting a PC keyboard compatible scancode. In addition the BSP presents the keyboard buttons as INPUT_EVENT_TYPE_NAVIGATION and INPUT_EVENT_TYPE_KEYBOARD events too. Navigation keys trigger the navigation event while the letters and numbers trigger the keyboard event. The keyboard event contains the character on the keyboard button both as ASCII char and UTF-8 string, automatically incorporating the state of the modifier keys (SHIFT and ALT GR).
Connectors
Display connector
Hidden under the front panel a board to board connector connects the display to the main board. The display is pre-installed from the factory so normally you should not need to do anything with this connector.
The connector has the following signals:
Three MIPI DSI differential pairs (two for data and one for clock)
3.3v power for the digital logic in the display
a 20mA at around 24v supply rail for the backlight LEDs
The output current of the power regulator for the display backlight is controlled by the coprocessor with a PWM signal. You can set the backlight brightness by writing the display backlight brightness register exposed by the coprocessor on the internal I2C bus.
Camera connector
The camera connector is used to connect a CSI camera module. It is pinout-compatible with the camera connector on the Raspberry Pi Zero and 5. Note that software support is limited to a subset of Raspberry Pi compatible camera module sensor chips such as OV5647.
The connector has the following signals:
Three MIPI CSI differential pairs (two for data and one for clock)
3.3v power for the camera module
Enable signal (shared with the enable signal for the ESP32-C6 radio module)
LED control signal (shared with internal expansion port pin E2)
USB-C device port
This port is used to charge the battery, to program and debug the ESP32-P4 and ESP32-C6 microcontrollers and to install apps and browse files from your computer.
It is connected to a USB hub chip which splits the USB port into three interfaces:
ESP32-P4 FS (12Mbit) USB port 1 (by default USB serial / JTAG)
ESP32-C6 USB serial / JTAG port
The internal expansion header
By default the ESP32-P4 exposes a USB serial/JTAG debugging peripheral via the USB-C port. This allows for flashing the ESP32-P4 even if no valid firmware is installed.
The firmware on the ESP32-P4 can swap this USB interface with a customizable USB interface, allowing for exposing other interfaces to the host PC. The launcher firmware includes a USB interface called BadgeLink which allows you to manage the device using a set of Python scripts and using WebUSB in the Chrome and Edge browsers.
To force the ESP32-P4 into a bootloader mode simply hold down the third (-) button on the right side of Tanmatsu down while powering on the device. An easy way to do this is to turn off Tanmatsu by pressing the power button until the device turns off, then press and hold the - while plugging in an USB cable into a PC. After plugging in the USB cable the device powers on, the screen will stay black.
USB-A host port
This port can be used to connect a USB device. The 5 volt power output is is limited to 1A of current and protected against short circuits.
The USB-A port can be disabled and enabled by writing the relevant register of the coprocessor via the internal I2C bus. Note that the enable signal for the USB-A port is shared with the boot mode control pin of the ESP32-C6 radio module. When the ESP32-C6 radio gets enabled the USB-A port is forced to power on for a short time and when the ESP32-C6 radio gets put into bootloader mode the USB-A port is forced to power off for a short time.
QWIIC & Stemma QT compatible I2C & I3C connector
This connector can be used to connect external I2C or I3C based accessories. Both Adafruit and Sparkfun make a variety of modules and cables which could be connected to this port.
MMC card slot
Accepts micro SD memory cards including modern high speed SDIO 3.0 cards.
Battery connector
Allows for connecting a single cell Lithium Polymer or Lithium Ion battery cell. Using a protected cell is mandatory. Unprotected cells could potentially be drained below their lowest allowable voltage, which causes damage to the battery. Current control, over voltage protection and proper constant voltage/current charge control are is built-in into the Tanmatsu main board.
Sensor connector
Can be used to connect an optional sensor module.
WiFi, BLE and IEEE802.15.4 radio module
The ESP32-C6 based module provides the board with access to WiFi, BLE and IEEE802.15.4 (mesh network) connectivity while also controlling the LoRa radio module via SPI.
By default the ESP32-C6 module runs a firmware called ESP-Hosted-MCU. This firmware allows the ESP32-P4 to make use of the WiFi and BLE functionality of the radio via the SDIO bus.
Adding support for the 802.15.4 mesh functionality of the ESP32-C6 module and the LoRa radio to the SDIO interface exposed by the ESP-Hosted-MCU firmware is planned.
2.1 - Tanmatsu: connectors
2.1.1 - Tanmatsu: external add-on port
The external expansion port (CATT, for “Connect All The Things”) on Tanmatsu has been designed to be compatible with both PMOD and SAO add-on boards, in addition to it being a port that exposes 8 GPIOs and 3.3v power it can also be used as JTAG interface for the ESP32-P4.
Pinout
Pin
Function
Name
GPIO
Description
Notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Limitations & warnings
Total for all 3.3v outputs must not exceed 1A of current. It is generally adviced to stay well below this figure.
2.1.1.1 - SAO adapter
The CATT to SAO adapter is a small adapter board that converts the external add-on port of Tanmatsu into a standard “Simple Add-On” port as found on various event badges.
Assembling the adapter
The recommended method for assembling the adapter board is to start with the male pinheader connecting to Tanmatsu as this component is of lower height than the boxed female header for the SAO side. Make sure that the side of the board with the “CATT SAO” text is the side on which you plug in the connectors, assembling the board upside down will not work.
Pin mapping
Pinout
CATT
SAO
Description
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Photos
2.1.2 - Tanmatsu: internal add-on port
This port is not exposed by default, and a modified back cover needs to be used to make it accessible. For this reason the port is also named the “internal expansion port”.
Pinout
Pin
Function
Name
GPIO
Description
Notes
1
Power output
VOTG
-
Output from booster DC/DC converter in the PMIC
5 volt when booster is enabled, +/- VSYS when booster is disabled
2
USB
HUB_USB1_P
-
Port on USB hub for USB-C port (DP)
Can be used to expose an USB device on the add-on to the PC plugged into the USB-C port
3
Power output
HUB_USB1_N
-
Port on USB hub for USB-C port (DN)
Can be used to expose an USB device on the add-on to the PC plugged into the USB-C port
4
USB
VBATT
-
Battery voltage (3.0 – 4.2v)
Directly connected to battery connector, always on even when the device is turned off
5
Power output
VSYS
-
System voltage (3.0 – 5.0v)
Switched power rail for powering the system, can be powered by battery or USB-C port, off when device is turned off
6
Power ref.
GND
-
Voltage reference (ground)
7
Power ref.
GND
-
Voltage reference (ground)
8
Power output
+3.3v
-
Main logic supply rail (3.3v)
9
I2C
INT_SCL
10
Internal I2C bus, shared with other I2C devices (SCL)
Used to connect I2C devices and an EEPROM for add-on identification
10
I2C
INT_SDA
9
Internal I2C bus, shared with other I2C devices (SDA)
Used to connect I2C devices and an EEPROM for add-on identification
11
GPIO
E0
36
GPIO
12
GPIO
E1
0
GPIO
13
GPIO
E2
6
GPIO, also connected to camera GPIO 1
Shared with camera connector
14
GPIO
E3
46
GPIO, VSDCARD LDO must be enabled to use this pin
Connected via level shifter, externally these GPIOs operate at 3.3v but the GPIOs are powered by the VSDCARD power domain
15
GPIO
E4
47
GPIO, VSDCARD LDO must be enabled to use this pin
Connected via level shifter, externally these GPIOs operate at 3.3v but the GPIOs are powered by the VSDCARD power domain
16
GPIO
E5
48
GPIO, VSDCARD LDO must be enabled to use this pin
Connected via level shifter, externally these GPIOs operate at 3.3v but the GPIOs are powered by the VSDCARD power domain
17
GPIO
E6
45
GPIO, VSDCARD LDO must be enabled to use this pin
Connected via level shifter, externally these GPIOs operate at 3.3v but the GPIOs are powered by the VSDCARD power domain
18
GPIO
E7
7
GPIO, in low power domain of P4, has 51k pull-up resistor
Can be used as wakeup pin to wake up the ESP32-P4 from deep sleep
19
GPIO
E8
54
GPIO
20
GPIO
E9
49
GPIO
21
GPIO
E10
53
GPIO
22
GPIO
EXT_USB_P
26
Can be used as GPIO or as USB FS PHY (DP)
The USB PHYs of the P4 can be swapped between the USB serial/jtag and user controlled USB peripheral. If badgelink is used then this PHY exposes the serial/jtag peripheral
23
GPIO
E11
52
GPIO
24
GPIO
EXT_USB_N
27
Can be used as GPIO or as USB FS PHY (DN)
The USB PHYs of the P4 can be swapped between the USB serial/jtag and user controlled USB peripheral. If badgelink is used then this PHY exposes the serial/jtag peripheral
25
GPIO
E12
51
GPIO
26
GPIO
P4_TX
37
Exposes boot console of P4, can be used as GPIO
Must be low during boot
27
GPIO
E13
50
GPIO
28
GPIO
P4_RX
38
Exposes boot console of P4, can be used as GPIO
Must be high during boot
29
I2S
I2S_MCLK
30
Digital audio bus master clock
Reference clock for connected I2S devices
30
I2S
I2S_LRCK
31
Digital audio bus word clock
Word clock (left-right selection) for connected I2S devices
31
I2S
I2S_DATA
28
Digital audio bus data output
Data output from mainboard for connected I2S DACs
32
I2S
I2S_SCLK
29
Digital audio bus sample clock
Sample clock for connected I2S devices
33
Power output
+3.3v
-
Main logic supply rail (3.3v)
34
I3C
I3C_SDA
33
I3C bus, shared with QWIIC connector (SDA)
Can also be used as I2C bus
35
Power ref.
GND
-
Voltage reference (ground)
36
I3C
I3C_SCL
32
I3C bus, shared with QWIIC connector (SCL)
Can also be used as I2C bus
Identification EEPROM
Please include a small EEPROM at address 0x50 on your boards, this will allow Tanmatsu to identify which add-on board has been connected.
The format for the content of this EEPROM has yet to be determined, currently the launcher firmware has no support for identifying add-ons. The format will most likely be based on the format described here.
Usage
We recommend to start with the GPIOs that do not have shared functions. The following GPIOs on the add-on header can be used without limitations:
E0, E1, E7, E8, E9, E10, E11, E12 and E13
If the built-in LDO number 4 of the ESP32-P4 is enabled (this powers up the SD card slot) then the following GPIOs will be available, a level shifter is included on the main board so these GPIOs are always using 3.3v voltage level regardless of the SD card operating in 3.3 volt or 1.8 volt mode.
E3, E4, E5 and E6
The following pins can also be used if remapped to GPIO, there might be some activity on these pins during startup or while the launcher is running:
EXT_USB_P, EXT_USB_N, P4_TX and P4_RX
The following pins share functions with other peripherals on the main board. Use these with caution:
E2, I2S_MCLK, I2S_LRCK, I2S_DATA, I2S_SCLK, I3C_SDA and I3C_SCL
Using these pins for other purposes than their intended purpose will render either on-board audio, the QWIIC port or the camera port unusable when the add-on board is plugged in.
Limitations & warnings
Total for all 3.3v outputs must not exceed 1A of current. It is generally adviced to stay well below this figure.
Do not exceed a current of 1.5A from the battery when the battery is connected to the internal battery connector
Do not charge the battery via the internal add-on port
2.2 - Tanmatsu: specifications
This section lists the technical specifications of the Tanmatsu hardware.
Note: information on this page is actively being worked on and might contain accidental errors and inaccuracies.
Physical dimensions
Size of the device including the 3D printed case:
Width: 12 cm (4.72 in)
Length: 13.5 cm (5.31 in)
Height: 1.8 cm (0.71 in)
Weight: 215 g (0.47 pounds) including case and battery
Note: display supports 16M colors (24-bit / RGB888) but current software can not make use of this mode.
Nicolai Electronics developed an ESP-IDF component for configuring the MIPI DSI peripheral in the ESP32-P4 for use with this display. The component also allows for easy switching between the display on the Tanmatsu and the display included with the official ESP32-P4 development kit.
The display will be available as a spare part from our webshop once Tanmatsu is shipped.
Keyboard
Full 69-key alphanumeric keyboard with colored 6 function keys
Metal dome sheet for tactile feeling
LED backlight (white)
The keyboard has been developed by our awesome friends at Solder Party.
The keyboard and corresponding metal dome sheet will be available as a spare part in our webshop once Tanmatsu starts shipping.
Battery
Single cell protected Lithium Polymer battery with PH-2.0 style connector. The connector and pinout are compatible with the battery connector on Adafruit boards.
Parameter
Value
Capacity
2500 mAh
Nominal voltage
3.7 V
Chemistry
Lithium Polymer
Dimensions
“104050” (w: 10mm, h: 40mm, l: 52mm)
Connector
JST compatible PH 2.0
Manufacturer
Tewaycell
Minimum cell voltage [V]
2.5v (3.0v recommended)
Nominal cell voltage [V]
3.7 V
Maximum cell voltage [V]
4.2 V
The battery will be available as a spare part in our webshop once Tanmatsu starts shipping.
Connectors and interfaces
On the outside of the case:
USB-C device port connected to an USB hub. Allows access to:
The ESP32-P4 USB interface (PHY 1, defaults to USB-serial/JTAG debug interface but can be remapped to custom USB functions by software)
ESP32-C6 USB-serial/JTAG debug interface
Personality module expansion port (provides access to an optionally connected USB device on a personality module)
USB-A host port (480 Mbit superspeed USB 2.0), provides 1A of current with automatic current limiting
Qwiic and Stemma-QT compatible 4-pin SH connector for connecting I2C and I3C accessories
3.5 mm headphone jack
CATT (Connect All The Things) connector: combined PMOD and SAO compatible 2.54 mm pinsocket optionally also usable as JTAG interface for debugging the ESP32-P4 application processor
Three push buttons (Power, up and down). Holding down the down button when applying power puts the ESP32-P4 into USB download mode for easy firmware recovery
Micro SD card slot compatible with SDIO 2 and SDIO 3 cards at 3.3v and 1.8v voltage levels
(optional) SMA antenna connector for LoRa antenna
On the inside of the case:
PH-2.0 2-pin battery connector
PicoBlade 2-pin speaker connector for 8 Ohm speaker
Raspberry Pi camera compatible 22-pin MIPI CSI camera interface
IPEX-1 antenna connector for LoRa antenna
Personality module connector: 36-pin 2.54 mm pinsocket with:
Access to power rails (5V, Vbatt, Vsys and 3.3v)
USB hub downstream port connected to the USB-C port via an USB hub
Internal I2C bus (can be used for sensors and for an identification EEPROM)
14 GPIO pins
ESP32-P4 USB interface (PHY 2) or 2 extra GPIO pins
UART interface or 2 extra GPIO pins
I2S interface or 4 extra GPIO pins (shared with audio codec, when used as GPIO audio functionality is unavailable)
I3C bus (shared with 4-pin SH connector) or 2 extra GPIO pins
Chips and modules
WiFi, BLE and IEEE 802.15.4 radio
Module: Espressif Systems ESP32-C6-WROOM-1-N8
CPU: 32-bit RISC-V single core microprocessor, up to 160 MHz
The management coprocessor is responsible for reading the keyboard matrix and power management. It presents itself as an I2C peripheral on the internal I2C bus of the Tanmatsu and provides the following services:
Keyboard events
PWM control for the display backlight
PWM control for the keyboard backlight
Real Time Clock (RTC) backed by watch crystal
Alarm wakeup
PMIC control
Power switching for USB-A port
Power and boot-mode control for the ESP32-C6 radio module
Power switching for audio amplifier
Headphone detection
Addressable LED control for the 6 built-in addressable LEDs
The firmware for this chip will be made available under terms of the MIT license after the product starts shipping to customers. Modifying the firmware is of course possible but is not recommended.
The firmware of the coprocessor can be updated from the ESP32-P4 application processor, for this Nicolai Electronics developed an ESP-IDF component capable of reprogramming CH32V20x and CH32V30x microcontrollers from the ESP32-P4 application processor.
LoRa radio
The PCB footprint supports a range of radio modules from Ai-Thinker. Software support will initially be provided for the RA-01SH 868 MHz band SX1262 based and the RA-01S 433 MHz band SX1268 based modules.
All Tanmatsu boards will be delivered with a module which has the IPEX-1 antenna connector installed. Optionally an SMA antenna connector can be installed to allow connecting standard external LoRa antennas. Tanmatsu will be provided with either an internal IPEX-1 antenna or a basic SMA antenna depending on the option chosen.
Audio
Everest Semiconductor ES8156 audio codec:
Hardware volume control via I2C interface
Stereo audio DAC
FM8002A mono speaker amplifier:
Can be switched on and off using the coprocessor
Connected to built-in 8 Ohm speaker
Power management
PMIC
Texas Instruments BQ25895RTW PMIC for battery charging and monitoring as well as DC/DC boost converter for 5 volt rail (to power USB-A port, addressable LEDs and 5 volt pin on the personality module expansion header).
Provides soft power on/off functionality when the device is battery powered and allows seamless transition between battery and USB-C power source.
3.3v rail DC/DC converter
Texas Instruments TPS63020DSJR DC/DC buck and boost converter providing a stable 3.3v rail even when the battery voltage drops below 3.3 volt.
Backlight drivers
Two AP3032KTR backlight driver chips, one for the display and one for the keyboard backlight LEDs. Brightness controlled using PWM via the CH32V203 coprocessor.
Standby power rail
A small LDO provides 2.5v to the Vbatt rail of the CH32V203 coprocessor even when the device is off. This uses almost no power (theoretically the battery would last over 10 years on a single charge if the device is never turned on, ignoring LiPo battery self-discharge) and allows the Real Time Clock in the CH32V203 coprocessor to keep track of time even when the device is off. A special latch circuit circuit allows the CH32V203 to power on the Tanmatsu using its alarm pulse output by emulating a press of the power button.
Addressable LEDs
Six SK6805-EC20 addressable LEDs controlled by the coprocessor.
Sensors
Bosch BMI270 IMU combined accelerometer and gyroscope
Header for optional SCD40 or SCD41 CO2, temperature and humidity sensor (not populated, modules are available on AliExpress) or other I2C controlled sensor
Questions?
If you have questions please contact us by joining one of our community chatgroups (Telegram and Discord) or by emailing us.
2.3 - Tanmatsu: 3D printed case
Information about the 3D printed case for Tanmatsu.
Note: information on this page is actively being worked on and might contain accidental errors and inaccuracies.
Filament
The 3D printed case and spacer are printed using Extrudr PLA NX2 on Prusa Mini and Prusa XL printers.
Design files
Once Tanmatsu is available the spacer and case designs will be published as STEP and STL files.
The 3D printed case and spacer will both be available as a spare part from our webshop once Tanmatsu is shipped.
Photos
These photos show some of the prototype 3D printed cases, final design will differ slightly because we are still actively working on improving the design for easier manufacturing and better dust protection.
Special thanks
We want to thank our friends over at YTec 3D for developing the Tanmatsu case and designs. Check out their amazing projects.
Questions?
If you have questions please contact us by joining one of our community chatgroups (Telegram and Discord) or by emailing us.
3 - Tanmatsu: software
Work in progress
The software for Tanmatsu is currently under active development. On this page we will regulary post updates on our progress. Don’t want to miss out on any updates? Join our Discord or Telegram groups.
Device drivers
The invisible though crucial part of all software running on Tanmatsu. These ESP-IDF components provide the building blocks for interfacing with the hardware on the Tanmatsu mainboard.
The Tanmatsu has a MIPI DSI display with a ST7701 controller. Espressif provides a driver for this controller, we added the correct initialization commands and configuration for the display on the Tanmatsu and packaged these in a component. In addition to the configuration of the Tanmatsu display the display included with the Espressif ESP32-P4 devkit is also supported by this component, allowing for easy switching between Tanmatsu hardware and the ESP32-P4 devkit.
Coprocessor
This driver component manages communication with the coprocessor firmware via I2C and exposes functions for accessing all coprocessor functionality.
ES8156 audio DAC
This driver component allows for configuring the ES8156 audio DAC via I2C.
BMI270 IMU
This driver component wraps the Bosch SDK for the BMI270 IMU, implementing communication via I2C for the ESP32-P4.
In circuit programming
These components are as invisible during normal use as they are useful when you need them. To do initial hardware bringup and to update the firmware of the coprocessor and the radio Tanmatsu needs a way to reprogram these chips from the ESP32-P4 application processor.
The BSP (Board Support Package) wraps the driver components to provide an easy way to integrate board support for Tanmatsu (and other devices) into ESP-IDF projects.
AppFS allows for dynamically installing and running ESP32 firmware from a special flash partition. This mechanism allows for installing and running apps directly from the Tanmatsu launcher.
The LVGL BSP interface is a component providing the glue needed to use the LVGL graphics stack component provided by Espressif with the BSP component, mapping the keyboard buttons and correctly configuring the display and display rotation.
AppFS is an ESP-IDF component that implements a method for dynamically installing and loading firmware binaries. It implements a pseudo filesystem interface for storing firmwares and a bootloader modification which allows for starting firmwares from the AppFS partition.
Originally AppFS was created by Jeroen Domburg (sprite_tm) for the PocketSprite keychain gameconsole. Since it’s creation Badge.Team has succesfully deployed, updated and extended AppFS to make it the ready to use component it is today.
The current version of AppFS supports ESP-IDF 5.3 and later and has bootloader modifications for the ESP32, ESP32-C6 and ESP32-P4 included. Other ESP32 variants are not supported yet.
Using the AppFS component in your projects
Apps do not require any changes to be started using AppFS, you only need the AppFS component to build a launcher menu.
To include the AppFS component in your launcher menu project first add the component as a requirement using idf.py:
idf.py add-dependency "badgeteam/appfs^1.0.0"
This makes the AppFS APIs available, but does not apply the required bootloader changes.
To apply the bootloader changes either create two symlinks or copy the contents of the folders.
#include "esp_err.h"
#include "esp_log.h"
#include "appfs.h"
void initialize_appfs(void) {
esp_err_t res = appfsInit(APPFS_PART_TYPE, APPFS_PART_SUBTYPE);
if (res != ESP_OK) {
ESP_LOGE(TAG, "Failed to initialize AppFS: %s", esp_err_to_name(res));
return;
}
}
See the functions defined in appfs.h for more information on how to use the library.
Partition table
The appfs.h header defines a type and subtype for the AppFS partition:
#define APPFS_PART_TYPE 0x43 /*<! Default partition type of an appfs partition */
#define APPFS_PART_SUBTYPE 0x3 /*<! Default partition subtype of an appfs partition */
To create an AppFS partition add an entry to the partitions CSV file for your project:
After ESP-IDF has downloaded the component a tools folder can be found at managed_components/badgeteam__appfs/tools. In this folder a set of Python scripts can be found for creating and managing AppFS partition data.
Creating an AppFS partition image
In the partition table above the partition is 8000 KB in size. Converted to bytes 8000 KB becomes 8000 x 1024 = 8192000 bytes.
A partition can be created using the following command:
python appfs_generate.py 8192000 example.bin
To add firmware binaries to the AppFS partition file the appfs_add_file.py tool can be used:
python appfs_add_file.py example.bin myapp.bin "myapp" "My app" 1
The name and title fields are strings. The filename (name field) of the file can be a maximum of 48 bytes long and the title of the file can be 64 bytes long. The version field is an 16 bits unsigned integer with a range of 0 - 65535.
The filename (name field) of the file is used in the AppFS API to identify files in the filesystem, filenames have to be unique. The title field is optional and may be used to include a human readable alternative to the filename. If unused the title field can be set to a blank string "". The version field is also optional and may be used to identify the installed version of an application, allowing for easier implementation of update mechanisms. If unused the version field can be set to 0.