Skip to content

File syn_coredump.c

FileList > src > syntropic > system > syn_coredump.c

Go to the source code of this file

Persistent core dump implementation. More...

  • #include "../port/syn_port_flash.h"
  • #include "../port/syn_port_system.h"
  • #include "../util/syn_assert.h"
  • #include "../util/syn_crc.h"
  • #include "syn_coredump.h"
  • #include <string.h>

Public Functions

Type Name
void syn_coredump_clear (void)
Clear the core dump from flash.
bool syn_coredump_read (SYN_CoreDump * out)
Read a core dump from flash.
void syn_coredump_save (const SYN_FaultContext * ctx)
Save a core dump to flash.

Public Static Functions

Type Name
uint32_t coredump_compute_crc (const SYN_CoreDump * dump)
Compute CRC-32 over all fields preceding the crc member.

Detailed Description

Writes fault context + partial stack to a reserved flash sector. Designed to be callable from a hard fault handler (no heap, no locks, minimal stack usage).

Public Functions Documentation

function syn_coredump_clear

Clear the core dump from flash.

void syn_coredump_clear (
    void
) 

Erases the reserved sector so subsequent reads return false.


function syn_coredump_read

Read a core dump from flash.

bool syn_coredump_read (
    SYN_CoreDump * out
) 

Validates the magic number and CRC. If valid, copies the dump into the output buffer.

Parameters:

  • out Output buffer for the core dump.

Returns:

true if a valid core dump was found.


function syn_coredump_save

Save a core dump to flash.

void syn_coredump_save (
    const SYN_FaultContext * ctx
) 

Safe to call from a hard fault handler: no heap, no locks. Erases the reserved sector and writes the dump.

Parameters:

  • ctx Register context captured at fault time.

Public Static Functions Documentation

function coredump_compute_crc

Compute CRC-32 over all fields preceding the crc member.

static uint32_t coredump_compute_crc (
    const SYN_CoreDump * dump
) 

Parameters:

  • dump Core dump to checksum.

Returns:

CRC-32 value.



The documentation for this class was generated from the following file src/syntropic/system/syn_coredump.c