I default to outputting most “early boot” messages (of which I added many), as serial port output is not available during early boot, and USB connectivity can break if the device is broken into the debugger.
Future improvements may include compile-time or dynamic selection of output modality(ies): RTT, debug UART, both, etc. But for now, I’m just glad to have figured it out enough to integrate!
Very impressive Henry. It looks like a well thought out and full featured debug system to me.
At this point it hasn’t touched much code in the actual firmware. Can we use this chance to make it a compile time option? I understand there to be debug levels, but it doesn’t look like it’s currently possible to disable it all together.
This is a pretty major update that will be applied to many places in the firmware. I’d like to have a dead stop option that disables it if we need to to triage at some point or test for strange bugs.
The NAND demo (iirc) did a clever trick where it wrapped the contents of the debug functions in #ifdef#endif, so they were optimized out without surrounding every use of the debug in the code.
I gave it a try with a picoprobe today. The default apt install of openocd on Ubuntu 22.04.4 wasn’t working for me, so I got the latest openocd from git (main branch). Built and installed and it worked just fine.
@henrygab - your instructions are great! No problems at all, once I built the latest openocd: