Building Better Medical Devices by Solving Embedded Data Challenges

After the Alarm, Can Your Medical Device Tell the Whole Story?

An infusion pump reports an operational interruption. Moments later, it loses power. When the device restarts, a service engineer finds an alarm code. To investigate, the engineer needs to know which operating mode was active, which configuration was loaded, and whether the last sensor readings were valid. If those details live in separate logs or disappear during a restart, reconstructing the event can take longer than reproducing the fault. 

A useful diagnostic history starts with the questions someone will need to answer after an event. For a pump, that could mean preserving four pieces of context together.

What to record

What it helps explain

Event code, boot identifier, and event sequence 

What happened and where it fits in the device’s history 

Operating state and relevant sensor readings, with quality flags 

What the device observed and whether those readings were usable 

Configuration revision and firmware build 

Which settings and software were active when the event occurred 

Timestamp and clock validity 

Whether the event can be correlated with other records by wall-clock time 

The application assigns measured speed and load to configuredCapture these fields when the event is detected. If a background task reads the current state a few milliseconds later, the device may already have changed modes. The resulting record could describe the state after the event. A fixed-size snapshot passed to a logging task preserves the association and gives the engineering team a clear place to specify what happens when the queue fills. Collect only the diagnostic fields the product requirements justify. 

An MCU like STM32H573I-DK provides a development target for prototyping this design on STM32H5. ITTIA DB Lite, the microcontroller database in the ITTIA DB Platform, provides transactional storage for the event and its associated context. The firmware defines what belongs in the snapshot and when to capture it. The database groups the corresponding records in one transaction.  

Make the event and its context survive together 

Suppose the firmware stores an event header and a separate sensor snapshot. If power drops between the two writes, a service tool could find the alarm and have no way to tell which readings went with it. A transaction gives both writes a shared commit point. The verification objective is concrete. After restart and recovery, a lookup by event ID should find either both records or neither, depending on whether the transaction committed. 

The C example below shows the application-side logging function for an STM32CubeH5 project. The storage_* functions are application-adapter interfaces you implement with the ITTIA DB Lite SDK. A single background logging task calls this function after receiving a snapshot from the event producer.

#include <stdbool.h> 
#include <stdint.h> 
 
typedef struct { 
    uint32_t boot_id;          /* Unique across retained boots */ 
    uint32_t sequence;         /* Unique within this boot */ 
    uint32_t event_code; 
    uint32_t operating_state; 
    uint32_t config_revision; 
    uint32_t firmware_build; 
    uint64_t timestamp_ms; 
    bool clock_valid; 
    int32_t motor_current_ma; 
    bool current_valid; 
} DeviceEvent; 
 
typedef enum { 
    EVENT_SAVED, 
    EVENT_WRITE_FAILED, 
    EVENT_COMMIT_UNCONFIRMED 
} EventResult; 
 
/* Application adapter implemented with the ITTIA DB Lite SDK. */ 
bool storage_begin(void); 
bool storage_insert_event_header(const DeviceEvent *event); 
bool storage_insert_event_snapshot(const DeviceEvent *event); 
bool storage_commit(void); 
void storage_abort(void); 
 
EventResult persist_device_event(const DeviceEvent *event) 
{ 
    if (!storage_begin()) { 
        return EVENT_WRITE_FAILED; 
    } 
 
    if (!storage_insert_event_header(event) || 
        !storage_insert_event_snapshot(event)) { 
        storage_abort(); 
        return EVENT_WRITE_FAILED; 
    } 
 
    if (!storage_commit()) { 
        return EVENT_COMMIT_UNCONFIRMED; 
    } 
 
    return EVENT_SAVED; 
}

Use (boot_id, sequence) as the unique key in both tables for a single-device database. If the wall clock is invalid, the sequence still provides ordering within the boot. The adapter should resolve an unconfirmed commit before the next write. Reopen or recover storage as required by the SDK, look up the original event key, and retry with that same key only if recovery confirms the transaction is absent and the original snapshot is still available. 

Power can also fail before the logging task reaches the database. A snapshot still in RAM can be lost. Make that interval explicit in the design and verify it separately. The example illustrates the transaction boundary and requires the SDK adapter, target storage configuration, and verification on the STM32H5 board. 

Build the evidence behind certifiability 

Certifiability starts with a claim the engineering team can test. For example, after recovery from an interruption during an event transaction, the service interface shall never return an event header without its matching snapshot. That requirement gives testers an observable outcome and gives reviewers a direct link between the storage design and its verification evidence. 

IEC 62304 provides a framework for medical-device software lifecycle processes. ISO 14971 defines a process for identifying hazards, evaluating risks, implementing controls, and monitoring their effectiveness. If the device’s risk analysis identifies event integrity as relevant to a risk control, the manufacturer can trace that control to a software requirement, the database integration design, and verification results from the target.

Verification scenario

Evidence to capture 

Cut power between the header and snapshot writes

Recovery logs and a query showing the incomplete transaction is absent

Cut power around commit

Results across repeated trials showing either a complete record or no record, with no duplicate event key after recovery

Fill storage or saturate the logging queue

The configured failure response, how record loss is surfaced, and measured impact on control timing

Change the firmware or invalidate the clock

Evidence that older records retain their original firmware and configuration identifiers, and that invalid wall-clock time is flagged

For the ITTIA DB Platform, the certifiability value is a transactional storage component with behavior the device team can define, exercise, and document. Record the ITTIA DB Lite version, firmware build, STM32H5 target, storage medium, and relevant configuration with the test results. That ties each result to a reproducible device build. The manufacturer owns the risk analysis, integration verification, and conformity assessment for the complete device.  

Bring your event schema and recovery requirements to ITTIA

Request an STM32H5 evaluation or meet with an embedded data specialist to discuss how ITTIA DB Lite can support your diagnostic history and verification plan.

Request Demonstration