Commit Graph

8 Commits

Author SHA1 Message Date
Yuri D'Elia
dd8c6c064c xfdump: simplify stack debugging (sample pc+sp)
Instead of having to guess the PC where the SP was sampled, always take
both. This allows "seamless" stack decoding for both serial and xflash
dumps, since we don't have to guess which function generated the dump.

Make the core functions (doing the sampling) be ``noinline`` as well,
so that they always have valid frame.
2021-06-17 01:29:25 +02:00
Yuri D'Elia
928c7211ad emergency handlers: always save SP _at_ the crash location
Save SP which is closest to the crash location, which simplifies
debugging. For serial_dump, write SP just before the dump.
For xfdump, save SP in the dump header.

This makes xfdump_dump and xfdump_full_dump_and_reset() equivalent for
stack debugging.
2021-06-15 11:47:27 +02:00
Voinea Dragos
8e667a8acd bad ISR catch 2021-06-14 11:30:38 +03:00
Yuri D'Elia
bd57e00448 Implement an online crash dumper for MK2.5 boards
When XFLASH is not available, allow users to request _online_ crash
dumps by using D23 (since these require active user cooperation).

Once enabled, instead of just rebooting, dump memory directly to
the serial.

As similarly done with EMERGENCY_DUMP, we have two features that can be
enabled:

EMERGENCY_SERIAL_DUMP: enables dumping on crash after being requested
MENU_SERIAL_DUMP: allow triggering the same manually through the support
menu.
2021-06-12 13:37:20 +02:00
Yuri D'Elia
3187b96ca4 xfdump: report to the host that a dump is available
As suggested by @3d-gussner, announce to the host that a dump is
available for retrieval using an action "dump_available".

Any kind of dump is announced (even if manually triggered).

To avoid reading from xflash twice, remove some duplication and return
the crash reason directly in xfdump_check_state().
2021-06-11 19:21:51 +02:00
Yuri D'Elia
31f416fd5e Rename dump_crash_source to dump_crash_reason 2021-06-10 17:35:49 +02:00
Voinea Dragos
1e786c7f55 WDR crash initial 2021-06-09 13:59:26 +03:00
Yuri D'Elia
6dfef76346 xfdump: implement dump-to-xflash functionality
Update xflash_layout to include information about the dump, which sits
at the end of xflash.
2021-06-08 15:28:02 +02:00