ESP32 S3 USB TX not working with binary data
Posted: Thu Nov 18, 2021 2:35 am
Hi,
I created one sample project for ESP32 S3 hardware with the following changes:
1. enable tinyUSB stack
2. enable vendor class with only 2 endpoints for bulk transfer (one IN and one OUT, buffer size are both 64 bytes)
3. ESP32 S3 is recognized as WinUSB device by PC and a test application on PC is used to receive data from ESP32 S3
4. in the main program of ESP32 S3, it is sending 64 bytes to PC every 4ms. The 64 bytes buffer is fixed and each byte is initialized to its index (meaning byte 0 is set to 0, byte 1 is set to 1,.... and byte 63 is set to 0x3F)
5. on the PC side, it is discovered the received data is NOT correct: for every 0x0a sent, ESP32S3 USB stack will automatically insert 0x0d before sending it to PC. It seems ESP32S3 USB is set to text mode and will automatically convert 0x0a (LF) to 0x0d,0x0a (CRLF)
See the attachment for the snapshot of data.
Anyone has encountered the same issue? Is there any setting to let USB work in binary mode?
I created one sample project for ESP32 S3 hardware with the following changes:
1. enable tinyUSB stack
2. enable vendor class with only 2 endpoints for bulk transfer (one IN and one OUT, buffer size are both 64 bytes)
3. ESP32 S3 is recognized as WinUSB device by PC and a test application on PC is used to receive data from ESP32 S3
4. in the main program of ESP32 S3, it is sending 64 bytes to PC every 4ms. The 64 bytes buffer is fixed and each byte is initialized to its index (meaning byte 0 is set to 0, byte 1 is set to 1,.... and byte 63 is set to 0x3F)
5. on the PC side, it is discovered the received data is NOT correct: for every 0x0a sent, ESP32S3 USB stack will automatically insert 0x0d before sending it to PC. It seems ESP32S3 USB is set to text mode and will automatically convert 0x0a (LF) to 0x0d,0x0a (CRLF)
See the attachment for the snapshot of data.
Anyone has encountered the same issue? Is there any setting to let USB work in binary mode?