Skip to content

Why assert _stext is within FLASH? #574

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

Closed
meowcakes opened this issue Jan 16, 2025 · 2 comments
Closed

Why assert _stext is within FLASH? #574

meowcakes opened this issue Jan 16, 2025 · 2 comments

Comments

@meowcakes
Copy link

meowcakes commented Jan 16, 2025

In link.x.in there is an ASSERT to prevent _stext being outside of flash. This prevents e.g. running the code from RAM after loading .text into RAM inside a pre_init with .text configured like

.text :
  {
      ...
  } > RAM AT > FLASH

ASSERT(_stext >= ORIGIN(FLASH) && _stext < ORIGIN(FLASH) + LENGTH(FLASH), "

@adamgreig
Copy link
Member

To configure such a .text, wouldn't you need a custom linker script anyway, at which point you can just not include that assert?

@adamgreig
Copy link
Member

Closing this for now as there's not been any activity in a while, but please comment if this is still causing problems.

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