QMK firmware for TEX keyboards

TEX Shinobi BLE5 → QMK port notes

How the port works and what it rests on. Owner-facing install notes are in README.md.

v1.0 (2026-11-04) builds with qmk_firmware at qmk_firmware.commit, arm-none-eabi-gcc 13.2.1 and QMK CLI 1.2.0, after tools/patch_qmk_tree.sh. The default image is 28,072 bytes, linked at 0x3200. Its vector table is at 0x3200, startup writes 0x3200 to VTOR before __early_init, the USB device is 04D9:0407, and RAM ends at 0x20003FE0, so the IAP magic word at 0x20003FFC is never touched.

Evidence labels: [O] observed in the stock code or data, [I] inferred, otherwise unknown. All of it comes from Ghidra and scripts over the decrypted stock app image (AP_0407 V1.04.04), plus tests on one keyboard. Addresses like FUN_893c or 0x9DCB are in that image, base 0x3200.

Has anyone done this?

No public QMK, Vial or other open firmware for the Shinobi turned up (GitHub, the QMK and Vial keyboard trees, web search, 2026-10-30). Community work so far replaces TEX’s online configurator for the stock .TEX files: rianmcguire/tex-shinobi-offline, garzoc/tex_yoda_2_configurator, dormema/texnologia. TEX staff said on KeebTalk that they tried QMK but had problems with the TrackPoint. The closest precedent is QMK’s annepro2: same Holtek HT32F523x2 family, stock IAP kept, BLE module on a UART.

Hardware map

Item Value Evidence
MCU Holtek HT32F52352, LQFP-64. Stock IRQs match the HT32F52342/52352 registry and the stack at 0x20003FE0 means 16 KB SRAM. TEX (2026-11-03) wrote “HT50F52352 LQFP 64PIN”; no HT50F52352 is known, so that is read as a typo for HT32F52352 [O] IRQs/stack, TEX for package, [I] typo
Clock No crystal: 8 MHz HSI → PLL ×6 = 48 MHz; 1 flash wait state; HSI auto-trim on when USB starts (HSICR = (HSICR & ~0x30) \| 0x23) [O]
Flash map IAP 0x0000-0x2FFF, version block 0x3000, app 0x3200 (VTOR) [O]
IAP entry 0x55AAFAF5 at 0x20003FFC, USB IRQ off, ~30 ms, reset (FUN_6528); IAP enumerates as 04D9:1407 [O], PID seen live
Matrix Rows A1-A8 (inputs), cols D2 B8 B11 D0 B13 B14 A15 A14 A10 C14 C15 B15 C0 A11 C13. Stock drives cols high and reads rows; QMK COL2ROW [O] pins, [I] diode direction
DIP switches Six switches (Mauro counted them, 2026-11-13) on column 14 (C13), rows 0-5; stock never reads rows 6-7 there, and QMK reads rows 0-5 only. Switches 1-3: exactly one closed = profile 1-3, else 0; defaults 1 Fn/Ctrl swapped, 2 Mac, 3 both. 4 Fn scroll and 5 reverse scroll are read from v1.1; 6 (file system) isn’t ported [O] FUN_8598, FUN_4948
Keymap 0x9DCB (14×8, index col×8+row); Mac swap 0x9E5A; Fn tables 0x9E62 (actions), 0x9E7C (codes) [O]
Fn Code 0xD8, placed on positions 48 and 70 by default; 70 is the TrackPoint middle button (the “weird mouse buttons” users report) [O] positions, [I] which key
Codes <0xE0 HID usages; 0xEC-0xFD = consumer bits in order (report 2: 0x183, Mail, Calc, MyComputer, Play, Stop, Prev, Next, Mute, Vol−, Vol+, AC Search/Home/Back/Fwd/Stop/Refresh/Bookmarks); 0xC8/0xCA/0xC9 = mouse left/right/middle [O]
TrackPoint PS/2 CLK B3, DATA in B4 (SPI0 slave), DATA out B5 (open drain), power C8 active low (switches TPM_PWR through Q2). B5 reaches TP_DATA through R2; stick on header J1 (1 power, 2 data, 7 GND, 8 clock), middle button via J2. Sensitivity E2 81 4A <v>, levels 66 73 80 8F A0 B3 C9 E1 FC. IBM TrackPoint spec v4.0: E2 81 XX YY writes RAM, 0x4A = sensitivity, 0x80 = 1.00× (0x00-0xFF = 0-1.99×), kept across FF reset and F6; F0 = remote mode; POR 600 ms ±20 %; E1 returns 01 + version byte [O], schematic for nets, spec for semantics
Caps Lock LED C10, active low [O]
Other LEDs C4 = LOW_LED, C5 = PAIR_LED (table 0x9D83). Both go to the BLE board through J3, so the LEDs sit there [O] pins, schematic for names
BLE module Nordic nRF52810-QCAA (QFN32) on a separate board on connector J3; pinout below. USART0 TX B0 → module RX, RX B1 ← module TX, 500 kbaud, DMA. Stock pulses D1 (FROM_MCU) in its wake routine 0x5a22; the module reset is C1, not D1 TEX for chip, schematic for pins, [O] for USART0 use
Battery sense BAT_PWR from the BLE board (J3.9) → R7 → A0, with R11/C8 (divider into the ADC) schematic
Wake input B12 WAKEUP = diode-OR of TO_MCU (D202) and USB power detect (D201) schematic
Pair button Matrix [5,9], stock code 0xC7 (held 3 s alone queues E0). J3.13 is row 5 and J3.14 PAIR reaches column 9 through D101, so the key is on the BLE board schematic, [O] code, [I] button
SPI memory U3, SO-8 drawn as a 25010 SPI EEPROM (part not confirmed). SCK C2, MOSI C3, MISO B6, CS B7 (SPI_SEL). The earlier CS A9 guess is contradicted: A9 is the BOOT pin, on R21/SEL1. Stock profiles at (profile+1)×0x1000 schematic, [I] offsets
SWD Header CN2 “Program Pin”: 1 VDD33, 2 SWDIO (A13), 3 SWCLK (A12), 4 nRST, 5 GND. Stock never touches A12/A13 schematic, [O]

