svd2rust icon indicating copy to clipboard operation
svd2rust copied to clipboard

ATSAML21E18B fails to generate

Open nigelb opened this issue 8 years ago • 5 comments

When I try to compile the code generated from this SVD file: ATSAML21E18B.zip

With this procedure:

  1. cargo init --lib
  2. cargo add bare-metal vcell cortex-m
  3. echo "max_width = 10000" >> rustfmt.toml to prevent the line length errors
  4. svd2rust -i ATSAML21E18B.svd | rustfmt | tee src/lib.rs
  5. cargo build

I get the following errors:

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66240:21
      |
66240 |     register_block: sercom0::RegisterBlock,
      |                     ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66243:19
      |
66243 |     type Target = sercom0::RegisterBlock;
      |                   ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66244:25
      |
66244 |     fn deref(&self) -> &sercom0::RegisterBlock {
      |                         ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66252:21
      |
66252 |     register_block: sercom0::RegisterBlock,
      |                     ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66255:19
      |
66255 |     type Target = sercom0::RegisterBlock;
      |                   ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66256:25
      |
66256 |     fn deref(&self) -> &sercom0::RegisterBlock {
      |                         ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66264:21
      |
66264 |     register_block: sercom0::RegisterBlock,
      |                     ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66267:19
      |
66267 |     type Target = sercom0::RegisterBlock;
      |                   ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66268:25
      |
66268 |     fn deref(&self) -> &sercom0::RegisterBlock {
      |                         ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66276:21
      |
66276 |     register_block: sercom0::RegisterBlock,
      |                     ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66279:19
      |
66279 |     type Target = sercom0::RegisterBlock;
      |                   ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66280:25
      |
66280 |     fn deref(&self) -> &sercom0::RegisterBlock {
      |                         ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66288:21
      |
66288 |     register_block: sercom0::RegisterBlock,
      |                     ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66291:19
      |
66291 |     type Target = sercom0::RegisterBlock;
      |                   ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `sercom0`
     --> src/lib.rs:66292:25
      |
66292 |     fn deref(&self) -> &sercom0::RegisterBlock {
      |                         ^^^^^^^ Use of undeclared type or module `sercom0`

error[E0433]: failed to resolve. Use of undeclared type or module `tc0`
     --> src/lib.rs:79227:21
      |
79227 |     register_block: tc0::RegisterBlock,
      |                     ^^^ Use of undeclared type or module `tc0`

error[E0433]: failed to resolve. Use of undeclared type or module `tc0`
     --> src/lib.rs:79230:19
      |
79230 |     type Target = tc0::RegisterBlock;
      |                   ^^^ Use of undeclared type or module `tc0`

error[E0433]: failed to resolve. Use of undeclared type or module `tc0`
     --> src/lib.rs:79231:25
      |
79231 |     fn deref(&self) -> &tc0::RegisterBlock {
      |                         ^^^ Use of undeclared type or module `tc0`

error[E0433]: failed to resolve. Use of undeclared type or module `tc0`
     --> src/lib.rs:79239:21
      |
79239 |     register_block: tc0::RegisterBlock,
      |                     ^^^ Use of undeclared type or module `tc0`

error[E0433]: failed to resolve. Use of undeclared type or module `tc0`
     --> src/lib.rs:79242:19
      |
79242 |     type Target = tc0::RegisterBlock;
      |                   ^^^ Use of undeclared type or module `tc0`

error[E0433]: failed to resolve. Use of undeclared type or module `tc0`
     --> src/lib.rs:79243:25
      |
79243 |     fn deref(&self) -> &tc0::RegisterBlock {
      |                         ^^^ Use of undeclared type or module `tc0`

error: aborting due to 21 previous errors

I have tested the same procedure with this SVD file without issue.

nigelb avatar Oct 21 '17 04:10 nigelb

That sounds like #107: missing <cluster> support.

japaric avatar Oct 24 '17 14:10 japaric

Yep, sure does.

nigelb avatar Nov 17 '17 02:11 nigelb

@nigelb Could you please try this with the current master? Cluster support was added, but I know some ATSAMD chips still have issued due to other problems.

If so, lets figure out which other reported issues are blocking you.

jamesmunns avatar Mar 13 '18 11:03 jamesmunns

Hi @jamesmunns I have the same issue as #191 :

$ svd2rust.exe -V
svd2rust 0.12.0 (631ab3e 2018-03-09)

$ svd2rust -i ATSAML21E18B.svd
WARNING Some(Ident("mode1")) overlaps with another register block at offset 0. Ignoring.
WARNING Some(Ident("mode2")) overlaps with another register block at offset 0. Ignoring.
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!
note: run with `RUST_BACKTRACE=1` for a backtrace

Thanks,

Nigel

nigelb avatar Mar 15 '18 00:03 nigelb

Thanks for confirming @nigelb, I'd say follow that issue as @wez is working on a fix for it. We can keep this open to track your specific chip. I will update the title to represent this

jamesmunns avatar Mar 15 '18 10:03 jamesmunns

should be fixed

burrbull avatar Nov 07 '22 06:11 burrbull