-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add alternative way of handling USB Mode Protocol #315
Draft
mchack-work
wants to merge
22
commits into
cth
Choose a base branch
from
cth+usbmode
base: cth
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0f0971c
to
c49b7da
Compare
80e4101
to
f777321
Compare
c49b7da
to
9c22c78
Compare
Throwing away mode and length from incoming data. Adding mode and length to outgoing data. Splitting responses into frames small enough for the USB<->UART transceiver to handle.
Add incoming and outgoing CTS (Clear To Send) signals for the FPGA to let the CH552 and FPGA signal each other that it is OK to send UART data. The CTS signals indicate "OK to send" if high. If an incoming CTS signal goes low, the receiver of that signal should immediatly stop sending UART data.
- Use CTS signals to let the FPGA and CH552 signal each other that it is OK send UART data. - Update the CH552 rx and frame handling logic. - Fix minor spelling errors and indentation
Reconfigure the baudrate to keep 500 kbaud. Correct a forgotten test in testfw that wasn't updated the last time frequency was raised in commit 75b0285 in June 17, 2024.
Fix off-by-one UART bitrate counter value that will make the RX sampling and TX sending drift. The impact gets higher as the baudrate increases and the bitrate counter value gets smaller.
Make the CH552 present a new HID endpoint used for debug data.
Fix CDC configuration problem on Windows when we have a composite device (multiple different Device Classes). Add "Interface Association Descriptor" to make it work.
Update USB polling period (bInterval) for CDC, HID and TKEYCTRL endpoints.
Set UART1 IRQ to high priority to not miss any incoming bytes and tune USB polling period (bInterval).
Breaking change! The introduction of the USB Controller Protocol means we have a breaking change that makes device apps unable to communicate.
Instead of repeated RUNs in Dockerfile, move the entire build of specific tools to a script. - Make commands more shell script-like. - icestorm: Make sure we checkout the right commit. - Add checks for the right digest for all git clones, so no history has been changed. - Add digest file and check for the downloaded tarball.
To get bash to source /etc/profile and get the goodness of /etc/profile/bash_completion.sh, run bash as a login shell.
Use the release candidate for tkey-builder:5
9c22c78
to
3c7de3b
Compare
For ages we have had a comment saying: For Verilator 5.019 -Wno-GENUNNAMED needs to be added to LINT_FLAGS for the cell library. With the new tkey-builder we have 5.028, so it's time to apply this flag.
- Change checkfmt make target to run both Verilog formatting check and C code formatting check. - Make check formatting it's own job in the CI.
5bae7f4
to
51dc549
Compare
f021149
to
8a327c8
Compare
Make read()/write() hide all the details of handling the USB Mode Protocol. Unfortunately this also introduces 4 bytes to the .bss segment which was removed because of lack of FW_RAM, originally just 1 kB. We add back support in start.S and the linker script.
Uses new read/write API.
Firmware and FPGA bitstream built with tkey-builder:5rc1.
Since we test the FW_RAM we can't keep anything there, not the stack (already fixed by different start.S), nor the .bss, which we fix now with a different linker script that uses app-RAM for .bss.
8a327c8
to
1ab2b80
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
read()/write() hides all the details of handling the USB Mode Protocol.
Unfortunately this also introduces 4 bytes to the .bss segment which was removed because of lack of FW_RAM, originally just 1 kB. We add back support in start.S and the linker script.
Would like to change the order of the stack and .bss, though. Will do an experiment with that in a moment.