Skip to content
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

RP2040 double buffer #891

Merged
merged 19 commits into from Jun 28, 2021
Merged

RP2040 double buffer #891

merged 19 commits into from Jun 28, 2021

Conversation

hathach
Copy link
Owner

@hathach hathach commented Jun 11, 2021

Describe the PR
This PR implements double buffered for RP2040, rework/refactor the existing quite a log

  • we don't have to deal with RP2040-E4 hardware our of synce
  • faster transfer for control and bulk
  • Should help host_hid mouse data displaced raspberrypi/pico-sdk#442 with logitech universal receiver (8-byte control in Fullspeed) and wired keyboard with 8byte control in Lowspeed
  • Lots of internal rp2040 usb renaming
  • Testing with device stack, cdc_msc, hid_composite running fine as normal.
  • There is an issue with net_lwip_webserver example when there is a short packet on buffer0 (i.e < 64 bytes) while we expect data on both buffer. At the hanlding time (currently triggered per 2 buffer), the buffer1 is probably filled with data from the next transfer (not current one). For now we disable double buffered for device OUT.

PR is tested on both host and device mode and should be ready for review and merge. @kilograham @liamfraser please let me know if changes look good to you and it would be great if you could have some time to test it out.

- make _hw_endpoint_xfer_sync and _hw_endpoint_start_next_buffer private
- drop prefix _ from _hw_endpoint_xfer_continue and
_hw_endpoint_reset_transfer
- total_len to remaining_len
- len to xferred_len
last_buf, buf_sel, transfer_size
@hathach hathach marked this pull request as ready for review June 16, 2021 18:55
@liamfraser
Copy link
Collaborator

Sorry for the delay here. The code looks good to me. I don't have much time to test it at the moment because I am working on a different project. @kilograham do you have any thoughts?

@hathach
Copy link
Owner Author

hathach commented Jun 23, 2021

Sorry for the delay here. The code looks good to me. I don't have much time to test it at the moment because I am working on a different project. @kilograham do you have any thoughts?

No problem at all, I am busy with other works anyway. Note currently the double buffered is not fully operated (skip with device IN), but we could address this later. For now, anyone that could help with testing would be great.

@hathach
Copy link
Owner Author

hathach commented Jun 28, 2021

I have double checked again with all of device examples: cdc_msc, hid_composite, net_lwip_webserver, webusb, midi_test. Everything seems working perfectly. It is good for a merge. Thank you very much for reviewing the changes. Should there be any issue, it could be fixed as followup pr.

@hathach hathach merged commit 6e939de into master Jun 28, 2021
@hathach hathach deleted the host-rp2040-double-buffer branch June 28, 2021 10:39
@kilograham
Copy link
Collaborator

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants