-
Notifications
You must be signed in to change notification settings - Fork 7k
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
kernel crash: USB ECM: echo_server #7364
Comments
@jfischer-phytec-iot please have a look |
@zhaozhongchen It is valid to select the alternative interface configuration. Kindly, the stack should try to disable the endpoints before reconfiguring them, but it seems not be the problem here. Can you please try it with #5163? @ydamigos @loicpoulain FYI |
@jfischer-phytec-iot I had tried #5163 and it's doesn't work. please notice that interface 1 has two altersetting, and the usb host only configued the first altersetting. EP82 and EP01 is belong to the second altersetting but nerver configued. |
@jfischer-phytec-iot, I will have a look by the end of the week. |
So, I'm pretty sure issue happens because of this patch: #7206 (comment) The connect_media callback is called on USB configuration status, however at this moment endpoints are not yet enabled (neither the interface), so trying to read/write endpoint is failing... Reverting this patch on your side should solve the issue. We need to find a clean solution, A first change should consist in returning an error when trying to use a non enabled endpoint. Then we need to understand how to fix @finikorg patch without breaking rndis. |
@finikorg can you please take a look? |
@jfischer-phytec-iot @loicpoulain I am thinking to define status_cb() in each function, so we would overcome the problem of common super-smart callback, opinions? |
Implement status callback. Fixes: zephyrproject-rtos#7364 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
@zhaozhongchen could you check my RFC PR mentioned above? |
@finikorg sure, I will check it tomorrow |
Implement status callback. Fixes: #7364 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
I am testing usb ecm function by using echo_server example on stm32f4, but kernel crased and print this informations on console:
Disassembly zephyr.elf and I know where failed, so I make a breakpoint and see what happens:
seems the variable ep->maxpacket is zero. search ep->maxpacket and found it was only assignmented at HAL_PCD_EP_Open.
and HAL_PCD_EP_Open was called in usb_dc_ep_enable when usb_set_configuration. got the params of usb_set_configuration from bt, config_index=1, alt_setting=0.
usb_set_configuration enable which endpoint according to usb common descriptor, so i need take a look common_desc: (I had translated it to a easier read format by hand)
this line '09 04 01 01 02 0a 06 00 00 # Interface descriptor 1/1' changed alt_setting to 0x01, caused we haven't open EP_BULK_IN_82 and EP_BULK_OUT_01, let ep->maxpacket is zero, make kernel crased.
Yes I know what happens but don't know how to fix it. I will check usb ecm spec and see if this interface descriptor is really need:
The text was updated successfully, but these errors were encountered: