HOWTO: Fix the USB VID/PID on a Freecom DVB stick

A power cut scrambled the USB IDs on my Freecom DVB-T stick this morning… Freecom didn’t want to reply, the supplier just didn’t want to know (“your warranty is with Freecom, not us” – so much for the Sale of Goods Act). Anyway, here’s what I did to fix the VID/PID block on my DVB stick:

Note: this applies to the Freecom 25345-rev.3 DVB stick and may or may not work on others (e.g. the other Wideview WT220U clones with Cypress USB chipsets). Feel free to try this out, but if you bugger up your DVB stick beyond repair, you agree not to hold me liable for your cock-up. But of course, if your DVB stick is fried, you don’t exactly have anything to lose, do you? 🙂

OK, first you need the USB vendor and product ID your USB stick has adopted. Boot off a Linux LiveCD with the DVB stick plugged in by itself – that means NO OTHER USB DEVICES. Then as root run the command:
cat /proc/bus/usb/devices
Ignore all the crap about USB host adapters – what you’re looking for is a line like this:
P: Vendor=1402 ProdID=0255 Rev= 0.00
So we know the DVB stick has adopted the Vendor ID (VID) 0x1402, and the Product ID (PID) 0x0255. Shut down and reboot into Windows.

Rebooted yet? Good. Grab yourself a copy of the Cypress “CY4604 – USB Developer’s uStudio” and install it.

Now we need to do something a little fiddly. Go into C:\Program Files\Cypress\USB DevStudio\Driver, and open CyUSB.inf in Notepad. Search for this:

Note that the USB VID/PID spec line is commented out with a leading semicolon. Remove that semicolon, then do a search-and-replace over the entire file – replace VVVV with the USB vendor ID (without the 0x radix specifier) and PPPP with the Product ID you found earlier (again without the radix specifier). Save the file and close Notepad.

Now plug the DVB stick in. When windows asks for drivers, point it to C:\Program Files\Cypress\USB DevStudio\Driver – the Cypress driver will install.

Run Cypress CyConsole (Start, Programs, Cypress, USB, CyConsole). You should see the DVB stick in the device list. Select the device from the list, then go to Options -> EZ-USB Interface.

Click the “Select Mon” button, then select C:\Program Files\Cypress\USB DevStudio\CyConsole\FW\Vend_Ax.hex (this is the Cypress EEPROM Bootloader).
Click the “Load Mon” button to load the bootloader, and wait for the text to stop scrolling.

In the “Vendor Request” panel (with the “Vend Req” button on the left of it), enter the following values, in this order:
Req: 0xA2
Value: 0x0000
Index: 0x0000
Dir: 1 IN
Hexbytes: (empty)
Length: 256

Press the Clear button, then the Vend Req button. Copy and paste the contents of the log display into a text file.

Now look at the first line of the data that was returned, in my case this was:
0000 C0 02 14 25 02 00 00 08 FF FF FF FF FF FF FF FF

The first byte (C0) is the Boot Specifier – this tells the EZ-USB chip that the data in the EEPROM is a vendor/product ID pair.

The two bytes after that are the Vendor ID in low-byte/high-byte (little endian) order. The two bytes after those are the Product ID, again in little endian byte order. We need to fix these. I want my stick’s VID to be 0x14AA, and its PID to be 0x0225. That means I need to write the following data to the EEPROM:
C0 AA 14 25 02

Hit the Clear button again, and focus your attention on the Vendor Request panel once more. This time set these values:
Req: 0xA2
Value: 0x0000
Index: 0x0000
Dir: 0 OUT
Hexbytes: The data you want to write – in my case, C0 AA 14 25 02
Length: Should be 5, otherwise you’ve done something wrong.

Hit Vend Req again. Another line of text will appear at the end of the log – that’s the data that was sent to the bootloader.

Now set Dir to “1 IN” and clear the Hexbytes field. Set Length to 16 and hit the Vend Req button again. Another line will appear under the ‘data written’ line – it should look a bit like this now:
0000 C0 02 14 25 02
0000 C0 02 14 25 02 00 00 08 FF FF FF FF FF FF FF FF

As long as the first five bytes of the data are correct, you’re done. Unplug the USB stick, wait a few seconds for it to reset, then plug it back in again. Your USB DVB-T stick should now know what it is, and more importantly the drivers will recognise it again.