Getting strange chars in Serial output from time to time

Not sure if this helps at all, but I made a further edit to the code to use a Serial.write as well.


            uint32_t statkal = (((notifydata[4] << 8) + notifydata[5]) << 8) + notifydata[6];
            uint32_t statdistance = ((notifydata[7] << 8) + notifydata[8]);
            uint32_t statstep = (((notifydata[9] << 8) + notifydata[10]) << 8) + notifydata[11];
            uint32_t stattime = ((notifydata[12] << 8) + notifydata[13]);
            
            char buff[100] = "";
            sprintf(buff, "Data - Kcal: %lu  Time:%lu  Distance:%lu  Step: %lu", statkal, stattime, statdistance, statstep);
            Serial.println(buff);
            Serial.write(buff);
            Serial.println();

As you can see, there is no consistency here, buffer used in both the println and the write are the same.