- generate PAC with svd2Rust
- svd2rust -i xxx.svd
- rustfmt lib.rs
- cargo init --lib
- cargo check --target thumbv7em-none-eabihf
- got some errors with duplicate
FM_CTL
, renamed one of them toFM_CTL_REG
which resolved the issue. - run svd2rust again to generate new lib.rs
- explode the lib.rs file with form
cargo install form
form -i lib.rs -o ./src/
cargo fmt