[boot] Check PC for dead loops
authorBrad Griffis <bgriffis@ti.com>
Wed, 17 Jul 2019 17:39:50 +0000 (12:39 -0500)
committerBrad Griffis <bgriffis@ti.com>
Wed, 17 Jul 2019 17:39:50 +0000 (12:39 -0500)
am57xx-boot.dss

index 6443087c5253bde744e952381c4f2e32188a6b74..1e672e4ab49ed596fdcf9463ac7ff7834d60a142 100755 (executable)
@@ -446,5 +446,49 @@ decode_prm_rstst(reg_val);
 
 debugSessionDAP.target.disconnect();
 
 
 debugSessionDAP.target.disconnect();
 
+debugSessionA15 = ds.openSession("*","CortexA15_0");
+debugSessionA15.target.connect();
+
+// Get value of ARM Program Counter
+value = debugSessionA15.memory.readRegister("PC");
+value_string = d2h(value);
+file.write(newline + "Cortex A15 Program Counter = 0x" + value_string + newline);
+switch (value){
+       case 0x38080:
+               file.write("  -> Undefined exception default handler" + newline);
+               break;
+       case 0x38084:
+               file.write("  -> SWI exception default handler" + newline);
+               break;
+       case 0x38088:
+               file.write("  -> Prefetch abort exception default handler" + newline);
+               value = debugSessionA15.memory.readRegister("R0");  // handler stores IFAR in R0
+               file.write("  -> IFAR = " + d2h(value) + newline);
+               value = debugSessionA15.memory.readRegister("R1");  // handler stores IFSR in R1
+               file.write("  -> IFSR = " + d2h(value) + newline);
+               break;
+       case 0x3808C:
+               file.write("  -> Data abort exception default handler" + newline);
+               value = debugSessionA15.memory.readRegister("R0");  // handler stores DFAR in R0
+               file.write("  -> DFAR = " + d2h(value) + newline);
+               value = debugSessionA15.memory.readRegister("R1");  // handler stores DFSR in R1
+               file.write("  -> DFSR = " + d2h(value) + newline);
+               break;
+       case 0x38090:
+               file.write("  -> Unused exception default handler" + newline);
+               break;
+       case 0x38094:
+               file.write("  -> IRQ exception default handler" + newline);
+               break;
+       case 0x38098:
+               file.write("  -> FIQ exception default handler" + newline);
+               break;
+       default:
+               break;
+}
+
+
+debugSessionA15.target.disconnect();
+
 file.close();
 print("Created file " + filename);
 file.close();
 print("Created file " + filename);