Error: Log "info" and "warning" messages to flash

Open
#216 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
c
Domain
embedded-iot

Research direction

Start with error_log_warning_msg and error_contract.c, then trace how flash functions are exposed in the flight computer firmware. Resolve the proposed frame format, including severity, FC_STATE, message storage, and spillover behavior, before implementing persistent info and warning logs. Done means the design is implemented and the resulting records can be recovered from flash.

Written by the indexing model from the issue text.

Description

enhancement

Requester: @ETSells

(Non-developer requests only): Is your feature request related to a problem? Please describe.
It is impossible to determine the causes of certain errors on the flight computer without a debugger attached.

Describe the solution you'd like
In theory, we could store frames in flash with the following format:

save_bit=1 byte = 1
fc_state=1 byte -> [7:6,5:0]
most significant = 2 bits for message severity, 0 = sensor frame, 1 = log msg, 2 = warn msg, 3 = error msg
least_significant = 6 bits for FC_STATE
message = remainder of sensor frame. maybe make it possible to spill over to multiple frames if 1 doesnt fit the message?

Describe alternatives you've considered
We've considered logging via LoRa, but that's not implemented yet.

Additional context
Recommend implementing callbacks in error_log_warning_msg that point to error_contract.c, which can in turn call flash functions in the project.

Points of Contact
POC flight computer firmware, error handling: @ETSells. POC SDEC: @journeyhancock.

Dominant language
C
Stars
8
Forks
6
Avg merge
6d 15h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SunDevilRocketry/Flight-Computer-Firmware

All issues in SunDevilRocketry/Flight-Computer-Firmware

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.