Comments (5)
Possibly, it was a deliberate decision that usbd_edpt_close() does not free the TX FIFO RAM.
Yes. usbd_edpt_close()
will be removed later.
I am maintaining code with a custom device class implementation that has to support changing the alternate interface settings.
Your implementation is out of USB specification.
These FIFO alloc/free routines are used for ISO endpoints where EP size changes in each alt settings, they are deprecated since too buggy and replaced by dcd_edpt_iso_alloc()
and dcd_edpt_iso_activate()
.
A possible option would be to introduce a usbd_edpt_close_all() function.
No it's a global reset and should only be used by set configuration request, one class behavior shouldn't affect others.
from tinyusb.
@HiFiPhile Thanks for the prompt response. Can you be more specific: what exactly is "out of USB specification"?
from tinyusb.
It seems you are switching bulk and interrupt ep with alt settings.
Alternate settings are mean to be used to adjust bandwidth allocation, such as in UAC class.
While it's not forbidden, AFAIK there is no standard class defined by USB-IF has such behavior. It's impossible to maintain a stack supporting all kind of behaviors.
For your case there are 2 ways:
- Use Set configuration to make major changes
dcd_edpt_iso_alloc()
anddcd_edpt_iso_activate()
should work
from tinyusb.
@HiFiPhile I agree that it's mainly used for adjusting the bandwidth. The only exceptions that I'm aware are the DFU and the NCM classes. DFU is very simple as it only uses the control endpoint. With NCM, I'm not really familiar.
It's reasonable decision to restrict alternate interface to bandwidth adjustment. It would be even better if it was documented. Is there a place where this could be added? I would submit a PR.
Thanks for the pointing out dcd_edpt_iso_alloc()
and dcd_edpt_iso_activate()
. They might work for my unusual case.
from tinyusb.
It's reasonable decision to restrict alternate interface to bandwidth adjustment. It would be even better if it was documented. Is there a place where this could be added?
I agree there isn't much documentation for advanced usage. And I don't have idea where it should be put...
If you use NCM you can give a try the new driver #2227
@hathach Should we rename dcd_edpt_iso_alloc()
and dcd_edpt_iso_activate()
to cover all endpoint types ?
9.2.4 Data Transfer
Data may be transferred between a USB device endpoint and the host in one of four ways. Refer to
Chapter 5 for the definition of the four types of transfers. An endpoint number may be used for different
types of data transfers in different alternate settings. However, once an alternate setting is selected
(including the default setting of an interface), a USB device endpoint uses only one data transfer method
until a different alternate setting is selected.
from tinyusb.
Related Issues (20)
- Settings CFG_TUD_MEM_SECTION causes a section type conflict HOT 3
- webserver NCM mode can't work HOT 18
- USB Bus Reset when running the CDC_MSC example (only CDC is enabled) on STM32U585OIYxQ custom board HOT 6
- LPC55S28 error for High Speed (PORT 1) not working for specific HID examples HOT 2
- Is it possible to provide an `ncm_open`, `ncm_close` API interface to control the connection and disconnection of USB? HOT 2
- USB Host: No set address recovery interval HOT 3
- Can Add support portable stm32h7 in src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c HOT 1
- tuh_edpt_abort_xfer should call user callback
- Vendor support outdated? HOT 1
- Add hook to allow for external host class drivers HOT 2
- OHCI: MMIO coherency/sync issue
- audio.h: error: ISO C restricts enumerator values to range of 'int' before C23 [-Werror=pedantic] HOT 4
- tud_task() hangs when there are no more messages in the buffer due to the timeout_ms value is set to UINT32_MAX. It should be 0, right? HOT 3
- Renesas RZ/T Support
- Consider adding preprocessor switch to disable automatic rp2040 binary declarations
- tud_umount_cb not called on Raspberry Pi Pico W HOT 1
- It can't work on STM32G0B1CBT6 with FreeRTOS. Please help. HOT 2
- Thoughts about increasing CDC transfer speed.
- Stack overflow with the new NCM driver HOT 12
- USBTMC for the host
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyusb.