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

Support vector table in RAM for most CM0(+) devices #773

Merged

Conversation

chris-durand
Copy link
Member

@chris-durand chris-durand commented Oct 30, 2021

For executing an application from a custom bootloader the vector table has to be relocated. On all Cortex-M cores except M0 the vector table relocation register can be set to the application's vector table location. Cortex M0 cores don't have this feature.

On some Cortex-M0 devices there is a platform specific method to relocate the vector table by placing it in RAM. They allow to remap the start of ram to the address 0x0 where the vector table is located. Thus, vector table relocation is achieved on an M0 core.

All M0+ devices I could find provide the SCB->VTOR register as an optional core feature.

  • Enable vector table relocation by SCB->VTOR on M0+ cores
  • Platform specific vector table remap for STM32F0
  • Add and test examples for Nucleo F042K6 (CM0) and Nucleo L031K6 (CM0+)
  • Update documentation

@chris-durand chris-durand force-pushed the feature/cm0_vector_table_remap branch from 12cd0cd to abf1377 Compare October 31, 2021 01:27
@chris-durand
Copy link
Member Author

@salkinium I was able to move all platform specific things to the :platform:core module. Are you fine with it now? I'll will have to add some documentation.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, very good!

@chris-durand chris-durand force-pushed the feature/cm0_vector_table_remap branch from abf1377 to 6b97884 Compare October 31, 2021 02:19
@chris-durand chris-durand force-pushed the feature/cm0_vector_table_remap branch from 6b97884 to ec0c134 Compare November 18, 2021 13:54
@chris-durand
Copy link
Member Author

I have added the missing documentation.

src/modm/platform/core/stm32/module.md Outdated Show resolved Hide resolved
src/modm/platform/core/stm32/module.md Outdated Show resolved Hide resolved
@chris-durand chris-durand force-pushed the feature/cm0_vector_table_remap branch from ec0c134 to d98f779 Compare November 18, 2021 14:14
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@chris-durand chris-durand force-pushed the feature/cm0_vector_table_remap branch from d98f779 to fdbb45b Compare November 18, 2021 14:20
@salkinium salkinium added the ci:hal Triggers the exhaustive HAL compile CI jobs label Nov 18, 2021
@salkinium salkinium merged commit fdbb45b into modm-io:develop Nov 18, 2021
@salkinium salkinium added this to the 2021q4 milestone Dec 18, 2021
@chris-durand chris-durand deleted the feature/cm0_vector_table_remap branch January 2, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced 🤯 ci:hal Triggers the exhaustive HAL compile CI jobs feature 🚧
Development

Successfully merging this pull request may close these issues.

2 participants