svd-vector-gen

Crates.iosvd-vector-gen
lib.rssvd-vector-gen
version0.1.5
created_at2024-12-19 07:49:03.042343+00
updated_at2024-12-23 14:21:06.440398+00
descriptionA tool to process Microcontroller SVD files(e.g. STM32) and generate vector tables and linker scripts.
homepage
repositoryhttps://github.com/niekiran/svd-vector-gen.git
max_upload_size
id1488882
size3,653,553
Kiran Nayak (niekiran)

documentation

README

SVD Vector and Linker Script Generator

This tool scans the current directory for ARM Cortex-M compatible SVD files and automatically generates:

  1. 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 with Option<unsafe fn()> entries for each vector, including system handlers and IRQs.
  2. Device-Specific Linker Script (device_<mcu>.x):

    • Defines PROVIDE entries for all interrupts as:
      PROVIDE(<IRQ_NAME> = default_handler);
      
      This facilitates linking during firmware development.

Usage

  1. Install the tool using Cargo:
    cargo install svd-vector-gen
    
    
    
    
    1. 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:

  1. 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);
      ...
      
Commit count: 0

cargo fmt