Skip to content

SAMx7x dcd_edpt_xfer returns false on ZLP with dma support #3512

@RamDav

Description

@RamDav

Operating System

Others

Commit SHA

3af1bec

Board

same7xplained

Firmware

Custom SAME70 firmware.

What happened ?

i have a custom class which uses usbd_edpt_xfer to start read transfers on an endpoint.
If the usb device has already received an zlp then a call to dcd_edpt_xfer returns false which causes the call usbd_edpt_xfer to run into a TU_BREAKPOINT return false and never execute the DCD_EVENT_XFER_COMPLETE event.
This is handeled as an error in the usbd layer in usbd_edpt_xfer which not really is the case in this scenario.
I fixed this temporarily by manually calling the appropriate funtions for a zero length data reception on getting a false after calling usbd_edpt_xfer. but this is only a dirty hack to circumvent this. what should be done here manually raising the DCD_EVENT_XFER_COMPLETE event and returning a true to not cause the usb stack to have any issues?
the implementation with this error is in src/portable/microchip/samx7x/dcd_samx7x.c: 653.

How to reproduce ?

On reception of zero length package on an endpoint currently testing with custom win usb driver.

Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)

Not available

Screenshots

Not available

I have checked existing issues, discussion and documentation

  • I confirm I have checked existing issues, discussion and documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions