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

arm: cortex_m: fix vector table relocation in non-XIP builds #31872

Conversation

ioannisg
Copy link
Member

@ioannisg ioannisg commented Feb 2, 2021

When VTOR is implemented on the Cortex-M SoC, we can
basically use any address (properly aligned) for the
vector table starting address. We fix the setting of
VTOR in prep_c.c for non-XIP images, in this commit,
so we do not need to always have the vector table be
present at the start of RAM (CONFIG_SRAM_BASE_ADDRESS)
and allow for extra linker sections being placed before
the vector table section.

Signed-off-by: Ioannis Glaropoulos [email protected]

Fixes #31235 (@GrixaYrev pls, confirm)

When VTOR is implemented on the Cortex-M SoC, we can
basically use any address (properly aligned) for the
vector table starting address. We fix the setting of
VTOR in prep_c.c for non-XIP images, in this commit,
so we do not need to always have the vector table be
present at the start of RAM (CONFIG_SRAM_BASE_ADDRESS)
and allow for extra linker sections being placed before
the vector table section.

Signed-off-by: Ioannis Glaropoulos <[email protected]>
@ioannisg ioannisg requested a review from e-rk February 2, 2021 12:49
@github-actions github-actions bot added the area: ARM ARM (32-bit) Architecture label Feb 2, 2021
@ioannisg ioannisg requested a review from nashif February 2, 2021 12:51
@ioannisg ioannisg self-assigned this Feb 2, 2021
@ioannisg ioannisg added this to the v2.5.0 milestone Feb 2, 2021
@ioannisg ioannisg marked this pull request as ready for review February 2, 2021 14:03
@ioannisg ioannisg requested a review from carlescufi February 2, 2021 14:03
@ioannisg ioannisg added the bug The issue is a bug, or the PR is fixing a bug label Feb 2, 2021
@erwango erwango requested review from ABOSTM and removed request for ABOSTM February 2, 2021 14:11
@nashif nashif merged commit ef926e7 into zephyrproject-rtos:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cortex-M: vector table relocation is incorrect with XIP=n
3 participants