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

Add ability to close endpoints to host API #3012

Open
1 task done
tannewt opened this issue Mar 6, 2025 · 0 comments
Open
1 task done

Add ability to close endpoints to host API #3012

tannewt opened this issue Mar 6, 2025 · 0 comments

Comments

@tannewt
Copy link
Collaborator

tannewt commented Mar 6, 2025

Related area

Host API

Hardware specification

RP2 PIO usb host code

Is your feature request related to a problem?

In CircuitPython we open endpoints before we use them. We only track what we use for a small period of time while the VM is running. If a second VM run opens an endpoint it will call open a second time. On PIO USB host code, this causes a second allocation for the open endpoint and basically leaks the memory of the first. Eventually the endpoint opening will fail because it is out of memory: https://github.com/sekigon-gonnoc/Pico-PIO-USB/blob/main/src/pio_usb_host.c#L436 A hard reset is needed to recover.

Describe the solution you'd like

Please add an API to close an endpoint. We'll do this before our shorter lived tracking object is deleted and free the underlying memory.

This needs to be updated to call it:
https://github.com/adafruit/circuitpython/blob/2af397ed1ca94846ed084d85a393b995e90460a8/shared-module/usb/core/Device.c#L53

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant