This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB Bulk Out hardware bug

I am working with production Rev 1 on nrf52840 DK v1.0.0 (2018.19). The spec section 6.35.10.2 Bulk and interrupt OUT transaction say

Until that transfer is finished, the hardware will automatically NAK any other incoming OUT+DATA packets.Only when the EasyDMA transfer is done (signalled by the ENDEPOUT[n] event), or as soon as any values are written by the software in register SIZE.EPOUT[n], the endpoint n will accept incoming OUT+DATA again.

However, this is only true with the first write to SIZE.EPOUT. Afterwards, the endpoint will always accept & ACK the Data from host whenever DMA is complete.

1. This is out of specs, Is it a bug ?,

2. Is there any other way to force the endpoint to NAK out token from host until we write to SIZE.EPOUT. again like the specs state ?

Parents Reply
  • After we have written to SIZE.EPOUT once, we are allowing traffic on that EP. When the EasyDMA transfer is done, the endpoint will accept incoming OUT+DATA again, you dont need to write to SIZE.EPOUT again for this. This can be seen in Figure 10 in the PS. Writing to SIZE.EPOUT after that, is used to clearing out endpoint to accept any new incoming traffic(function nrf_usbd_epout_clear()).

    PS: I recommend using our USBD drivers in the SDK.

Children
  • Ah I understand it now, look like the specs did change from AND to OR regarding this requirement with latest revision of nrf52840 PS, it is my bad. Thanks for your clarification.

    (from the pre-1.0 specs)

    Still for question 2) is there any way for the software to instruct peripheral to NAK the next packet from host. Sometime auto ACK the packet that you are not ready to handle could cause issue e.g Host will start its timeout timer waiting for response which SW is not ready to process the received data. 

    Thanks for you recommendation, though I am working on adding nrf52840 to my open usb stack here  https://github.com/hathach/tinyusb/tree/develop 

Related