Crash at pc 0802ff4a

A C++ game I'm working works fine on the simulator, but crashes on device. Here's the log:

   r0:00000000    r1:00000000     r2:00030c97    r3: 00000000
  r12:006d3000    lr:0803022b     pc:0802ff4a   psr: 61000000
 cfsr:00000082  hfsr:00000000  mmfar:00000000  bfar: 00000000
heap allocated: 1080896
Lua totalbytes=113800 GCdebt=-56640 GCestimate=56960 stacksize=42

System version is 1.11.0.

Clearly, I haven't provided much additional detail. I am not yet sure what line of code is causing the crash. However, since the program counter is in kernel-space, I assume it's crashing in some playdate API function somewhere.

It would be very helpful, in situations like this, to be able to print a special message on crash to help debug the cause of the crash. Even if there were just a special register that we could write to which, on crash, would be printed as a hex value, it would be tremendously helpful. Print statements aren't reliable enough to determine the location of the crash, as the tx buffer might not be flushed by the time the system crashes.

1 Like