I've been working on a composite USB audio device that uses 6 endpoints, all good.
The last few days I've been working on something that increases the endpoint count to 9 endpoints (0-8). I just discovered DCCPARAMS register's DEN value which is read-only is 8 and as a result the SDK rejects any attempt to set up more than 8 endpoints.
I see the register is read-only, so I'm assuming I can't just change it to something higher than 8 (but <= 15), so is there any way around this? Is this a limitation of the device?
解決済! 解決策の投稿を見る。
Hi Ed
The limit of 8 endpoints is a "physical" limit and not a configuration one. With 8 physical endpoints one can have 15 operational endpoints (as long as each physical (non-control) one does both IN and OUT operations)
To use IN and OUT on a single endpoint should just be a case of editing the descriptors accordingly: Instead of defining two endpoints, one as IN on endpoint X and one as OUT on endpoint Y, specify one as IN on endpoint X and one as OUT on endpoint X. The host will then uses the same (physical) endpoint for both IN and OUT on the two operational endpoints.
If you use a VCOM just for Rx/TX data you don't need an interrupt endpoint (that is used for modem signals like RTS, CTS) and so you only need one physical endpoint (you can have 7 x VCOMs on the HSUSB of the i.MX RT and 15 on the FSUSB of the Kinetis parts).
This means that for your development you actually need
0 - control
1- CTRL
2. IN + OUT spkrphone
3. FDBK
4. IN mic
5. VCOM IN + OUT
and then you have still 2 left for further features - eg. an RNDIS interface for monitoring and configuration via web browser
6. RNDIS data
7. RNDIS interrupt
In the uTasker project I have two defines:
#define USB_SIMPLEX_ENDPOINTS
#define CDC_WITHOUT_INTERRUPT_ENDPOINT
which allow switching between simplex and separate endpoints (although generally I leave USB_SIMPLEX_ENDPOINTS on because there are no disadvantages of sharing physical endpoints between IN and OUT usage).
When CDC_WITHOUT_INTERRUPT_ENDPOINT is enabled it removes the interrupt endpoints from each VCOM to free up additional physical endpoints.
There is a thread somewhere about VCOMs without interrupt endpoint so it can also be done by modifying SDK examples appropriately. IN/OUT sharing is almost certainly supported by the SDK but if not it is in fact simply a case of ensuring that when an endpoint is configured for IN or OUT it doesn't "touch" any configuration that may have already been set for OUT or IN utilisation (the registers have flags for both IN and OUT usage so only 'touch' the ones that are relevant when activating the endpoint and setting its type of operation).
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT - developer of uTasker USB device/host library]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements
For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html
Hi Ed
The limit of 8 endpoints is a "physical" limit and not a configuration one. With 8 physical endpoints one can have 15 operational endpoints (as long as each physical (non-control) one does both IN and OUT operations)
To use IN and OUT on a single endpoint should just be a case of editing the descriptors accordingly: Instead of defining two endpoints, one as IN on endpoint X and one as OUT on endpoint Y, specify one as IN on endpoint X and one as OUT on endpoint X. The host will then uses the same (physical) endpoint for both IN and OUT on the two operational endpoints.
If you use a VCOM just for Rx/TX data you don't need an interrupt endpoint (that is used for modem signals like RTS, CTS) and so you only need one physical endpoint (you can have 7 x VCOMs on the HSUSB of the i.MX RT and 15 on the FSUSB of the Kinetis parts).
This means that for your development you actually need
0 - control
1- CTRL
2. IN + OUT spkrphone
3. FDBK
4. IN mic
5. VCOM IN + OUT
and then you have still 2 left for further features - eg. an RNDIS interface for monitoring and configuration via web browser
6. RNDIS data
7. RNDIS interrupt
In the uTasker project I have two defines:
#define USB_SIMPLEX_ENDPOINTS
#define CDC_WITHOUT_INTERRUPT_ENDPOINT
which allow switching between simplex and separate endpoints (although generally I leave USB_SIMPLEX_ENDPOINTS on because there are no disadvantages of sharing physical endpoints between IN and OUT usage).
When CDC_WITHOUT_INTERRUPT_ENDPOINT is enabled it removes the interrupt endpoints from each VCOM to free up additional physical endpoints.
There is a thread somewhere about VCOMs without interrupt endpoint so it can also be done by modifying SDK examples appropriately. IN/OUT sharing is almost certainly supported by the SDK but if not it is in fact simply a case of ensuring that when an endpoint is configured for IN or OUT it doesn't "touch" any configuration that may have already been set for OUT or IN utilisation (the registers have flags for both IN and OUT usage so only 'touch' the ones that are relevant when activating the endpoint and setting its type of operation).
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT - developer of uTasker USB device/host library]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements
For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html
Mark,
Just wanted to confirm that I was able to combine IN/OUT to one endpoint for the SPKRPHONE interface of my device. That gave me the "endpoint space" I needed to fit the VCOM interface into the project.
Thanks much,
Ed
As usual Mark, thanks for the detailed response.
I will work on this today, and add any final notes (if needed), then mark this as the solution.
Ed
Hi Ed
The HSUSB in the i.MX RT have 8 endpoints for sue by the device.
In comparison the FS USB in the Kinetis parts have 16.
Are you presently using endpoints for either IN or OUT? Or are you using them for both IN and OUT a the same time?
If the first (one for IN and one for OUT) you can combine these to free up endpoints.
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT - and uTasker USB device/host stack]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or rapid product development requirements
For professionals searching for faster, problem-free Kinetis and i.MX RT 10xx developments the uTasker project holds the key: https://www.utasker.com/iMX/RT1064.html
Hey Mark,
Yea, that's what I was afraid of. That register was labeled read-only, so I was just hoping that maybe that was a typo.
My current project (as you know) is composite audio that presents itself as two unique devices to Linux using IADs to form two IACs. All that is working, but it uses 6 endpoints. 1-4 are CTRL/IN/OUT/FDBK for first audio device (spkrphone) and 5 is IN for second audio device (mic-array), and 0 allocated for USB by default.
My debug system has a UART tied into it; but that goes away when in real use, so I thought it would be handy to add a virtual com port to the mix; but that requires 3 more endpoints (bulk-in/bulk-out/interrupt). That's when I discovered the limitation of 8.
Is there an example in the SDK that combines endpoints of opposite direction?
Hi,
Yes, the USB 2.0 controller has up tp 8 bidirectional endpoints. This is not a typo. You can see it in the USB features list in RT10xx RM.
Regards,
Jing