This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF24LU1+ corrupted HID OUT endpoint data?

I'm developing a HID-based USB dongle using the Nordic nRF24LU1+ and have things working quite well except for one issue that seems to be build/config related (I think).

USB HID config:
- 32-byte endpoint buffers for EP0 IN/OUT (32-byte transfer sizes as well)
- 64-byte endpoint buffers for EP1 IN/OUT (33-byte transfer size for IN endpoint, 34-byte transfer size for OUT endpoint)
- all other endpoints disabled
- based on the Nordic SDK v2.1 code with the USB HAL

I'm successfully sending IN traffic to the host, and mostly receiving good OUT data from the host but occasionally my reads of OUT traffic from the host seem to get corrupted.

My test involves sending data to the device with all the bytes set to the same value, and incrementing that value for each packet. In the OUT endpoint "data received" callback, the code reads the data out of the endpoint buffer, and sometimes the first byte does not match the value of the rest of the data (while the rest of the data has the correct value).

I can break at this point, examine the memory contents of the OUT endpoint buffer and all the bytes there are set to the correct value - it seems to be only in the read/copy process that this data gets corrupted. If I examine access the endpoint buffer data a couple stack frames deeper (ie, add some if() {} conditions) the correct value is read.

My project is configured to use the "large xdata" as the default memory model for the 8051.

Does this sound like a familiar problem to anybody? I'm not an 8051 expert, so I figure there's likely some toolchain settings that I'm missing, or have incorrectly configured. Thanks for any suggestions!

0