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

Why assert _stext is within FLASH? #574

Open
meowcakes opened this issue Jan 16, 2025 · 1 comment
Open

Why assert _stext is within FLASH? #574

meowcakes opened this issue Jan 16, 2025 · 1 comment

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?

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