From d0c049cdba4d3ba4c9f277f25182cec53c25eaf3 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Fri, 4 Apr 2025 11:48:05 +0200 Subject: [PATCH] fw/ch552: Document new dynamic endpoint functionality The CH552 firmware has an added functionality to control the USB controller dynamically, turning on and off endpoints with a small protocol. Since most of the documentation for the already lives in the ordinary firmware README, add this documentation there, too. --- hw/application_fpga/fw/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/application_fpga/fw/README.md b/hw/application_fpga/fw/README.md index 27af0c9..f416cca 100644 --- a/hw/application_fpga/fw/README.md +++ b/hw/application_fpga/fw/README.md @@ -65,9 +65,26 @@ The different endpoints: | *Name* | *Value* | *Comment* | |--------|---------|----------------------------------------------------------------------| | DEBUG | 0x20 | A USB HID special debug pipe. Useful for debug prints. | +| CH552 | 0x10 | USB controller control | | CDC | 0x40 | USB CDC-ACM, a serial port on the client. | | FIDO | 0x80 | A USB FIDO security token device, useful for FIDO-type applications. | +You can turn on and off different endpoints dynamically by sending +commands to the `CH552` control endpoint. When the TKey starts only +the `CH552` and the `CDC` endpoints are active. To change this, send a +command to `CH552` in this form: + +| *Name* | *Size* | *Comment* | +|---------|--------|-------------------------------| +| Command | 1B | Command to the CH552 firmware | +| Payload | 1B | Data for the command | + +Commands: + +| *Name* | *Value* | *Argument* | +|------------------|---------|----------------------| +| Enable endpoints | 0x01 | Bitmask of endpoints | + On top of the USB Mode Protocol is [the TKey Framing Protocol](https://dev.tillitis.se/protocol/) which is described in the Developer Handbook.