-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a4d3d5
commit ec0c134
Showing
3 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/modm/platform/core/stm32/option/vector_table_location.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Vector table location in ROM or RAM on F0 devices | ||
|
||
STM32 devices with a Cortex-M0 core provide a platform-specific method to place | ||
the interrupt vector table in SRAM although the core does not support vector | ||
table relocation. It is only available on STM32F0 since all other devices | ||
can remap the vector table in the Cortex-M core. | ||
|
||
When this method is activated the vector table is copied to the start of SRAM1 | ||
by the startup script. The `SYSCFG->CFGR1` register is set to remap the | ||
beginning of SRAM to the vector table location at `0x0000 0000`. | ||
|
||
You can modify the RAM vector table using the CMSIS NVIC functions: | ||
|
||
- `void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)` | ||
- `uint32_t NVIC_GetVector(IRQn_Type IRQn)` | ||
|
||
This remapping method allows to easily boot an application from a custom | ||
bootloader even if the Cortex-M0 core does not support relocation. | ||
|
||
For applications that do not modify the vector table at runtime, relocation to | ||
RAM is not necessary and can save a few hundred bytes of static memory. | ||
|
||
!!! warning "On Interrupt Latency" | ||
Placing main stack and vector table into the same memory can significantly | ||
slow down interrupt latency, since both I-Code and D-Code memory interface | ||
need to fetch from the same access port. |