Coffee
1
I am debugging some code, and sometimes (but not always) the console just returns “random” data like this:
(there is some plaintext in the second screenshot)
do you have an idea how this could happen? What do I have to look for to fix it?
EDIT: Using Serial
with: Serial.begin(9600);
Coffee, is the output on the Spark’s Serial1 or Serial ports? What baudrate are you using?
Coffee
3
I am Using Serial
with 9600 baud: Serial.begin(9600);
The problem looks like:
- The linux com port is not set to 9600, or
- The linux port is not set for 8bits, 1 stop bit, No parity, or
- The connecting wires are loose or poorly connected, or
- The Spark is under-powered via the USB connector for some reason (not enough current or voltage or both).
Check the first three and if you can, power the Spark from a different power supply than the USB (if you are not doing so already).
Coffee
5
I believe it was due to variables not beeing initialized are or accessing pointers that point to old/freed memory. … still testing …
i have the feeling that Serial.print() prints a not-initialized String
and after dumps the whole memory. Just an idea.
timb
6
Yeah, looks like bad pointers. Can you post your code? Also, do the checks @peekay123 recommended.
My mama always told me never to point… with bad pointers that is!