Closed leshow closed 5 years ago
Hi, thanks for reporting this bug!
The specific problem is that while the stm32f3 crate does provide the required interrupt vectors, cargo build
just builds src/main.rs
, which does not include stm32f3 (no use
or extern crate
line), and as such the stm32f3 crate isn't linked in, so the interrupt vectors don't make it either.
The documentation suggests actually building the device
example with this feature, which should work, but hasn't actually been updated when the .cargo/config
was, so tries to pull in a different device crate.
If you modify examples/device.rs
as follows:
-use stm32f30x::{interrupt, Interrupt, NVIC};
+use stm32f3::stm32f303::{interrupt, Interrupt, NVIC};
then you should be able to run cargo build --example device
without errors.
Obviously this is still a bug, so I'll get it fixed ASAP, thanks again for reporting!
I can submit a PR with that change if you like
Thanks for offering! I have just opened #74 to fix it though.
I figure I'll ask while you're here, but trying to build anything else except device while the dependency is there will fail in a similar linker error. Is there any way to fix that? Or is the answer to use something like the above import in that situation also.
edit: sorry I re-read your original post and I think this is exactly what you're saying lol
You might want to check out https://github.com/adamgreig/stm32f4-demo which is my barebones example of an embedded stm32 application.
thanks!
setting the runner to:
and un-commenting:
is all that's required to generate a build error (in debug or release):
If I follow the advice in
config
and also uncomment:"-C", "linker=arm-none-eabi-ld"
I get an error with that linker: