#svd #avr #micro-controller #svd2rust #atdf

bin+lib atdf2svd

Tool to convert Atmel's ATDF files to SVD

10 unstable releases (4 breaking)

0.5.0 Nov 4, 2024
0.4.0 May 4, 2024
0.3.3 Oct 23, 2022
0.3.1 Aug 1, 2021
0.1.2 Mar 18, 2020

#363 in Embedded development

Download history 11/week @ 2024-09-21 4/week @ 2024-09-28 6/week @ 2024-10-05 6/week @ 2024-10-12 1/week @ 2024-10-19 138/week @ 2024-11-02 15/week @ 2024-11-09 4/week @ 2024-11-16

157 downloads per month

GPL-3.0-only

46KB
1K SLoC

atdf2svd crates.io page CI

A converter tool that converts Atmel's atdf files into svd. The primary usecase for this is to then use the svd files with svd2rust to create safe abstractions for register access.

Usage

USAGE:
    atdf2svd <atdf_path> [svd_path]

Installation

Install atdf2svd using

$ cargo install -f atdf2svd

Notes

Automatic Changes

There are two "post-processors" running after the conversion (patch.rs):

  • signals_to_port_fields: Patches the registers for all PORTx peripherals to contain fields for each existing pin. Pin IDs are taken from the <signals /> tag of the port instance.
  • remove_unsafe_cpu_regs: Removes the SREG(Status Register) and SP(Stack Pointer) registers as they should not be safely accessible.

Manual Changes

Unfortunately, the provided atdf files are often not completely correct or contain undescriptive names. One big issue is that enumerated values are often just named VAL_0xXX. I recommend patching the generated svd files using the patch tool written by the stm32-rs project.

License

atdf2svd is licensed under the GPL v3 license. See LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html for more info.

Dependencies

~4–15MB
~149K SLoC