xil-se / xildebug_sw

XilDebug is a CMSIS-DAP compliant debugger, UART bridge and power profiler all in one package.
5 stars 1 forks source link

Proper error handler #63

Open kbeckmann opened 6 years ago

kbeckmann commented 6 years ago

Not sure how much energy we should spend on this but it kinda sucks to do

if (r != ERR_OK)
    while (1) ;

We don't need to do fancy ram dumping and so on, but just halt the cpu and perhaps disable interrupts and that we get a central point where we can set a breakpoint when debugging.

arturo182 commented 6 years ago

It was just made like this because when I wrote it we had no UART support, now we could actually print to uart or do something else that's smart :P

kbeckmann commented 6 years ago

Ideally we should print it to the control cdc that hasn't been implemented yet.. :P

arturo182 commented 6 years ago

It is now ;)

arturo182 commented 6 years ago

If we implement the HID CLI mentioned in #44 then we could actually have ram dumping and then fetching over CLI. But we would need to use 64K of flash for the dump area.

kbeckmann commented 6 years ago

Think we can survive with an error handler that stalls the cpu and lets you attach with a debugger..

arturo182 commented 6 years ago

Debugging a debugger :O

EnJens commented 6 years ago

we could have 'offline' semi-dumps where we just dump the absolutely minimum, say current PC of all threads, the last few lines of logs, just the bare minimum to get something useful. Wouldn't take many KB.

arturo182 commented 6 years ago

we don't really have logs right now :P can't just print on the cdc cause can't know if that was log or dut uart