Davidelvig
Well-known member
I cannot make this fail on a small program...
With my large project, Serial.Print() (or printf() or println()) stop working after a few seconds.
It has done this on and off as the program has morphed.
After Serial.print() stops outputting, the program otherwise seems to keep running, with microphone and touch pin input and Serial1 output to a MIDI synth. The loop() keep looping.
Just the serial output stops.
Even Serial input appears intact. The following code still executes when the letter D <enter> is typed.
I'm not out of memory from code or initial data:
It's challenging to debug (without console output). I've been commenting/uncommenting chunks of code to see if I can reliably make it fall/succeed.
I expect I have a boundary condition not covered well, though I can't find it.
Thanks!
With my large project, Serial.Print() (or printf() or println()) stop working after a few seconds.
It has done this on and off as the program has morphed.
After Serial.print() stops outputting, the program otherwise seems to keep running, with microphone and touch pin input and Serial1 output to a MIDI synth. The loop() keep looping.
Just the serial output stops.
Even Serial input appears intact. The following code still executes when the letter D <enter> is typed.
Code:
if (Serial.available()) {
char c = Serial.read();
switch(c) {
case 'd': case 'D':
midiSynth.testDrums(100);
break;
default:
break;
}
}
I'm not out of memory from code or initial data:
Teensy 3.6. Arduino 1.8.3. Teensyduino 1.37Sketch uses 154172 bytes (14%) of program storage space. Maximum is 1048576 bytes.
Global variables use 52596 bytes (20%) of dynamic memory, leaving 209548 bytes for local variables. Maximum is 262144 bytes.
It's challenging to debug (without console output). I've been commenting/uncommenting chunks of code to see if I can reliably make it fall/succeed.
I expect I have a boundary condition not covered well, though I can't find it.
- Does this ring a bell for anyone?
- What can clobber Serial without clobbering the program.
- Any suggestions for how to debug?
Thanks!