This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Tanmatsu

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.

tanmatsu

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: hardware

Annotated photo of back of PCB

WiFi, BLE and IEEE802.15.4 radio module

This 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.

Camera connector

The camera connector is used to connect a CSI camera mdoule. 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 compatile camera module sensor chips such as OV5647.

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.

USB-C device port

This port is used to charge the battery, to program and debug the ESpP32-P4 and ESp32-C6 microcontrollers and to install apps and browse files from your computer.

USB-A host port

This port can be used to connect an USB device to the Tanmatsu.

SD 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 propper constant voltage/current charge control are is built-in into the Tanmatsu mainboard.

Sensor connector

Can be used to connect an I2C connected sensor PCB.

1.1 - 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

Case

See case.

Peripherals

Display

  • Model: SWI LH397K-IC01
  • Size: 3.97 in diagonally, 51.84 x 86.40 mm
  • Resolution: 480x800
  • Colors: 65536 colors (16-bit / RGB565)
  • Controller: ST7701S
  • Interface: MIPI DSI (2 lanes)
  • Brightness: 330cd/m2

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 is shipped.

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.

  • Capacity: tbd (at least 2000 mAh)
  • Connector: PH-2.0
  • Chemnistry: Lithium polymer
  • Single cell 3.7 volt

The battery will be available as a spare part in our webshop once Tanmatsu is shipped.

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
  • RAM: 512 KB
  • WiFi: WiFi 6 on 2.4GHz
  • BLE: 5.3
  • Mesh networking: IEEE 802.15.4-2015 protocol, supports Thread 1.3 and Zigbee 3.0
  • Flash: 8 MB

More information can be found in the Datasheet.

Application processor

Chip: Espressif Systems ESP32-P4NRW32

  • CPU: 32-bit RISC-V dual core microprocessor, up to 400 MHz
  • RAM: 32 MB
  • Flash: 16 MB

The datasheet for this chip is not yet publicly available

Management coprocessor

Chip: WCH CH32V203C8T6

  • CPU: 32-bit RISC-V single core microprocessor, up to 144 MHz
  • RAM: 20KB
  • Flash: 64 KB

More information can be found in the Datasheet.

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.

1.2 - 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.

2 - 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.

ComponentStatusRepository
MIPI DSI displayPublishedesp32-component-mipi-dsi-abstraction
CoprocessorIn progressesp32-component-tanmatsu-coprocessor
ES8156 audio DACPublishedesp32-component-es8156
BMI270 IMUIn progressesp32-component-bmi270

MIPI DSI display

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.

ComponentStatusRepository
RVSWD for CH32V203Publishedesp32-component-rvswd
ESPTOOL² for ESP32-C6Proof of concept

Tools

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.

ComponentStatusRepository
BSPIn progressesp32-component-badge-bsp
AppFSPublishedesp32-component-appfs
LVGL BSP interfaceIn progress

2.1 - AppFS

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.

mkdir bootloader_components
ln -s managed_components/badgeteam__appfs bootloader_components/appfs
ln -s managed_components/badgeteam__appfs/bootloader_main bootloader_components/main

The component is now ready for use.

#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:

# ESP-IDF Partition Table
# Name, Type, SubType, Offset,   Size,
appfs,  0x43, 3,       0x330000, 8000K,

AppFS partition tools

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.