These notes come from analysing the original firmware 012 so that the custom firmware could be built and the pedal configured with our own tools. The page describes formats, algorithms and addresses. It contains no M-VAVE or JieLi code (see what is not published). All numbers refer to the original firmware 012 unless noted.
- Device and chip
- .fwsc file (Sinco wrapper)
- .ufw container (JieLi)
- Members of firmware 012
- flash.bin and the app area
- Scrambling, encryption and key
- Checksums
- Memory map and functions
- Footswitch handling
- Display, battery, status LED
- Bluetooth services
- Control protocol and settings
- Firmware update (OTA)
- USB download and recovery
- Pitfalls we hit
- What is not published
Device and chip
| Product | M-VAVE Chocolate Plus, Bluetooth name and firmware name FootCtrlPlus, board marking PD41 V04 |
| Chip | JieLi AC636N (BR25 family), CPU core pi32v2, internal flash, Bluetooth LE + Classic |
| Original firmware | FootCtrlPlus_012 (version 012). Distributed as FootCtrlPlus_012.fwsc (583476 bytes) |
| Update tools | SincoOTA (Android) and the CubeSuite app, both over Bluetooth LE |
| Development tools | JieLi toolchain 2.5.3 (clang for pi32v2) and the public JieLi AC63 SDK (github.com/Jieli-Tech/fw-AC63_BT_SDK), which matches the firmware's structure |
| Display | 3-digit 7-segment display, driven through a 74HC164 shift register |
| Mode switch | U / O / H: U = USB, O = off, H = host (USB and Bluetooth). U is also used to force USB download mode. |
.fwsc file (Sinco wrapper)
A .fwsc file is a JieLi .ufw file with 20 extra bytes woven in: after every 47 bytes of the
.ufw, one metadata byte is inserted, 20 times. The rest of the file follows unchanged.
Removing bytes 47, 95, 143, … (every 48th byte, 20 times) gives the original .ufw.
- The 20 metadata bytes hold the name
<name>_<version><suffix>, padded with@. - Each name character is stored as
char + i + 1(i = position, 0-based), padding is stored as is. Example 012: storedGqrxHzytYv…→FootCtrlPlus_012. - SincoOTA decodes the name with the length of the file name, so the file must keep its name
(e.g.
FootCtrlPlus_142-dtnprt.fwsc). A renamed file is rejected or misread. - The version digits in the name are what the apps show as firmware version; they must be digits only.
.ufw container (JieLi)
All numbers little-endian. The 64-byte header and every table entry are scrambled (see scrambling); the members themselves are stored at their offsets.
Header (0x40 bytes, scrambled)
| Offset | Type | Meaning | 012 |
|---|---|---|---|
0x00 | u16 | header CRC over header bytes 0x02..0x3f (descrambled) | 0x0002 |
0x02 | u16 | table CRC over the table as stored (scrambled) | 0x9ac1 |
0x04 | u32 | total file size | 583456 |
0x08 | u16 | number of members | 8 |
0x10 | char[] | chip name | AC636N |
Member table (count × 0x50 bytes from offset 0x40, each entry scrambled on its own)
| Offset | Type | Meaning |
|---|---|---|
0x00 | u8 | flag/type byte (differs per member, meaning not needed) |
0x02 | u16 | member index |
0x04 | u16 | member CRC (CRC-16 over the stored member bytes; verified for the code members) |
0x08 | u32 | offset in the file |
0x0c | u32 | size |
0x10 | u32 | size rounded up (alignment) |
0x40 | char[16] | member name |
Members of firmware 012
| # | Name | Offset | Size | Content |
|---|---|---|---|---|
| 0 | flash.bin | 0x00400 | 161280 | the application (boot header + encrypted app area) |
| 1 | info.log | 0x27a00 | 0 | empty |
| 2 | isd_config.ini | 0x27a00 | 4390 | download/flash configuration (encrypted text, contents) |
| 3 | ota.bin | 0x28b40 | 252636 | update loader that the pedal runs during an update |
| 4 | script.ver | 0x66620 | 27 | version script |
| 5 | flash2.bin | 0x66640 | 163840 | second copy of the application for the update bank (same code as flash.bin) |
| 6 | blimit.bin | 0x8e640 | 144 | small binary block (purpose not analysed) |
| 7 | tail.bin | 0x8e6e0 | 64 | trailer |
A patch has to change flash.bin and flash2.bin identically; the other members stay untouched.
flash.bin and the app area
flash.binstarts with a 0x1000-byte boot header in plain form (it contains the chip ID stringAC636N_TRANSat 0x10).- From offset 0x1000 follows the app area, encrypted (see key).
Decrypted, app-area offset 0 is CPU address
0x01e00000(code runs from flash at this address).
App area layout (decrypted)
| Offset | Content |
|---|---|
0x00 | area header: u16 header CRC over 0x02..0x1f, u16 data CRC over 0x20..area_len,
u32 area length at 0x08 (012: 0x26410), name app_area_head |
0x20 | entry for app.bin: u16 header CRC over 0x22..0x3f, u16 code CRC,
u32 code address 0x24 (012: 0x120), u32 code length 0x28 (012: 0x25f90), name app.bin |
0x120 | application code; entry point 0x01e00120 |
Scrambling, encryption and key
Both layers use the same JieLi LFSR (linear feedback shift register, 32-bit state); the keystream byte is
the low byte of the state after each step. Both are plain XOR, so the same function encrypts and decrypts.
A reference implementation is lfsr_next() in firmware/fwsctool.py of the
repository; the browser patcher contains the same in JavaScript.
Header and table scrambling
- Applied to the 0x40-byte
.ufwheader and to each 0x50-byte table entry separately. - Byte 0 is inverted (
~b); bytes 1… are XORed with the keystream, state seeded with0xffff.
Member encryption (the key)
- Works in 32-byte blocks. For each block the state is seeded with
key XOR (pos >> 2); byte 0 of the block is XORed with the seed's low byte, the following bytes with the keystream; thenposadvances by 32. posis a start value per member (address-like), not the offset in the file.
| Data | Key | Start pos |
|---|---|---|
App area = flash.bin from 0x1000 (same for flash2.bin) | 0x180f | 0x20000 |
isd_config.ini | 0x180f | 0x7a00 |
Check: with the right parameters the app-area CRC chain verifies and the text app.bin appears at 0x30.
Our first attempt with other parameters (0x9d0f / 0x1400) decrypted only about 40 % of the blocks correctly.
Checksums
All checksums are CRC-16/XMODEM (polynomial 0x1021, start value 0, no final XOR). After changing code,
they must be rebuilt in this order:
app.bincode CRC (entry0x22), then the entry's header CRC (0x20)- app area data CRC (
0x02), then the area header CRC (0x00) - re-encrypt the app area, member CRC in the
.ufwtable entry (re-scramble the entry) - table CRC and header CRC in the
.ufwheader (re-scramble the header) - wrap as
.fwscwith the name of the new file
Self-test used by build.py: rebuilding the chain on the unchanged original must reproduce it byte for byte.
Memory map and functions
CPU addresses in firmware 012. Names are our own.
| Address | What |
|---|---|
0x01e00000 | start of the app area in the CPU address space |
0x01e00120 | application entry point |
0x1e11cf2 | 5 ms poll: footswitches and display refresh (registered with a 5 ms timer) |
0x1e122f6 | disp3(c0, c1, c2): show 3 ASCII characters |
0x1e189df / 0x1e18c74 | 7-segment font: digits / letters (upper and lower case share one table) |
0x1e0e4a0 | vbat_percent(): battery 0…100 %, linear up to 4.20 V |
0x1e12970 | 20 ms status-LED timer (blink 400 ms / steady) |
0x1e1271e / 0x1e12706 | Bluetooth off / on (stock B+C hold ~2 s) |
0x1e18c8e | 27-byte slot with the name/version reply FootCtrlPlus_012 |
0x1e144ca | call that draws the first screen after start (hook for the boot greeting) |
0x1e04a84 | Bluetooth pairing-record function: looks unused but is reached indirectly. Never overwrite. |
0x1e11b06 | USB EP0 send function (descriptors during USB detection): looks unused but is reached through a pointer. Overwritten up to 141, so USB-MIDI was not detected. Never overwrite. |
0x1e00406 | timer period change (1 s), called by the LRC clock calibration timer 0x1e15a40 |
0x1e19308 | 32 bytes 0xff: start values of the Bluetooth link scheduler 0x1e1cc1c |
0x1e13a7e / 0x1e13a9a | start screen of modes 2 / 3 (000), drawn ~5 ms after power-on |
0x193a0 + 0xf4 | RAM: u32 display content (left digit in bits 16-23) |
0x13490 + 0x5c63 | RAM: Bluetooth-off flag (LED stays dark while set) |
Free space for patches
The flash is almost full. Used for the patches: the timer function at 0x1e00406 (104 bytes; its only caller
is removed), the 0xff block at 0x1e19308 (32 bytes; its only reader is pointed to another
0xff block) and the 0xff padding at 0x1e26088 (40 bytes).
"No reference found" does not mean free. Code reached through function pointers has no visible caller:
0x1e04a84 (Bluetooth pairing) and 0x1e11b06 (USB, see above) both looked unused.
Footswitch handling
Each switch has a small state machine in the 5 ms poll:
- idle → pressed for D consecutive ticks → pending (counter = 0)
- pending → still pressed when the counter reaches F → pressed, press event sent
- pending → released before F → back to idle, no event
The pending window exists to detect two switches pressed together (A+B, C+D combos). Original values: D = 4, F = 15 ticks.
- Press latency (4 + 15) × 5 ms ≈ 95 ms.
- Any tap shorter than that was silently lost (case 3).
Custom firmware: D = 3, F = 6 (≈ 45 ms, combo window 30 ms), and a released switch in the pending state goes to the press path, so short taps send press + release.
Bank number bug (advanced custom mode)
The displayed bank was counted up/down from its own value instead of the saved bank index. After power-on it started at 0, and bank-down showed an invalid bank (255). The selected presets were always correct, only the number was wrong.
Display, battery, status LED
- Segments (one byte per digit): a = bit 6, b = bit 3, c = bit 2, d = bit 0, e = bit 1, f = bit 7, g = bit 4, dot = bit 5.
- The 5 ms poll shifts the segment byte into the 74HC164 (data GPIO 0x16, clock GPIO 0x15) and selects one of the 3 digits per tick.
- The font has no K, M, V, W, X, Z (blank).
Ucan stand in for V,nfor M. - Status LED on PA0. Port A registers at
0x1e5000: OUT +0, IN +4, DIR +8 (1 = input), pull-up +0x10, pull-down +0x14. The pull-up alone is too weak to light the LED; dimming works by driving it in one of the three digit slots (1/3 duty, ~67 Hz). - Holding B+C for about 2 s switches Bluetooth off and on (not the LED); the LED is dark while Bluetooth is off.
Bluetooth services
| Purpose | Service | Write | Notify |
|---|---|---|---|
| Sinco control protocol (settings, identity) | ae40 | ae41 | ae42 |
| JieLi update protocol (OTA) | ae00 | ae01 | ae02 |
| Firmware version | 180a Device Information | - | 2a26 (read) |
16-bit UUIDs in the Bluetooth base UUID (0000xxxx-0000-1000-8000-00805f9b34fb). The apps find the pedal by its exact
name FootCtrlPlus, so the name must not be changed.
Control protocol and settings
Frame (all numbers little-endian):
00 59 | cmd | length (u24) | payload | checksum checksum = ~(sum of payload bytes) & 0xff
| cmd | Meaning | Payload |
|---|---|---|
0x11 | name + version | - (reply NAME_VVV…, e.g. FootCtrlPlus_012) |
0x13 | firmware version | - |
0x15 | send MIDI | raw MIDI bytes |
0x17 | device type | - |
0x21 | erase | type (u8), address (u32) |
0x22 | write | type (u8), address (u32), n (u24), data[n] |
0x23 | read | type (u8), address (u32), n (u24) |
Memory types: NOR = 0, NAND = 1, SD = 2, EFF = 3, DEV = 4 (settings), USR = 5, RAM = 6.
Settings block (DEV, address 0, 23646 bytes)
| Offset | Size | Field |
|---|---|---|
| 0 | 1 | mode (0…12) |
| 1 | 1 | TRS MIDI on/off |
| 2 | 1 | MIDI channel (0…16) |
| 3 | 10 | user values [5][2] |
| 13 | 80 | tap MIDI codes [16] |
| 93 | 13344 | advanced custom: 8 banks × 4 switches, 417 bytes each |
| 13437 | 72 | custom keys [6][4][3] |
| 13509 | 10128 | mixed keys [6][4], 422 bytes each |
| 23637 | 3 | bank maximum [3] |
| 23640…23645 | 6 | user page, HID page, polarity, bank MIDI, PC display, mix page |
MIDI code = 5 bytes: enabled, channel, type, data1, data2. Advanced-custom entry (417 bytes) = mode + 16 MIDI codes (A) + 16 MIDI codes (B) + SysEx A (128) + SysEx B (128). The Web Config uses exactly this protocol.
Firmware update (OTA)
The update uses JieLi's RCSP protocol on service ae00, as documented in the public JieLi SDK.
FE DC BA | flags | opcode | length (u16, big-endian) | [status] | sequence | parameters | EF
flags: bit 7 = command, bit 6 = reply wanted
| Opcode | Meaning |
|---|---|
03 | target info (capabilities, single/dual bank, MTU) |
E1 | where the firmware info is in the file (offset, length) |
E2 | can the device update with this file? (0 = yes) |
E3 | enter update mode |
E5 | device requests a block (offset u32, length u16); the host answers with those file bytes |
E6 | update result |
E7 | reboot |
E8 | total size |
0B | change communication way (reconnect) |
Two phases (the pedal is single-bank with an update loader)
- E1 → E2 → the device pulls the loader (
ota.bin) with E8/E5 → E6 →0B: the pedal restarts into its update loader. - Reconnect, the device now reports "mandatory upgrade" → E1 → E2 → E3 → E8/E5 for the whole file → E6 = 0 → E7 reboot.
If phase 2 is interrupted, the pedal stays in its loader and can be flashed again (SincoOTA → Mandatory upgrade). The loader itself is never overwritten, so the original firmware can always be restored this way.
Connection authentication
Before any command, app and pedal authenticate each other: each side sends a 16-byte random challenge, the other answers with
the Bluetooth legacy E1 function (SAFER+) computed with a fixed key from JieLi's library, then both confirm with pass.
The key is not published here (see below).
USB download and recovery
- Normal recovery: flash the original
FootCtrlPlus_012.fwscwith SincoOTA. Works as long as the pedal starts Bluetooth. - Last resort: the chip's ROM bootloader accepts a full flash download over USB with JieLi's download tool, independent of the app.
- The decrypted
isd_config.iniof 012 describes the flash setup: chipAC636N, entry0x1E00120, product IDAC636N_TRANS, download over USB, reset/download pinPB01, UARTPB05, 39 settings in total. - The chip also has a JTAG debug interface on the board.
Pitfalls we hit
- Wrong decryption parameters give plausible-looking but partly garbled code. Always verify with the CRC chain.
- "Unused" code is not always unused: a function without direct calls (
0x1e04a84) is reached through a pointer when a Bluetooth pairing is stored. Reusing it as free space crashed the pedal on pairing. - Both copies:
flash.binandflash2.binmust carry the same patch. - Name matters: the
.fwscmust keep its file name, and the Bluetooth name must stayFootCtrlPlus. - LED via pull-up is too dark; it has to be driven as output.
- Pairing: for updates the pedal must not be paired with the phone.
What is not published
This page only contains facts about formats, interfaces and addresses, found while making the pedal work with our own software. On purpose it does not contain:
- M-VAVE's or JieLi's firmware, tools or apps, in whole or in part (no downloads, no hex dumps of their code)
- disassembly listings or decompiled source code of the firmware or the apps
- vendor manuals, documents or screenshots
- the authentication key of the update protocol
- addresses of non-public vendor servers
The original firmware is available from M-VAVE: Chocolate Plus product page. Not affiliated with M-VAVE, Sinco or JieLi. All product names belong to their owners.