WebUSB TYT radio firmware updates

Fri Jan 29, 2021

I got firmware updates through WebUSB working for 1st and 2nd gen TYT radios last night.

Bonus is that it covers a couple aspects of firmware updates that my old md380tools implementations, radio_tool, editcp, and others didn’t catch. Plus it’s cleaner. I also discovered a bug in radio_tool that I’ll see about fixing later.

WebUSB firmware updates opens up some really interesting possibilities, like easily testing OpenRTX, or md380tools, and easily flashing back to OEM. No software to install, nothing to compile, no drivers. It “just works”.

Does WebUSB still leave all the Windows and Firefox people out? Yep. Windows for the way it handles USB device drivers, and Firefox for not implementing WebUSB (Which is the correct decision overall, I think). Yes, this does kinda take the power out of the “no drivers” claim. I can’t do anything about that for now, though I do have a couple ideas on how to address that in the longer run.

One of the things I’ll make with this new capability is a recovery option - every once in a while, someone somehow gets a codeplug corrupted during a write and ends up with a random power-on password. None of the existing tools handle this for you, and this happenstance is the cause of the few “bricked” TYT radios you hear about. And if you were using the OEM software and had the same problem? Just screwed. Only modified third party software could handle it, but even then it was not easily available in those tools because it’s such a rare occurence.

The way to fix this corrupted password problem is to turn on the radio in firmware update mode (which is just the bootloader and doesn’t have any password functionality) and erase the codeplug flash sectors, which clears the powerup password. Write a new codeplug, and problem solved.