Skip to content

Feat/improve linker scripts#640

Draft
FoniksFox wants to merge 8 commits intodevelopmentfrom
feat/Improve-Linker-Scripts
Draft

Feat/improve linker scripts#640
FoniksFox wants to merge 8 commits intodevelopmentfrom
feat/Improve-Linker-Scripts

Conversation

@FoniksFox
Copy link
Copy Markdown
Contributor

@FoniksFox FoniksFox commented May 4, 2026

Closes #625

[WIP]

A refactor of the Linker Script, Startup Code and System.c

Check the corresponding pr in the template-project to see the changes needed to make it work.

It implementes:

  • Initialized data sections for all memory domains with a copy table, so that ResetHandler can generally copy all data defined in the table.
  • A Linker Script with configurable ITCM memory via macros (C preprocessor) and the possibility to add all code to ITCM.
  • ISR vector always copied to ITCM.
  • Implement DTCM constants.
  • weak BoardInit function that gets called after SystemInit, but before global constructors

Not implemented yet (WIP):

  • Configuration checker (a function to check whether the provided ITCM size matches the defined size, and whatever other configuration that's deemed as necessary)

To discuss:

  • Should BoardInit have a weak definition or just be extern, so that the user has to implement it?
  • Should System.c be moved to ST-LIB or not?
  • Should rodata in ram be protected by the MPU? (Not implemente because of added complexity, and because that would need 6 extra regions and we only have 5 left, so we would need to invent something there...)

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.

RAM.ld doesn't work

1 participant