-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
net_lwip_webserver reaches "endpoint busy" race condition on STM32F411DISCO #884
Comments
Found issue #289 after posting this. It (along with a few of the MRs) have a fair amount of discussion, I'm not positive this isn't a duplicate. |
thanks for the issue, I also encouter the ASSERT with 0x81 endpoint, however, it seems to be "normal" since currently the net driver doesn't check the busy state of the notification endpoint and can send one while previous one doesn't received by host yet. This will be fixed later but in general it does affect the example as this also appear on other working MCUs as well. |
Thanks for confirming. What would be the correct way to handle this at the application layer if I wanted to work around it? Do I need to make it more into a queue + state machine? Or can I just not send if the endpoint is busy (will the host eventually retry)? Happy to make a PR if I can understand the problem well enough. |
Alas, this seems to be a "feature" of the RNDIS driver bundled into recent Linux distributions. This newer Linux RNDIS driver fires off a bunch of RNDIS queries (via EP0) without first reading the notification EP response to the query/queries that it already sent. D'oh. The workaround that I’m tempted to submit as a PR would be to add an if-busy check to netd_report() in ./src/class/net/net_device.c:
|
I believe this issue can be closed. The above code was included in PR #1107. |
This does seem to be resolved on the latest
|
great, thank you everyone 👍 |
Set Up
Compile the example:
make DEBUG=1 BOARD=stm32f411disco all
Describe The Bug
I reach the following assert when connecting to my host pc over usb:
With the following backtrace:
I'm not super familiar with the code-base yet, so I'm not sure if this is just some sort of RTOS/platform issue, or the net_device code not meeting the pre-conditions for calling
usbd_edpt_xfer
inside ofnetd_report
.Not sure if it's helpful, but this is what my dmesg output looks like on the host side:
To Reproduce
Build example and connect to a linux machine.
Log
The text was updated successfully, but these errors were encountered: