DigiCDC/ SerialUSB not working on Digispark

I wrote the following code for a Digispark 16.5Mhz, using the Arduino IDE:

#include <DigiCDC.h>

int recvBuffer[64];

void setup()
{
    SerialUSB.begin();
}

void loop()
{
    int idx = 0;
    
    while (SerialUSB.available())
    {
        SerialUSB.write(SerialUSB.available());
        recvBuffer[idx] = SerialUSB.read();
        idx++;
    }
    for (int i = 0; i < idx; i++)
    {
        SerialUSB.write(recvBuffer[i]);
    }
}

Sending 16 characters 123456789012345+LF to the board via a Serial Terminal produces the following output:

08 0F 0E 0D 0C 0B 0A 09 08 07 06 05 04 03 02 01
31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 0A

Sending 17 characters 1234567890123456+LF produces the following output:
08
and crashes the board.

What is the first 08? It should be 10 and 11.
Why is 17 characters crashing the board? Is the problem with the software or the hardware?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.