Skip to content

STM32F411 In interrupt mode, call usbd_ep_write in the main program  #146

Description

@colorhacker

In interrupt mode, calling usbd_ep_write in the main program will cause the main program to get stuck and data will never be sent.
ep_write :
if (ep != 0 && epi->DIEPCTL & USB_OTG_DIEPCTL_EPENA) return -1; // Always returns -1, epi->DIEPCTL & USB_OTG_DIEPCTL_EPENA always is 1

Tracing found that when the main function calls ep_write, the interrupt will generate EP0's ZLP, which will cause the main function's ep_write to be interrupted by EP0's ZLP, and then the data can never be sent.

How can I use the main program to call usbd_ep_write in interrupt mode?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions