Skip to content

Code Size Feature Flags + Restart Policy Modifications - #53

Open
tyler-potyondy wants to merge 3 commits into
masterfrom
ents/cfg-feature
Open

Code Size Feature Flags + Restart Policy Modifications#53
tyler-potyondy wants to merge 3 commits into
masterfrom
ents/cfg-feature

Conversation

@tyler-potyondy

Copy link
Copy Markdown
Collaborator

Pull Request Overview

This pull request adds some make / rust feature flag changes to enable conditional compilation for various debug features that incur a code size overhead. The net effect of this PR is that the default make for the lora e5 mini board now results in a 45 kB binary size.

The new flags / usages are detailed in the README for the board.

Additionally this PR updates our fault policy. For the standard build, we default to app's restarting on faults in the application. Kernel panics now result in us just rebooting the board. Although this is good from a robustness/code size standpoint, there is now no infrastructure/signal to notify a developer that the board rebooted and panicked (panics in the kernel are now silent). This seems good for deployed devices, but can be confusing if you're building the board. Adding the flag: make -- --dev will enable all debugging features (process console, verbose panics, stop kernel on app faults etc).

Finally, to make sure these new cfg flags don't result in code paths that don't build, I also added a script to CI that tries to build all combinations of the cfg feature flags.

Claude was used for a lot of the scripting changes, but I reviewed.

Testing Strategy

This pull request was tested on the board.

TODO or Help Wanted

N/A

Tock + ENTS Developer PR Form

  • Completed Developer Effort PR Form

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

AI Use

  • The PR description details my use of AI in the production of the
    code in this PR, if any, and I have manually checked and
    personally certify the entire contents of this PR.

@tyler-potyondy

Copy link
Copy Markdown
Collaborator Author

Ah I realized what the issue is, the default build now gets rid of debug! to be a no-op. This means the litex/qemu tests are now no longer passing (since they check the logs for print outputs). I let copilot try to fix this and it failed :)

Will revert copilot's commit and push the actual fix.

@jmadden173

Copy link
Copy Markdown

Issue with running the script

  - debug-macro: build failed
  - process-console + debug-macro: build failed
  - debug-macro + halt-on-panic: build failed
  - all three: build failed
  - dev=1: build failed
  - --debug-macro: build failed
  - --dev: build failed
  - --process-console --debug-macro --halt-on-panic: build failed

This adds flags for the process console, debug macro, and fault policy
to pass as make arguments and feed into the cargo build as features
…flags

Baseline board does not include process console/debug macro/panic printing
and restarts apps on faults. This reduces the kernel code size substantially.
… build

lora_e5_mini now uses cfg flags and conditionally compiles to reduce code size.
This can introduce some brittleness so we add this script to CI to test building
kernel with each combination of flags.
@tyler-potyondy

Copy link
Copy Markdown
Collaborator Author

Should be good to go now + CI is passing. Maybe worth testing on your end too @jmadden173 just to confirm any problems are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants