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

nrf52840 usbd problems

Hi,

I use nrf52840, I meet some problems about the USBD, Can you help me?

We know that the usb device send data to host(such as PC) by EPIN:

(1) The host send IN event, But devie send NAK to host, because  LOCAL BUFFER do not have any data, So many IN-NAK is happening.

(2) Then I send some data to the local buffer by DMA,  when the next IN is come, the device send DATA to host, and then host send ACK to device, and then the EPDATASTATUS will be set.

My question:

Sometimes, when the device send DATA to host, I capture that the last CRC byte is missing, the host receive just one CRC byte(it must CRC16, is two bytes), The previous data is normal, I do not know the reason, maybe some hardware problems becauce of BLE modle.  and then, the host don't send ACK to device. Actually, the host don't send anything, and the EPDATASTATUS will not be set. The device USBD is now mark this EPIN as error status , because When PC send next IN event, the device resend the same data+crc, but this time , it's normal.

My question is that:

When the device USBD mark the EPIN as error status, is there any way that i can clear the status , because i don't need the device resend the right data+crc when the next IN come. It will mess up my application logic. 

Looking forward to your reply, thanks!

Related