Hard fault with old code

I haven’t used some old code for a looong while, now recompiled and am getting “hard fault” red SOS code
How do I diagnose and troubleshoot this?

Memory use looks Ok, right? I’m compiling with cli

Memory use: 
text     data   bss    dec      hex
89520    1284   12460  103264   19360

@ryotsuke, everything looks fine so it may be something in your code. You will need to post your code if you want us to take a look. :smile:

I didn’t want to post everything, was trying to isolate problem. Seems found it:

digitalWrite(D4, LOW);
digitalWrite(D4, HIGH);

_serial is Serial1
What I am doing here is stopping serial1, powering off serial device, powering on serial device and restarting Serial1
This fires when Serial1 stops receiveing data meaning my data source died because of something - this happens and I need to deal with it.

So this code should “reset” Serial1 and apparantly is dying on new firmware version. It was working on older ones.