2021-06-08 15:28:02 +02:00
|
|
|
// XFLASH dumper
|
|
|
|
#pragma once
|
|
|
|
#include "xflash_layout.h"
|
|
|
|
|
2021-06-10 17:35:49 +02:00
|
|
|
enum class dump_crash_reason : uint8_t
|
2021-06-09 13:59:26 +03:00
|
|
|
{
|
|
|
|
manual = 0,
|
|
|
|
stack_error,
|
|
|
|
watchdog,
|
2021-06-14 11:30:38 +03:00
|
|
|
bad_isr,
|
2022-01-28 15:22:08 +01:00
|
|
|
bad_pullup_temp_isr,
|
|
|
|
bad_pullup_step_isr,
|
2021-06-09 13:59:26 +03:00
|
|
|
};
|
|
|
|
|
2021-06-12 13:37:20 +02:00
|
|
|
#ifdef XFLASH_DUMP
|
2021-06-16 23:58:00 +02:00
|
|
|
void xfdump_reset(); // reset XFLASH dump state
|
|
|
|
void xfdump_dump(); // create a new SRAM memory dump
|
2021-06-12 13:37:20 +02:00
|
|
|
|
2021-06-11 19:21:51 +02:00
|
|
|
// return true if a dump is present, save type in "reason" if provided
|
|
|
|
bool xfdump_check_state(dump_crash_reason* reason = NULL);
|
|
|
|
|
2021-06-08 15:28:02 +02:00
|
|
|
// create a new dump containing registers and SRAM, then reset
|
2021-06-16 23:58:00 +02:00
|
|
|
void xfdump_full_dump_and_reset(dump_crash_reason crash = dump_crash_reason::manual);
|
2021-06-08 15:28:02 +02:00
|
|
|
#endif
|