Searched hist:f79ca8d8e8200688da749b37d1bc5dbf2ff06fb2 (Results 1 – 1 of 1) sorted by relevance
| /rk3399_ARM-atf/plat/st/common/ |
| H A D | usb_dfu.c | f79ca8d8e8200688da749b37d1bc5dbf2ff06fb2 Wed May 07 12:31:28 UTC 2025 Fabrice Gasnier <fabrice.gasnier@foss.st.com> fix(st): replace down counter by a timeout upon dfu detach
On stm32mp2, DFU detach sometimes makes subsequent usb start to fail. The core doesn't have the time to properly finalize the last setup phase. This results in error logs seen: ERROR: dwc3_handle_dev_event: 1688 ERROR: dwc3_handle_dev_event: 1692
Just enabling "DFU USB STOP" message hides the issue, sequentially: usb_core_start() ... usb_dfu_loop() // runs until DFU_DETACH command --> while(it_count != 0U) { usb_core_handle_it() if (usb_dfu_detach_req) it_count--; // down count from 100 to 0 } ... INFO("DFU USB STOP...\n"); usb_core_stop()
The down-counter (it_count) value doesn't seem to be enough, and seems not robust against CPU speed. So rather adopt a 100us timeout. It's determined experimentally (above issue seems to be triggered around 20us to 30us, so keep some margin).
Change-Id: Iac37c346ad938cd917dfbd7e4622546d29ee7517 Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
|