ATSAML21E18B fails to generate
When I try to compile the code generated from this SVD file: ATSAML21E18B.zip
With this procedure:
-
cargo init --lib -
cargo add bare-metal vcell cortex-m -
echo "max_width = 10000" >> rustfmt.tomlto prevent the line length errors -
svd2rust -i ATSAML21E18B.svd | rustfmt | tee src/lib.rs -
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.
That sounds like #107: missing <cluster> support.
Yep, sure does.
@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.
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
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
should be fixed