J3, MCU ↔ BLE board (schematic)

Every signal goes through a series resistor (R42-R55); pins 15-22 are not connected. Names are from the schematic, so BT_RX is the module’s receive line.

J3 Net MCU / other end
1 BT_RX B0 (USART0 TX)
2 BT_TX B1 (USART0 RX)
3 TO_MCU B10, and the B12 wake line through D202
4 FROM_MCU D1
5 RESET_N C1
6 BT_BOOST Q1 → VDD33 (the BLE board powers the keyboard on battery)
7 VDD33 3.3 V
8 USB_VCC USB 5 V
9 BAT_PWR A0 battery divider
10 LOW_LED C4
11 PAIR_LED C5
12 VSS ground
13 KB_R5 matrix row 5 (A6)
14 PAIR matrix column 9 (C14) through D101

Source: TEX’s hot-swap schematic (OrCAD Capture, rev 1.1), which TEX shared for this port. It is TEX’s document, so it is not in this repository. Pin index = physical pin was checked three ways: the VDD/VSS pins land on the symbol’s power pins, all 15 matrix columns and 8 rows match the firmware, and so do the TrackPoint (B3/B4/C8) and Caps Lock (C10) pins. Whether the board being ported is the hot-swap variant is not confirmed; every pin the firmware uses matches it, except that the SPI CS guess was wrong.

The BLE board as the host sees it (GATT, read 2026-11-03)

Read-only GATT dump of a paired keyboard (WinRT) [O]:

What the firmware does

Flashing

The stock IAP at 0x0000-0x2FFF is kept and does all erasing and writing. Neither the updater nor this repository contains it.

Decoded from the stock firmware (MCU side) and from the nRF52810 image in TEX’s BLE5 updater 521_BT_for407_0.10_20230914 (module side: container “.maaV106”, header = last 0x830 bytes, the same 52-byte XOR key). What ble.c relies on:

Power

power.c, after stock:

Can it be flashed over Bluetooth?

Stock: probably only halfway. The app accepts the vendor commands 0x11 (enter IAP) and 0x12 (info) from the BLE module’s UART link as well as USB (FUN_8000 → FUN_7dd4 → FUN_893c) [I strong]. So rebooting into the updater wirelessly likely works. But erase and write are done by the IAP at 0x0000-0x2FFF, which is not in the update package, and the only update path ever observed is USB (re-enumerates as 04D9:1407). Whether the IAP can take an image through the BLE module is unknown until the SWD dump.

QMK: no. Updates go over USB through the stock IAP, or over SWD. Wireless updates would need a new bootloader.

QMK tree patches

tools/patch_qmk_tree.sh changes two things in the QMK checkout:

Developer test builds

Keymaps that only exist for bring-up, each a rules.mk flag on top of default:

Open questions