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

spresense: Fix USB CDC and MSC #4774

Merged
merged 2 commits into from
May 19, 2021
Merged

Conversation

kamtom480
Copy link

After the #4689, the Spresense port stopped working. EP descriptor for CDC and MSC set max packet size to 64. For USB_HIGHSPEED this should be 512.

dhalbert
dhalbert previously approved these changes May 18, 2021
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you! I thought there might be an issue with Spresense given the significant changes in USB, but I hadn't had a chance to test it yet.

Have you tested turning off any devices in boot.py? I hope I handled the endpoint assignment properly given your fixed endpoint assignments, but that is another thing to test.

@hathach
Copy link
Member

hathach commented May 18, 2021

@dhalbert this applies to imxrt port as well. For highspeed bulk endpoint size must be 512

@kamtom480
Copy link
Author

@dhalbert I tried these two functions and they worked:

storage.disable_usb_device()
usb_cdc.enable(console=False, data=False)

Do you know why the tests are not working?

@dhalbert
Copy link
Collaborator

Do you know why the tests are not working?

GitHub Actions has had a lot of trouble in the past day. https://www.githubstatus.com/ looks OK now, but if you click on Incident History, you'll see an extended period yesterday when it was not doing well.

MIDI also needs this same fix, so I will push a commit for it as well.

@dhalbert
Copy link
Collaborator

@dhalbert this applies to imxrt port as well. For highspeed bulk endpoint size must be 512

Thanks -- it is port-independent code and will be applied across all.

@dhalbert
Copy link
Collaborator

I pushed a change, though there was git strangeness. I had to push twice.

Note also that we are using automated C code formatting now, and it indents the #ifs. You can set this up for yourself by doing:

$ sudo add-apt-repository ppa:pybricks/ppa
$ sudo apt-get update
$ sudo apt install uncrustify
$ pip3 install pre-commit
$ cd <your repo clone>
$ pre-commit install   # only need to do this once

From this point on, it will run some checks before each commit, reformatting files as necessary. There are other checks besides the formatting. More info is here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dhalbert dhalbert merged commit 4c928ac into adafruit:main May 19, 2021
@kamtom480
Copy link
Author

@dhalbert Thank you for the information! I will use it next time.

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