SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::memory_monitor Class Reference

#include <memory_monitor.hpp>

Public Member Functions

 memory_monitor (memory_monitor const &)=delete
void operator= (memory_monitor const &)=delete
void start (int32_t delay=CONFIG_FLASH_MONITOR_BURST_DELAY_SECS)
 Start the flash-monitor task.
void stop ()
 Stop the flash-monitor task.

Static Public Member Functions

static memory_monitorget_instance ()
static void flash_monitor_hdlr (struct k_work *work)
 Work-queue handler that scans the active firmware image for unrecoverable flash ECC errors.

Detailed Description

Definition at line 35 of file memory_monitor.hpp.

Constructor & Destructor Documentation

◆ memory_monitor()

satnogs::comms::memory_monitor::memory_monitor ( memory_monitor const & )
delete

Member Function Documentation

◆ flash_monitor_hdlr()

void satnogs::comms::memory_monitor::flash_monitor_hdlr ( struct k_work * work)
static

Work-queue handler that scans the active firmware image for unrecoverable flash ECC errors.

Scan a slice of the running firmware image for unrecoverable ECC errors.

Each invocation processes exactly burst_bytes (1 KiB) of the active MCUboot slot, then reschedules itself after m_burst_delay_ms. Any flash_read() that returns -EIO is interpreted as a double-bit ECC error and translated to ::flash_read_exception, which the policy layer treats as a reboot request.

Exceptions
flash_init_exceptionFlash device or slot not accessible.
flash_read_exceptionUnrecoverable ECC or other flash fault.

Definition at line 117 of file memory_monitor.cpp.

◆ get_instance()

memory_monitor & satnogs::comms::memory_monitor::get_instance ( )
inlinestatic

Definition at line 39 of file memory_monitor.hpp.

◆ operator=()

void satnogs::comms::memory_monitor::operator= ( memory_monitor const & )
delete

◆ start()

void satnogs::comms::memory_monitor::start ( int32_t delay = CONFIG_FLASH_MONITOR_BURST_DELAY_SECS)

Start the flash-monitor task.

Schedules the first scan immediately on the system work-queue and enables subsequent periodic re-scheduling. If the monitor is already running the call is ignored.

Parameters
delayDelay in seconds to pause after reading burst_bytes (e.g. default value of CONFIG_FLASH_MONITOR_BURST_DELAY_SECS or a new value set by a telecommand).

Definition at line 53 of file memory_monitor.cpp.

◆ stop()

void satnogs::comms::memory_monitor::stop ( )

Stop the flash-monitor task.

Cancels the pending (or timer-armed) work item so that no new scan will start after this call. If a scan of a flash chunk is already executing it is allowed to finish once.

Note
If the monitor is already stopped the call has no effect.

Definition at line 73 of file memory_monitor.cpp.


The documentation for this class was generated from the following files: