rust-embedded / rust-embedded/svd2rust

error: Cluster USART has no determinable `size` field

Open
#191 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
857
Forks
164
PR merge metrics
No merged PRs in 30d

Description

I get this error with ATSAMD21G18A.svd

I'm not opposed to rolling up my sleeves to help fix this if someone with context can tell me roughly what needs to happen. I'm a fast learner!

I see this with 631ab3e5ffaec4bb276d930b265a2a8178e7d82f

error: Cluster USART has no determinable `size` field
caused by: Warning! overlap while calculating Register Size within a Cluster! Cluster contents may be incorrectly aligned!
backtrace: stack backtrace:
   0:     0x55bb5fecc8d4 - backtrace::backtrace::libunwind::trace::hbf9f65f12207138f
                        at /home/wez/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.5/src/backtrace/libunwind.rs:53
                         - backtrace::backtrace::trace::hd67ff4d2334f7ed6
                        at /home/wez/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.5/src/backtrace/mod.rs:42
   1:     0x55bb5feca63c - backtrace::capture::Backtrace::new_unresolved::h642c5b6c9400d9d5
                        at /home/wez/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.5/src/capture.rs:88
   2:     0x55bb5feca58e - backtrace::capture::Backtrace::new::h6b30f701e69e550b
                        at /home/wez/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.5/src/capture.rs:63
   3:     0x55bb5fec76b6 - error_chain::make_backtrace::hc918c7599bfaea64
                        at /home/wez/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.11.0/src/lib.rs:616
   4:     0x55bb5fec772f - <error_chain::State as core::default::Default>::default::h548074ab69a8084d
                        at /home/wez/.cargo/registry/src/github.com-1ecc6299db9ec823/error-chain-0.11.0/src/lib.rs:710
   5:     0x55bb5fde81bd - svd2rust::errors::Error::from_kind::hd36a5afffca28cb6
                        at /home/wez/github/svd2rust/<impl_error_chain_processed macros>:53
   6:     0x55bb5fde83b9 - <svd2rust::errors::Error as core::convert::From<alloc::string::String>>::from::hd00d5407c74d1305
                        at src/errors.rs:1
   7:     0x55bb5fd7ef70 - svd2rust::generate::peripheral::cluster_size_in_bits::ha74a72683196d068
                        at src/generate/peripheral.rs:210
   8:     0x55bb5fe1a6ca - svd2rust::generate::peripheral::expand_cluster::{{closure}}::hbe5bc632c7386e96
                        at src/generate/peripheral.rs:246
   9:     0x55bb5fd875dc - <core::result::Result<T, E>>::or_else::he8ffab4c771caf21
                        at /checkout/src/libcore/result.rs:691
  10:     0x55bb5fd7f86d - svd2rust::generate::peripheral::expand_cluster::h447512a0d57fb8aa
                        at src/generate/peripheral.rs:243
  11:     0x55bb5fd7e89f - svd2rust::generate::peripheral::expand::h8fc1592519c5606e
                        at src/generate/peripheral.rs:191
  12:     0x55bb5fd7d6c8 - svd2rust::generate::peripheral::register_or_cluster_block::h682fffe6a6a9ec45
                        at src/generate/peripheral.rs:125
  13:     0x55bb5fd7c792 - svd2rust::generate::peripheral::render::h008b4049f11701b1
                        at src/generate/peripheral.rs:78
  14:     0x55bb5fde0b5f - svd2rust::generate::device::render::h25c68a216b631a00
                        at src/generate/device.rs:128
  15:     0x55bb5fe25453 - svd2rust::run::hb3070a0e4fb05ceb
                        at src/main.rs:84
  16:     0x55bb5fe25b86 - svd2rust::main::h76b2401efe189507
                        at src/main.rs:99
  17:     0x55bb5fde9031 - std::rt::lang_start::{{closure}}::hf182223c25a0e056
                        at /checkout/src/libstd/rt.rs:74
  18:     0x55bb60082ee7 - std::rt::lang_start_internal::{{closure}}::h6683f918b5e41df1
                        at libstd/rt.rs:59
                         - std::panicking::try::do_call::h9980f1b0ce760291
                        at libstd/panicking.rs:306
  19:     0x55bb6008ca8e - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:102
  20:     0x55bb60083683 - std::panicking::try::h2b055bf317f9a3ac
                        at libstd/panicking.rs:285
                         - std::panic::catch_unwind::h8402e9b2ba9c09e5
                        at libstd/panic.rs:361
                         - std::rt::lang_start_internal::h591dc8f1c9bda6fc
                        at libstd/rt.rs:58
  21:     0x55bb5fde9011 - std::rt::lang_start::hcbc8bede4be6939e
                        at /checkout/src/libstd/rt.rs:74
  22:     0x55bb5fe2613d - main
  23:     0x7f4a2898a1c0 - __libc_start_main
  24:     0x55bb5fd7b4a9 - _start
  25:                0x0 - <unknown>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with data/Atmel/ATSAMD21G18A.svd and inspect src/generate/peripheral.rs, especially cluster_size_in_bits and expand_cluster, which appear in the backtrace. Trace how the USART cluster size is calculated and confirm that generation completes with a correctly sized cluster instead of the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.