Is this a bug? ASF4 (Start) USB MSC Device code

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In _usb_d_dev_ep_init(), in hpl_usbhs.c (for an ATSAMS70), I see this code:

 

    if (ept->ep != 0xFF) {

        return -USB_ERR_REDO;

    }

 

This looks wrong to me. The issue is that the notion of endpoint is ambiguous - are 0x1/0x81 one endpoint or two? In this context, the pair are *one* endpoint. But the problem is that this method is called twice - once for 0x1, and a second time of 0x81. By bailing out here, the second caller is denied an opportunity to call hri_usbhs_write_DEVEPTCFG_reg() and so on.

 

The symptoms I am seeing is that the complete EP0 configuration and setup appears to be successful, and I see the first CBW with an inquiry go OUT and get acked, but then the request for the response on the IN ep never happens. Meanwhile, breakpoints on the msc method that *should* be called to handle the bulk out ep never gets called.

 

This still happens, even if "#if 0" that code block, so something else is amiss too, but still, this doesn't seem at all right.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never mind. It gets further with the two EPs numbered 0x1 and 0x82.