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

Linker segment for info segment #21

Open
vadixidav opened this issue Mar 20, 2023 · 1 comment
Open

Linker segment for info segment #21

vadixidav opened this issue Mar 20, 2023 · 1 comment

Comments

@vadixidav
Copy link

Many MSP430 have an info segment. In particular, the MSP430i20x1 has an info segment at address 0x1000 that is 1 KB in length. It would make sense to create a linker segment or perhaps allow this linker segment to be provided by the PAC to msp430-rt so that it can be included in the sections. This would allow global statics to be instantiated which can be located in the info segment without any handling of pointers. I think using linker segments is the right way to handle this. I think one large linker segment is probably sufficient. Any handling of block erasure needs to be carefully handled anyways, and this would only be useful for the process of reading the data and writing the data post erasure.

If anyone else has an alternative concept for how the info segment should be dealt with, please chime in. I am currently just using a raw address in my code, but I think that a more robust solution would use the linker since then it should be possible to have the size of the data placed into the segment be limited at link time and then the user wont need to worry about the underlying address (except when erasing, which they have to do anyways).

@cr1901
Copy link
Contributor

cr1901 commented Mar 20, 2023

Please see postcard-infomem, specifically the examples crate for my take on this exact topic :). I would advise using my crate; actually getting the API even somewhat close to ergonomic was much more difficult than I thought, and I could use the feedback.

The example working properly on msp430 is blocked on rust-lang/compiler-builtins#520, but I can confirm writing/reading infomem works at least.

Also see the msprun command for an ergonomic way to program information memory in one command.

I do not plan on adding infomem functionality to this crate specifically. So I think this is more of a question and should be closed.

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

No branches or pull requests

2 participants