This repository contains SVD files for most STM32 chips, generated from the stm32-rs, part of the Rust Embedded community. These files are originally from STMicroelectronics but have many patches to fix bugs and fill in gaps in the original SVD files.
These files are not intended to be modified. Instead, they are intended to be used as any SVD file, for example to generate access to registers for various languages.
SVD tooling is required. You will need to do something like this:
- svdtools: Install with
cargo install svdtools --version 0.5.0 - Git with submodule support
The svdtools command must be available in your PATH, which can be done by
sourcing $HOME/.cargo/env from a location like .bashrc.
Please do not contribute changes directly to the SVD files in this repository. Instead, contribute patches upstream in the stm32-rs repository.
From time to time this repository will need to be updated, to incorporate changes from upstream. You can do so as follows:
-
Make sure the stm32-rs submodule is pulled, using
git submodule update --init. -
Download the latest patches by going to the stm32-rs subdirectory and running
git pull. -
Check if modifications get applied to
.yamlfiles in stm32-rs cleanly:go run patch.go: This mainly preserves 32-bit access for specific registers where stm32-rs has narrowed the access to 16 bit (or where 32-bit access needs to be explicitly enforced for consistency).git -C stm32-rs diff: Check the output to ensure the modifications look plausible.
-
Run
make.
Please ensure that the stm32 targets supported by TinyGo can still be built:
- Regenerate device files from the update SVD files:
make gen-device-stm32 - Build src/examples/blinky for all stm32 targets
- Try to resolve possible issues by adjusting
patch.goorsrc/machine_stm32*
The SVD files in this repository have two sources: the original ST SVD files and the stm32-rs patch files.
- The original ST SVD files are licensed under a license from ST, see
ST_SLA.pdffor details. - The patch files are dual licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
See stm32-rs#License for details.