Skip to content

add cortex-m-types interrupt number trait generation#144

Open
robamu wants to merge 1 commit intoembassy-rs:mainfrom
robamu:add-cortex-m-types-interrupt-num-gen
Open

add cortex-m-types interrupt number trait generation#144
robamu wants to merge 1 commit intoembassy-rs:mainfrom
robamu:add-cortex-m-types-interrupt-num-gen

Conversation

@robamu
Copy link
Copy Markdown

@robamu robamu commented May 3, 2026

Generated crates need the cortex-m-types dependency. I tried to test this with https://github.com/embassy-rs/nrf-pac but I was not able to fully generate the crate with update.sh with a path installed chiptool , which failed with this error:

[2026-05-03T21:33:43Z INFO  chiptool::commands] running RenameFields(RenameFields { fieldset: RegexSet { include: [Regex("^.*::regs::Shorts.*$")], exclude: [] }, from: RegexSet { include: [Regex("^loopsdone_seqstart0$")], exclude: [] }, to: "loopsdone_dma_seq0_start", error_on_duplicate: true })
+ rustfmt lib.rs
+ sed -i '/#!\[no_std]/d' lib.rs
+ mkdir -p src/chips/nrf52811
+ mv lib.rs src/chips/nrf52811/pac.rs
+ mv device.x src/chips/nrf52811/device.x
+ for chip in $(ls svd)
+ chip=nrf52820
+ [[ nrf52820 == *nrf54* ]]
+ ../chiptool/target/release/chiptool generate --svd svd/nrf52820.svd --transform transform-compat.yaml
Error: converting svd at svd/nrf52820.svd

Caused by:
    Failed to find unique name for ["ACL"]. n: ["ACL"]

Stack backtrace:
   0: chiptool::svd2ir::unique_names
   1: chiptool::svd2ir::convert_peripheral
   2: chiptool::svd2ir::convert_svd
   3: chiptool::commands::generate::generate
   4: chiptool::main
   5: std::sys::backtrace::__rust_begin_short_backtrace
   6: std::rt::lang_start::{{closure}}
   7: std::rt::lang_start_internal
   8: main
   9: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  10: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:360:3
  11: _start

I was able to inspect some of the generates source files, which looked fine though. The implementation is based on the one added in rust-embedded/svd2rust#959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant