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

rework fsdev driver, fix ch32v203 race condition and stability issue #2750

Merged
merged 15 commits into from
Aug 8, 2024

Conversation

hathach
Copy link
Owner

@hathach hathach commented Aug 1, 2024

Describe the PR
More effor and finally able to fix ch32v203 race condition especially with windows host. ch32v203 behaves a bit different comparing to stm32 usb

  • correctly handle setup prepare at dcd_edpt0_status_complete(), which fixes the race condition with windows where we could miss setup packet (setup bit set, but count = 0)
  • improve dcd int handler
    • skip DIR and use CTR TX/RX to handle complete transfer
    • clear CTR first, except for setup which we need to get data first
    • separate handle_ctr_setup()
  • fix v203 race condition between rx bufsize and RX_STAT which cause PMAOVR, occurs with WRITE10 (msc command out then write10 data out).
  • fix ch32v203 seems to unconditionally accept ZLP on EP0 OUT, which can incorrectly use queued_len of previous transfer. So reset total_len and queued_len to 0.
  • fsdev improve ep bit manipulation
  • read/write packet enhancement, merge 16-bit and 32-bit together
  • merge read/write packet fifo (16-bit and 32-bit)
  • also add iar kickstart stm32f103ze board
  • hil: add nanoch32v203 to hil pool, also run hil tests in parallel

@hathach hathach marked this pull request as ready for review August 5, 2024 10:58
- skip DIR and use CTR TX/RX to handle complete transfer
- clear CTR first, except for setup which we need to get data first
- separate handle_ctr_setup()
…AOVR

fix set_rx_bufsize with invalid value for zero length packet
…LP on EP0 OUT, which can incorrectly use queued_len of previous transfer. So reset total_len and queued_len to 0.
hathach added a commit to adafruit/Adafruit_TinyUSB_Arduino that referenced this pull request Aug 8, 2024
@hathach hathach changed the title Fix ch32v203 setup (more effort) rework fsdev driver, fix ch32v203 race condition and stability issue Aug 8, 2024
@hathach
Copy link
Owner Author

hathach commented Aug 8, 2024

new release pico-sdk break the ci, merge and fixedd that later in separated PR.

@hathach hathach merged commit dcd0f39 into master Aug 8, 2024
77 of 79 checks passed
@hathach hathach deleted the fix-ch32v203-setup branch August 8, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant