Using TinyUSB's USB stack with WCH CH568 USB to SATA chip


Updated: 04/25/2020 - Initial page created (project work was done in early 2019)

A replacement interface controller for Sony's VGP-XL1B media changer

I was interested in converting Sony's VGP-XL1B FireWire DVD changer to Blu-ray and in that process I was thinking of replacing the FireWire to IDE chip with a USB to SATA chip. I found a few chips, such as TI's TUSB9261, but getting an SDK and datasheet is impossible for a hobbyist. This lead me to the chinese company WCH who produces many small MCUs including a USB to SATA controller chip. The chip is WCH CH568, unfortunately it is nearly impossible to purchase from any online distributor I could find. Determined, I contacted them to ask about a development board for the chip. Using Google translate I had them FedEx me one for free, plus $100+ shipping. I guess I learned my lesson there! The board arrived fairly quickly and they sent me a link to the SDK. I wish it was easier to get datasheets and SDKs from major suppliers.

The WCH CH568 USB to SATA chip

Everything about this chip is in chinese but I was able to figure it out using only Google translate. The basic specs can be found on the manufacturers page. The chip is based on the RISC-like NDS32 architecture. There is USB 2.0, SATA 2, SPI/UARTs, and SD card connectivity. The SDK is called AndesSight and is fairly easy to use along with WCH's flash tool. The datasheet is readily available in chinese and I spent a good amount of time translating the USB sections of the PDF to english.

Using TinyUSB as the USB stack

USB is pretty ubiquitous, but there are a lot of different revisions. Implementing a USB stack is quite complex and many Arduino implementations exist, but I was looking for something that wasn't specific to Arduino. I found the TinyUSB project and decided to see if I could get WCH CH568 support added. WCH's chip came with some simple USB examples but I ended up only using them to understand how to use the SDK and if my specific board was working at all. I used the datasheet plus some of the other WCH chips as examples, many of which are 8-bit 8051 based instead of CH568 which is based on the rather unique 32-bit NDS32 core.

Final result

I only ended up implementing USB 1.0, though I think it is fairly simple to get USB 2.0 to work. I did not implement SATA support. I may get around to doing that at some point. The only way I was able to finish this project is with the help of a CATC USB Chief analyzer I got on eBay. This is USB 1.0 only, but it worked fine using Win 95/98 since the software was still available on the Teledyne Lecroy site. There are some photos of the setup in the gallery below.

Links