Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to update to more recent nightly compiler #4

Merged
merged 1 commit into from
Aug 26, 2018
Merged

Attempt to update to more recent nightly compiler #4

merged 1 commit into from
Aug 26, 2018

Conversation

wez
Copy link
Member

@wez wez commented Aug 23, 2018

It's been a little while since I had time to hack on this, and I wanted to address the issue behind #3 by making things build on the current versions of the tools.

I wasn't entirely successful but I think we're close. I'm hoping that someone else has the flash of inspiration needed to carry this across the line.

This commit:

  • Updates svd2rust (https://github.com/wez/svd2rust/tree/register-derived-from) to match the current version + required changes for atsamd21
  • Regenerated the device crates with the updated svd2rust
  • Updates .cargo/config, build.rs and device.x to match the new exception/startup/init bits
  • Updates various lower level crates

Things almost build; the libraries compile but the examples fail to link:

  = note: "arm-none-eabi-gcc" "-L" "/home/wez/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd093
3a97a14b0.16ire8de9f8n1zsq.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.18obj37gxptf0p0u.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-non
e-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.1glyybb4n745tmw.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.1gsfxdp4ulxobfsj.rcgu.o" "/home/wez/wez-personal
/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.1pz8ynyrnvm2kwy0.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.2layzf
96om3xnqaw.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.2nspvkz9ug307bi6.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/exa
mples/blinky_basic-3bdd0933a97a14b0.2nt9hgkrdd040nd2.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.3k5rj7cnmseb4gcg.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/me
tro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.3nd0pli2tmy82pco.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.4ek1eu4esc1md4wh.rcgu
.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.5cwxogg8eprclfe0.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_ba
sic-3bdd0933a97a14b0.bgx55tl5f33kf7y.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.sa9wicz8pmr8a4s.rcgu.o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thu
mbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0.tdbuesx1rt8zrvl.rcgu.o" "-o" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/examples/blinky_basic-3bdd0933a97a14b0" "-Wl,--gc-sections" "-nodefaultli
bs" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/debug/deps" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/deb
ug/build/metro_m0-d9b0248ef2ef1568/out" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/build/atsamd21g18a-41ab7dc7fc6bdf48/out" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/d
ebug/build/cortex-m-7616b05f3f9182a1/out" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/build/cortex-m-rt-f11943fdffbedad0/out" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/
debug/build/cortex-m-rt-f11943fdffbedad0/out" "-L" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/build/cortex-m-semihosting-8b401d2010c85121/out" "-L" "/home/wez/.rustup/toolchains/nightly-x86_64-unknown-linux
-gnu/lib/rustlib/thumbv6m-none-eabi/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libpanic_abort-2f7166bc8653d66d.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0
/target/thumbv6m-none-eabi/debug/deps/libmetro_m0-8d51014de5bc1da5.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libatsamd21_hal-e524121e63ddef2f.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/t
arget/thumbv6m-none-eabi/debug/deps/libembedded_hal-644d8d0de41a21ab.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libvoid-0a89b73321a8a234.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/
thumbv6m-none-eabi/debug/deps/libnb-531ac527aec258c8.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libatsamd21g18a-3dd3660a871b9936.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m
-none-eabi/debug/deps/libcortex_m_rt-66ceb81eed0ea8d8.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libr0-59573e3aa08e58be.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eab
i/debug/deps/libcortex_m_semihosting-4b634a30dd3fedc0.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libcortex_m-7cfc4ed18d60ac4f.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-no
ne-eabi/debug/deps/libvolatile_register-e0794d621b58c095.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libvcell-19e8eece528f8de5.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-no
ne-eabi/debug/deps/libbare_metal-e4d427aefa8ae8ee.rlib" "/home/wez/wez-personal/atsamd21-rs/metro_m0/target/thumbv6m-none-eabi/debug/deps/libaligned-d239240350012e03.rlib" "/home/wez/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/r
ustlib/thumbv6m-none-eabi/lib/libcore-59aaa68b41c4baf4.rlib" "-Wl,--end-group" "/home/wez/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv6m-none-eabi/lib/libcompiler_builtins-dfdcd6835a33025e.rlib" "-Wl,-Tlink.x" "-no
startfiles" "-Wl,-Bdynamic"
  = note: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld:
          BUG(cortex-m-rt): the reset vector is missing
          /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld:
          BUG(cortex-m-rt): the exception vectors are missing
          collect2: error: ld returned 1 exit status

AFAICT, Reset is the symbol that it wants and this should be provided by cortex-m-rt when built in rt mode.

I'm probably missing something subtle and simple; help wanted! :-)

@wez wez force-pushed the update branch 4 times, most recently from 28e0cd6 to e1bd18d Compare August 26, 2018 05:58
I was seeing rust-embedded/cortex-m-rt#92 here
too, so needed to upgrade gcc both on my local system and in the CI
config.

rtfm's `app!` macro doesn't know how to emit an appropriate `entry!`
call, so the rtfm based examples now have a little bit of glue for
that.
@wez
Copy link
Member Author

wez commented Aug 26, 2018

Heads up to @zklapow and @djmcgill: there are some some changes to the rt/startup plumbing with this upgrade. I've applied those to samd21_mini which is already in this fork, but @djmcgill will want to look closely at the Cargo.toml when he rebases arduino_mkrzero next!

@wez wez merged commit ecfec05 into master Aug 26, 2018
@wez wez deleted the update branch August 26, 2018 06:14
@zklapow
Copy link
Contributor

zklapow commented Aug 28, 2018

@wez did you get the linker issues sorted out? I have also been working on moving to a newer nighlty (although I didn't go quite as far as updating svd2rust) and I have a working crate that compiles. IIRC the issues I was having mainly stemmed from using cortex-m-rtfm which is still way out of date, but I was able to get things to compile by using a custom version with some updated deps (although my interrupts dont work now so ¯_(ツ)_/¯).

I'll try things out with this version instead of my hack.

@djmcgill
Copy link
Contributor

djmcgill commented Aug 28, 2018 via email

@wez
Copy link
Member Author

wez commented Aug 28, 2018

Yep, this took care of getting us back on nightly and even got rtfm working there too. If you have linker issues locally it indicates that you'll need to upgrade your gcc arm tool chain; there is information on that in the readme.

kaizensparc pushed a commit to kaizensparc/atsamd that referenced this pull request Dec 24, 2021
I was seeing rust-embedded/cortex-m-rt#92 here
too, so needed to upgrade gcc both on my local system and in the CI
config.

rtfm's `app!` macro doesn't know how to emit an appropriate `entry!`
call, so the rtfm based examples now have a little bit of glue for
that.
TDHolmes added a commit that referenced this pull request Mar 28, 2022
* Cleanup clippy lints

* Changelog

* rustfmt

* Don't allow missing_safety_docs, revert From/Into GClock-Hertz impls

* Docs: NVM, PUKCC (#4)

Co-authored-by: Henrik Tjäder <henrik.tjader@volvocars.com>

* rustfmt

* Allow double underscores in entire pukcc module

* Fix rust_2018_idioms lints

* Fix clippy lints in T1 examples

Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Co-authored-by: Henrik Tjäder <henrik.tjader@volvocars.com>
Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
rtsuk pushed a commit to rtsuk/atsamd that referenced this pull request Mar 29, 2022
* Cleanup clippy lints

* Changelog

* rustfmt

* Don't allow missing_safety_docs, revert From/Into GClock-Hertz impls

* Docs: NVM, PUKCC (atsamd-rs#4)

Co-authored-by: Henrik Tjäder <henrik.tjader@volvocars.com>

* rustfmt

* Allow double underscores in entire pukcc module

* Fix rust_2018_idioms lints

* Fix clippy lints in T1 examples

Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Co-authored-by: Henrik Tjäder <henrik.tjader@volvocars.com>
Co-authored-by: Tyler Holmes <tyler@holmesengineering.com>
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.

3 participants