Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add central memory layout for FRAM #304

Merged
merged 17 commits into from
Jun 23, 2024
Merged

Add central memory layout for FRAM #304

merged 17 commits into from
Jun 23, 2024

Conversation

wassr
Copy link
Member

@wassr wassr commented Jun 18, 2024

Fixes #293

@wassr
Copy link
Member Author

wassr commented Jun 19, 2024

The defined constants still need to be put into some files which define these constants themselves. This will probably lead to a chicken-and-egg problem in files which are needed by FramLayout for size information but need FramLayout themselves for address and capacity information (e.g. Edu/ProgramStatusHistory.hpp).

The reason for this is that totalSerialSize<> ensures that the serial
size of its arguments is not 0.
For some reason codespell wants to rename FramLayout.hpp to
framelayout.hpp. Since this is a filename I cannot add code comment or
something to tell codespell to ignore it. Therefore, I put framlayout on
the ignore list.
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 68.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 87.58%. Comparing base (2e2fd75) to head (ef4d890).

Files Patch % Lines
Sts1CobcSw/Periphery/Section.ipp 0.00% 6 Missing ⚠️
Sts1CobcSw/Edu/ProgramQueue.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   88.34%   87.58%   -0.76%     
==========================================
  Files          27       28       +1     
  Lines         695      701       +6     
  Branches        8        8              
==========================================
  Hits          614      614              
- Misses         81       87       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Section<> only has static members. Accessing them through the instances
defined in FramLayout.hpp would yield clang-tidy warnings. Therefore, I
provided type aliases for convenience.
The type alias is added in preparation for turning Address and Size into
strong types.
LfsStorageDevice.hpp is not yet renamed to prevent merge conflicts with
the lfs wrapper branch.
@PatrickKa PatrickKa marked this pull request as ready for review June 23, 2024 13:13
@PatrickKa PatrickKa self-requested a review June 23, 2024 13:13
@PatrickKa
Copy link
Contributor

The chicken-and-egg problem will be solved by defining the sections sizes independent of the things they hold. That means that ProgramQueue.hpp and ProgramStatusHistory.hpp depend on the FRAM layout, but not vice versa. Of course, we can, and do, statically assert that the queue and the status history fit in their respective sections. I think this is a simple, easy, and sound solution.

@PatrickKa PatrickKa merged commit 19123a7 into master Jun 23, 2024
6 checks passed
@PatrickKa PatrickKa deleted the fram-layout-293 branch June 23, 2024 13:20
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.

Add central memory layout for FRAM
3 participants