Giter Club home page Giter Club logo

ch347-research's Introduction

CH347 Research

This project aims to document the USB packet format of the WCH CH347, a high-speed USB chip providing UART, I2C, SPI, and JTAG interfaces. The official datasheet does not have any information about the low level programming interface and mainly covers electrical specifications and functional descriptions. There is a demonstration application for Windows which does include source code, but this is only for the application itself and relies on calls into a proprietary library (CH347DLL) of which the API is documented in an included application development manual.

Although this library could theoretically be disassembled and reverse engineered, simply calling the functions and observing USB packets in tools such as Wireshark can often be easier, and this is the route taken by this project. Included in this repo are the source code for tools developed to assist in such a task, generated outputs, and analyses of the data. The library headers are not included in this repo and can be found in the demonstration application. The library DLL and vendor drivers are strangely not included in those downloads and are found in an updated CH341 driver package that appears to only be availble on the Chinese version of WCH's website.

ch347-research's People

Contributors

nic3-14159 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

minkione occoder

ch347-research's Issues

This file will interest you

Please take a look at the beginning of https://github.com/WCHSoftGroup/ch347/blob/main/ch347_jtag.c. It contains definitions of instructions for reading and writing in JTAG mode
Like this:
#define HW_TDO_BUF_SIZE 4096
#define SF_PACKET_BUF_SIZE 51200 //命令包长度
#define UCMDPKT_DATA_MAX_BYTES_USBHS 507 // USB高速时每个命令包内包含数据长度
#define USBC_PACKET_USBHS 512 // USB高速时单包最大数据长度

#define CH347_CMD_HEADER 3 //协议包头长度

// 协议传输格式:CMD(1字节)+ Length(2字节)+ Data
#define CH347_CMD_INFO_RD 0xCA //参数获取,用于获取固件版本、JTAG接口相关参数等
#define CH347_CMD_JTAG_INIT 0xD0 // JTAG接口初始化命令
#define CH347_CMD_JTAG_BIT_OP 0xD1 // JTAG接口引脚位控制命令
#define CH347_CMD_JTAG_BIT_OP_RD 0xD2 // JTAG接口引脚位控制并读取命令
#define CH347_CMD_JTAG_DATA_SHIFT 0xD3 // JTAG接口数据移位命令
#define CH347_CMD_JTAG_DATA_SHIFT_RD 0xD4 // JTAG接口数据移位并读取命令

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.