I can't figured out the cause of ploblem from picture of board and schematic.
I guess, does some pins that has a voltage was grounded?
Vddd is doubtful I think.
If chip is getting hot most common problem is latchup, some thoughts -
1) Latchup occurs when a pin is taken outside power supply voltage, eg.
Vssd,Vssa > pin or pin > Vddd, Vdda. Then chip internally has a parasitic SCR
trigger shorting Vdd to Vss, and draws a lot of current obviously.
Question, chip getting hot immeadiatley, power supply showing high currents
immeadiately, or after CPU well into code ? Code your processor to just start,
but do nothing, sit in a loop immeadiately, right after startup. If Idd does not jump
to latchup condition then power system probably OK. Then suspect processor
GPIO triggering some load causing a transient on a pin outside supply rails.
2) You have a relay, I cannot see drive coil on schematic, I assume Q1 is driving it
and D50 is strapped across coil to suppress turnoff transients ? Check Q1 collector
with scope, to see it never transients outside Vddd, Vdda or < Vssd,a. Set scope
up to trigger on 5.5 initially, then - .5, to see if you ever get a transient outside power
supply rails. If your scope has deep memory trigger off init of power supply and look
at each pin (tedious) to see if you can qualify a trigger outside supplie rails.
3) Look at ground points around board, trigger off main ground reference , -.5, to
see if you can get a trigger. This is difficult as you would need to cycle power each time
you look at a new pin.
Some thoughts, Dana.