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
  • Bump, is there anyway to enforce usb hw to NAK bulk out after DMA is done. Only ACK after we overwrite the SIZE.EPOUT[n] 

  • Bump, is there anyway to enforce usb hw to NAK bulk out after DMA is done. Only ACK after we overwrite the SIZE.EPOUT[n] 

    The ACK/NAK is controlled by the STARTEPOUT[n] task. You start the EasyDMA transfer with the STARTEPOUT[n] task, and when it’s finished, signaled by the ENDEPOUT event, the HW will ack the next OUT packet. If you want the HW to NAK the next OUT packet, then you could possibly try to delay triggering the STARTEPOUT task. (i.e. don’t start the EasyDMA transfer) (as long as you are not starting the EasyDMA transfer, the HW should NAK the next OUT packet)

  • Thank you very much for answering. Though, I would like to force NAK but still need to trigger DMA to process data of current transaction. The sequence would be

    1. receive data from the current transaction,

    2. Process data, force NAK meanwhile

    3. Done with data, start to accept the next Data

    I only wonder if there is any way to enforce it, it is no a problem if we have to implement driver to adapt to nrf usb controller.  

  • I don't think that is possible. Once you have finished processing the data from the previous transaction, you want new data to be available in the internal USB HW buffer as soon as possible. As soon as you have transferred the data to RAM, the internal USB HW buffers are ready to receive new data, and will ACK the next OUT packet. As long as you have *not* transferred the data to RAM, the USB HW will NAK the next OUT packet.

    In your sequence, when you are finished with processing the current transaction, the next transaction is not ready at all, and you will need to wait for the USB host to send the data again. This would have a negative effect on the transfer speed.

  • Thanks for confirmation. what you said is 90% true. However, sometimes ACK the packet that software is not ready to process, could send a wrong signal to host. I would like to have an option to force NAK, though there is not a big problem without it. We just take that into consideration :D. Thanks a lot 

Reply Children
No Data
Related