bd57e00448
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.
22 lines
573 B
C
22 lines
573 B
C
// XFLASH dumper
|
|
#pragma once
|
|
#include "xflash_layout.h"
|
|
|
|
enum class dump_crash_reason : uint8_t
|
|
{
|
|
manual = 0,
|
|
stack_error,
|
|
watchdog,
|
|
};
|
|
|
|
#ifdef XFLASH_DUMP
|
|
void xfdump_reset(); // reset XFLASH dump state
|
|
void xfdump_dump(); // create a new SRAM memory dump
|
|
|
|
// return true if a dump is present, save type in "reason" if provided
|
|
bool xfdump_check_state(dump_crash_reason* reason = NULL);
|
|
|
|
// create a new dump containing registers and SRAM, then reset
|
|
void xfdump_full_dump_and_reset(dump_crash_reason crash = dump_crash_reason::manual);
|
|
#endif
|