Open chr-btz opened 2 years ago
I am having the same issue using PIMA class. The ZLP is not transmitted. Using your modified callback function that send ZLP for other endpoint than 0 works for me. Thank you!
Hi @chr-btz,
Thanks for your report, The issue you pointed out is confirmed. This will be fixed in the next release.
BR.
hi @chr-btz , This issue fixed in V3.0.0 release, you need to define UX_DEVICE_CLASS_CDC_ACM_WRITE_AUTO_ZLP https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/57faa03d093cb37ad341798d76886af15decdc74/Projects/NUCLEO-H723ZG/Applications/USBX/Ux_Device_CDC_ACM/USBX/App/ux_user.h#L359
Best Regards.
Board: Nucleo F429zi IDE: CubeIDE
When the endpoints max packet size equals the data to send size, usbx does not send a zlp, therefore the host does not recognize the transfer as complete.
Reproduce:
Change usbx_cdc_acm_write_thread_entry to something like this:
Analysis:
After investigation i found several issues,
host_length != slave_length will be false even if zlp is needed
https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/84ed811f56e0dd1e80ea7cec10e8ac62c5df6168/Middlewares/ST/usbx/common/core/src/ux_device_stack_transfer_request.c#L150-L168
even if transfer_request -> ux_slave_transfer_request_force_zlp gets set to UX_TRUE the zlp wont be sended because its exclusive to endpoint 0, see:
https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/84ed811f56e0dd1e80ea7cec10e8ac62c5df6168/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_callback.c#L237-L349
when removed the host_length != slave_length in issue one and use this code for HAL_PCD_DataInStageCallback its working: