Couldn't track the exact origin of the problem related below and I haven't found exactly the same problem on any of the forums and bug tracks I have looked for, although I have tried a lot of insights from similar problems. After days of struggle and failures I have stripped down the code to a minimum and yet I have the same problem.
I am using the ESP32C3 Supermini on an application that requires the reception and processing of about 100kBytes of ASCII data (intel hex). The board is connected to a host computer using the native USB CDC interface. The data is transferred by pasting the data on a serial terminal application on PC but the board keeps loosing characters on reception.
EDIT: The same behavior happens with the ESP32S2 and xiao ESP32C6 boards.
More details below.
Board: ESP32C3-Supermini
Hardware Setup: Windows PC(Win 11), USB-C cable, ESP32-C3 Supermini
Development Platform: Arduino 2.3.3, ESP32 board package 3.1.0
Application: Eprom emulator. It requires the reception and processing of about 100kBytes of ASCII data (intel hex file for a 32k eprom)
Issues found:
- Loosing characters on reception, even setting bigger (1k) buffers.
- No matter the baudrate, it 'eats' all the characters instantaneously. (for comparison, the same program running on an Arduino Nano at 9600bps took 3.8 seconds to receive the same amount of characters that the ESP32 got instantaneously)
Steps to reproduce:
1) Upload the code below
Code: Select all
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available()) {
Serial.write(Serial.read());
}
}Code: Select all
:100130003F0156702B5E712B722B732146013421C7
.... more 108 lines like the above
:100130003F0156702B5E712B722B732146013421C7
:10010000214601360121470136007EFE09D2190140
:00000001FF4) paste the file created in step 2.

Question:
Is there any workaround for this problem or is it inherent to the CDC peripheral on the ESP32C3 ?
Thanks!


