For just getting the firmware, the patcher on the firmware page is
easier: it does exactly the same in your browser. This page is for the command line, for checking what the patch does,
and for changing the patch code. Everything starts from the original M-VAVE firmware 012, which is not included here:
download FootCtrlPlus_012.fwsc from the M-VAVE Chocolate Plus page.
Patch with Python
- Install Python 3 from python.org (on Windows tick Add python.exe to PATH during setup). No extra packages are needed.
- Download the original firmware 012 (
FootCtrlPlus_012.fwsc) from the M-VAVE Chocolate Plus page. - Download the patch script: chocolate-plus-re (ZIP) and unpack it.
You need the two files
build.pyandfwsctool.pyfrom itsfirmwarefolder. - Copy
FootCtrlPlus_012.fwscinto thatfirmwarefolder. - Open a terminal in that folder (Windows: type
cmdin the Explorer address bar and press Enter) and run:
On macOS and Linux usepython build.py FootCtrlPlus_012.fwscpython3instead ofpython. - The script first checks that your file is exactly the original firmware 012, and stops with an error for
any other file (another version, an incomplete download, or an already patched file). Then it applies the patches and writes
FootCtrlPlus_142-dtnprt.fwscinto the same folder:OK: FootCtrlPlus_012.fwsc is the original firmware 012 written: .\FootCtrlPlus_142-dtnprt.fwsc SHA-256: eadd20b993b149753651f83a683d1af25fb4f966d340e0b269a33b300f2e3ba2 Identical to the official build. Flash it with SincoOTA (do not rename the file). - Flash
FootCtrlPlus_142-dtnprt.fwscas described on the firmware page.
Options
-o <folder> | output folder (default: the current folder) |
--extras | also write the .ufw (firmware without the Sinco wrapper), the decrypted patched
app area FootCtrlPlus_142-dtnprt_app.bin and the decrypted original app area
FootCtrlPlus_012_app.bin (offset 0 = address 0x01e00000, input of gen_table.py) |
Checks on every run
- Input: SHA-256 must be the original firmware 012 (
9deb9d90691415aa7f4514103842237a1500c681db34fe35e5f5136d173cb3bc, or the.ufwinside it). - The original checksums must verify, and rebuilding the checksum chain of the original must reproduce it exactly.
- Every patch location must contain the expected original bytes before it is changed.
- Output: compared with the official build
eadd20b993b149753651f83a683d1af25fb4f966d340e0b269a33b300f2e3ba2.
Changing the patch code: JieLi toolchain
Only needed to change the assembler code of the patches. The assembled bytes are already
contained in build.py, so building the firmware itself needs no toolchain.
The pedal uses a JieLi AC636N (CPU core pi32v2); its compiler is the free JieLi toolchain.
Download (JieLi toolchain 2.5.3)
| Linux / WSL | jieli-linux-toolchains-20260730.1.tar.xz (26 MB) - used by the scripts here
SHA-256 a1545cddbc451a06bac43eb5cd96d831470c42a97c5c0b1f98879a20fc7647bd |
| Windows | 2.5.3.exe (53 MB, installer for the JieLi SDK build environment) |
| Official page | doc.zh-jieli.com: tool versions (Chinese; newer versions may appear there) |
Install (Linux, or WSL on Windows)
mkdir -p ~/jltc
tar -xJf jieli-linux-toolchains-20260730.1.tar.xz -C ~/jltc
~/jltc/jieli-linux-toolchains-20260730.1/pi32v2/bin/clang --version
The scripts expect it in ~/jltc/jieli-linux-toolchains-20260730.1. Elsewhere: set
JL_TOOLCHAIN=/path/to/jieli-linux-toolchains-20260730.1.
Workflow
- Get the repository (ZIP or
git clone https://github.com/dtnprt/chocolate-plus-re.git). Everything below runs in itsfirmwarefolder. - Create the decrypted original app area (needed to check the original bytes at each patch location):
python3 build.py FootCtrlPlus_012.fwsc --extras -o work - Edit the patch code:
patch_src/greet.s(boot greeting, bank display, status LED) with the addresses inpatch_src/greet.ld. The footswitch tap fix is inpatch_src/cave.s+link.ld. - Assemble and link; the script prints the disassembly and the section addresses:
bash patch_src/asm_greet.sh - Copy the new bytes, together with the original bytes they replace, into the
GREETtable ofbuild.py:python3 patch_src/gen_table.py work/FootCtrlPlus_012_app.bin - Set a new
VERSIONinbuild.py(3 digits, also shown on the pedal) and build:
The result now differs from the official build, so the script prints a warning instead of "identical".python3 build.py FootCtrlPlus_012.fwsc --extras -o work - Check the patched code:
~/jltc/jieli-linux-toolchains-20260730.1/pi32v2/bin/objdump -d -print-imm-hexon the patched app area (or loadwork/FootCtrlPlus_*_app.binat0x01e00000in a disassembler).
What the patch changes
Applied identically to both firmware copies in the file (flash.bin and the
update bank flash2.bin). Addresses are CPU addresses (app area offset + 0x01e00000).
| Patch | Where | Original | Custom |
|---|---|---|---|
| Footswitch debounce | if (r1 < 4) @ 0x1e12034 | 4 ticks | 3 ticks (5 ms each) |
| Pending / combo window | if (r1 < 0xf) @ 0x1e12090 | 15 ticks | 6 ticks |
| Short taps not dropped | call 0x1e26088 @ 0x1e12002 + 24-byte cave in free space |
taps under ~95 ms lost | press + release sent |
| Name / version reply | 27-byte slot @ 0x1e18c8e | FootCtrlPlus_012 | FootCtrlPlus_142-dtnprt |
| Boot greeting | hook @ 0x1e144ca → greet | normal screen | blank, then version, battery percent and mode |
| Start screen | modes 2/3 @ 0x1e13a84 / 0x1e13aa0 | 000 | blank |
| Space for the patches | call @ 0x1e15b06 removed; 0x1e1cc26 → 0x1e00100 |
timer function / 0xff block in use | freed (LRC calibration keeps its 10 ms period) |
| Status LED dimmed | LED timer @ 0x1e129ee, display timer @ 0x1e11d78 | on = always lit | lit 1/3 of the time at ~67 Hz |
| Advanced custom mode screen | 2 places @ 0x1e13064 / 0x1e13370 → bank_sw |
0xy (2-digit bank, switch A-D) | x-z (bank, -, switch 1-4) |
Press latency: ~95 ms original, ~45 ms custom. A+B / C+D combos still work (30 ms window).
File format and checksums
.fwsc= Sinco wrapper around a JieLi.ufw: one name byte after each 47 bytes, 20 times.- The
.ufwheader and file table are scrambled with a 16-bit LFSR; each member has a CRC-16 (XMODEM). - App area =
flash.binfrom offset0x1000, encrypted in 32-byte blocks (LFSR, key0x180f, position0x20000). - Inside the app area:
app.binentry @0x20(header CRC + code CRC) and the area header @0x00(header CRC + data CRC).build.pyrecomputes the whole chain: area, member CRC in the file table, table CRC, header CRC, then wraps it as.fwscagain.
Full notes (file formats, key, memory map, display, protocols): Firmware analysis.