Special Debugging Case


I have this little setup working:

-a mega with various sensors and actuators and spi-sdcard logging
-a promini with 20x4 lcd + encoder
-a I2c RTC

ALL of them on the same I2c bus lines, mega is the master and share data with the promini.

at this point all worked and i have copy of the working code (it is very long) so no drama :slight_smile:

Then i want to put the lcd and encoder directly on the mega, i mixed both sketches together, at some point they compile nicely so => upload…and then nothing happen, at first the mega is supposed to read a config file on the sd card and flash a light if successful, also the first lines of the setup(); are:

void setup(){

But nothing at all appears on the serial monitor.
the code also have a serial event and can respond to some commands by serial, but it don’t work too.

I have tried to comment the most possible code to debug, but every time it compile without errors and i have no reaction from the board…no serial, no led, no lcd, no… nothing.

I upload back the working copy, it still work.(light the led meaning the sdcard was read, send serial messages and respond to commands)

have this happened to you guys before? if so I’ll be happy to hear how you deal with a case like this!


Did you use either pin 0 or 1 in the changes?

no, reserved for serial, i use the two other serial lines as well to talk to sensors... edit: two of the 3 others...the program uses 28% of space and 55% in ram, lot of F(strings).

I have had something like this and it was caused by a loop that was assigning into an array and I walked right past the end of the array and clobbered something important. My code simply locked up. Your may have overwritten something else. I always reboot on something like this, too. While it shouldn't happen, I've seen code that can write a pointer outside its address space.

ardiy: if so I'll be happy to hear how you deal with a case like this!

I go through the code and find the spot where I coded something wrong. If you want us to help you out with that then guess what you'll need to post for us to see.

thank you guys, I will share some soon but this one i just can't.. Finally I found the solution by commenting a lot of code and uncommenting it step by step as possible: using the RTClib, I had a declaration of :DateTime now; in double in two different files of the sketch.(I forgot to delete one after the copy of the file from the promini sketch) still strange thing that it compiled without errors... a+