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

USBD EPIN AMOUNT and MAXCNT values different

Hi,

I'm working on treating the nrf as a CDC ACM device and in order to test it I've been using a script to send input to the chip through echo commands to the /dev/ttyACM.

I find that if I don't set a delay on the commands, it'll run through several lines of commands and then the EPDATA event stops firing and the system hangs until it's reset. When the system is hanging I look at the registers to see if anything is abnormal. All of the events have been cleared and handled,  all of the endpoints are enabled, but the EPIN AMOUNT and MAXCNT are different for my bulkIN endpoint. If I step through the code, it works just fine and the registers match so it seems to be a matter of speed.

I checked to see if there's any errata that might be causing this but I don't see anything that would pertain to this issue.

I also looked at the SDK to see if there's any example or place where checking for the two registers to be different could occur, but there's no use of the 'nrf_usbd_ep_amount_get' method in the SDK15 that I could find.

Here's a 2 pictures of my EPIN[2] registers.

In the first picture the MAXCNT register is greater than the amount transferred. In the second picture, the MAXCNT is less than the amount transferred.

Is there something that I'm missing that would cause this behavior?

Related