5 releases
new 0.1.4 | Dec 21, 2024 |
---|---|
0.1.3 | Dec 19, 2024 |
0.1.2 | Dec 19, 2024 |
0.1.1 | Dec 19, 2024 |
0.1.0 | Dec 19, 2024 |
#92 in Embedded development
234 downloads per month
180KB
341 lines
SVD Vector and Linker Script Generator
This tool scans the current directory for ARM Cortex-M compatible SVD files and automatically generates:
-
Vector Table File (
vector_<mcu>.txt
):- Contains the vector table for the specified microcontroller with system exceptions and interrupt handlers.
- Format: A
static VECTOR_TABLE
Rust array withOption<unsafe fn()>
entries for each vector, including system handlers and IRQs.
-
Device-Specific Linker Script (
device_<mcu>.x
):- Defines
PROVIDE
entries for all interrupts as:
This facilitates linking during firmware development.PROVIDE(<IRQ_NAME> = default_handler);
- Defines
Usage
-
Install the tool using Cargo:
cargo install svd-vector-gen
-
Run the tool:
- Ensure that the directory contains valid SVD files.
- For STM32 microcontrollers, you can obtain SVD files by installing STM32CubeCLT.
svd-vector-gen
Example
For STM32F303X.svd
:
- Generated Files:
vector_STM32F303X.txt
: Contains the vector table.device_STM32F303X.x
: Contains the linker script:PROVIDE(WWDG = default_handler); PROVIDE(PVD = default_handler); PROVIDE(TAMPER = default_handler); ...
Dependencies
~3–4.5MB
~83K SLoC