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

cortex-m-rt: Added _stack_end symbol for use with MSPLIM #565

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

korken89
Copy link
Contributor

@korken89 korken89 commented Oct 30, 2024

I have added the _stack_end as discussed in the meeting.

What I'm not 100% sure on is how this interacts with __sheap, as I can't really find documentation for what its guarantees are - plus that the symbol is private so no user code and safely use it.

Closes #564

@korken89 korken89 requested a review from a team as a code owner October 30, 2024 07:29
@korken89 korken89 changed the title cortex-m-rt: Added _stack_start symbol for use with MSPLIM cortex-m-rt: Added _stack_end symbol for use with MSPLIM Oct 31, 2024
@korken89 korken89 force-pushed the add-stack-start branch 2 times, most recently from 39478f0 to 4ecef20 Compare October 31, 2024 19:21
@adamgreig
Copy link
Member

Thanks! I think lining up with __sheap should be fine; by default that's what you'd want MSPLIM etc to be set to anyway.

My only outstanding concern is that the new docs say users must specify _stack_end if they set _stack_start, but a lot of people are already setting stack_start and this isn't meant to be a breaking change. In particular it ended up in a lot of templates and examples so has been copied to memory.x far and wide, annoyingly usually with _stack_start = ORIGIN(RAM) + LENGTH(RAM); which is the default anyway! Perhaps the documentation around setting _stack_start could be clearer about when you must also set _stack_end and what will happen if you don't?

@korken89
Copy link
Contributor Author

korken89 commented Nov 2, 2024

Thanks for the comment @adamgreig, I've updated the wording to be more clear.

@adamgreig adamgreig added this pull request to the merge queue Nov 3, 2024
Merged via the queue into rust-embedded:master with commit ff9c1aa Nov 3, 2024
11 checks passed
@korken89 korken89 deleted the add-stack-start branch November 4, 2024 07:59
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.

cortex-m-rt linker script symbols are hard to use with thumbv8 MSPLIM
2 participants