Hi,
I am developing my own vendor specific USB device with 2 interfaces (data and debug) and 2 endpoints(in and out) each. I based my class on the cdc_acm class.
So far most of it works. The only problem is, when I send more than 1 byte at a time to the device. Then the first byte is missing and the last one is repeated.
E.g. I'm sending "0x0F 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x7B 0x02" but I'm receiving "0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x7B 0x02 0x02".
My RX_DONE event looks like this:
do{ ret = app_usbd_dev_read_data(&m_app_dev, m_data_buf, 1); NRF_LOG_INFO("data read: 0x%X: 0x%02X", ret, *m_data_buf); pu8Data[u16Length] = *m_data_buf; u16Length++; }while(ret == NRF_SUCCESS);
If I do it like in the cdc_acm example with
if(ret == NRF_SUCCESS) u16Length++;
the received data looks like this: "0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x7B 0x02". So the first byte is missing and I'm also not able to receive just one byte. That's because the function returns NRF_ERROR_IO_PENDING.
Does anyone have an idea what the problem could be?
I am using the nRF5 SDK 17.1.0 and an nRF52833DK.
Kind regards,
Johannes