Fixing a problematic SONiX-based keyboard firmware flash with SONiX Flasher


On a quest to improve the key layout and combinations of my DK61 keyboard, I attempted to flash the stock firmware of several other SONiX-based Bluetooth keyboards - with varying success.

If you're fortunate, the flash will be successful and most keys will work as expected. If you're less fortunate, the keys will be borderline scrambled and practically unusable. If you're an idiot (read: me), the keyboard will not type at all. This is a problem.

There is a tool called SONiX Flasher that is lovingly supported by The Sonix Keyboard Hacking Community. This tool allows you to restart SONiX-based keyboards into bootloader mode, install QMK firmware (if supported), as well as crucially allow you to flash other firmware files (*.bin). This is very useful if you wish to flash back to stock firmware.

Framing The Problem

Tackling my keyboard issue seemed simple - just restart to bootloader mode and flash a firmware that I knew works (The Flashquark Horizon Z stock firmware worked well for my DK61 in the past). Unfortunately, there was another problem to tackle first.

I had attempted to flash the Akko 3061S RGB stock firmware to my keyboard. Successfully flashing with another keyboard's firmware changes the keyboard's hardware ID (VID/PID) to the keyboard of the flashed firmware. In my case, 05AC:024F became 320F:5025.

A photo of the terminal displaying the keyboard ID.

Out of the box, SONiX Flasher does not currently support the Akko 3061S RGB keyboard hardware ID. This means that when you open the tool, the device selection dropdown will be empty and a flash cannot be carried out.

A photo of SONiX Flasher displaying no supported devices.

Do not fear, for we can fix this by amending the SONiX Flasher Python source and building it.

Modifying SONiX Flasher

I opened up main.py and located the section which defines the supported devices. I simply added the Akko 3061S RGB keyboard hardware ID and saved the file.

A photo of the modified SONiX Flasher Python source.

I hopped over to Linux and executed run.sh after ensuring that I had Python 3 installed. The build began automatically. On completion, I was greeted with the keyboard selected in the device selection dropdown - success!

Crossing Fingers

The Akko 3061S RGB keyboard uses a VS11K09A-1 MCU chip, which is an EVision rebrand of the SONiX SN32F248B MCU chip. The DK61 keyboard has the HFD rebrand of this same chip - HFD2201KBA. This is important, as it dictates which option should be used to put the keyboard in bootloader mode.

I selected "Reboot to Bootloader [eVision]" with bated breath and was met with the keyboard going dark, which was a good indication that something was happening. I then selected "Revert to Stock Firmware" and navigated to the Flashquark Horizon Z stock firmware that I was previously using.

A photo of SONiX Flasher displaying a supported device.

The keyboard lit up and SONiX Flasher detected the Flashquark Horizon Z ID combination from the keyboard (05AC:024F). All was right in the world again and the experiments can continue!

Conclusion

I had thankfully saved my keyboard from the parts drawer. This situation emphasised the importance of keeping a working firmware backup handy in case things go south during the flashing process.