Coder Social home page Coder Social logo

blink's People

Contributors

chinoto avatar dylanmckay avatar enjoythelive1 avatar fabientregan avatar jhg avatar johndoneth avatar jwillikers avatar mb64 avatar pusherofbrooms avatar returnofthelambda avatar rockboynton avatar shepmaster avatar stappersg avatar tspmp avatar vringar avatar wez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blink's Issues

Build resolves incorrect version of ruduino when cargo.lock cleaned

The cargo.toml file references ruduino = "0.2", however if the cargo.lock file is removed (explicitly targeting 0.2.0) this will pull the latest (currently 0.2.7), which breaks the build. It could be fixed by changing the toml to specifically target 0.2.0, but it'll probably be more useful to update the code to use the newest version.

could not load config key `env.AVR_CPU_FREQUENCY_HZ`

Since #40

stappers@myhost:~/src/rust/RustAVR/blink
$ cargo version
cargo 1.63.0-nightly (38472bc19 2022-05-31)
stappers@myhost:~/src/rust/RustAVR/blink
$ cargo build
error: error in /home/stappers/src/rust/RustAVR/blink/.cargo/config.toml: could not load config key `env.AVR_CPU_FREQUENCY_HZ`

Caused by:
  data did not match any variant of untagged enum EnvConfigValueInner
stappers@myhost:~/src/rust/RustAVR/blink
$ 

Can't compile blink example

Just compiled the avr-rust toolchain (2hr process!). Linked avr-rust and set as default toolchain using rustup.

When trying to build the blink example I get the following output:

$ XARGO_RUST_SRC=~/code/avr-rust/src/  xargo build --target avr-atmega328p --verbose
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "cargo" "build" "--target" "avr-atmega328p" "--verbose"
   Compiling arduino v0.1.0
     Running `rustc --crate-name arduino /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arduino-0.1.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=4e899856c1d3bf9a -C extra-filename=-4e899856c1d3bf9a --out-dir /home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps --target avr-atmega328p -L dependency=/home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps -L dependency=/home/piggy/code/avr-rust-blink/target/debug/deps --cap-lints allow --sysroot /root/.xargo`
   Compiling blink v0.1.0 (file:///home/piggy/code/avr-rust-blink)
     Running `rustc --crate-name blink src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=ef6a619ddb2bb88f -C extra-filename=-ef6a619ddb2bb88f --out-dir /home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps --target avr-atmega328p -L dependency=/home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps -L dependency=/home/piggy/code/avr-rust-blink/target/debug/deps --extern arduino=/home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps/libarduino-4e899856c1d3bf9a.rlib --sysroot /root/.xargo`
rustc: /home/piggy/code/avr-rust/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8141: void llvm::SelectionDAGISel::LowerArguments(const llvm::Function&): Assertion `InVals.size() == Ins.size() && "LowerFormalArguments didn't emit the correct number of values!"' failed.
error: Could not compile `blink`.

Caused by:
  process didn't exit successfully: `rustc --crate-name blink src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=ef6a619ddb2bb88f -C extra-filename=-ef6a619ddb2bb88f --out-dir /home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps --target avr-atmega328p -L dependency=/home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps -L dependency=/home/piggy/code/avr-rust-blink/target/debug/deps --extern arduino=/home/piggy/code/avr-rust-blink/target/avr-atmega328p/debug/deps/libarduino-4e899856c1d3bf9a.rlib --sysroot /root/.xargo` (exit code: 1)

Any ideas?

SIGSEGV when compiling on latest nightly

This issue has reported upstream at rust-lang/rust#76930. Following the AVR Rust book, the program cannot compile due to a segmentation fault when compiling the core crate on the latest nightly build.

~/code/blink ><> cargo build -Z build-std=core --target avr-atmega328p.json --release
   Compiling core v0.0.0 (/home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling rustc-std-workspace-core v1.99.0 (/home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling compiler_builtins v0.1.35
   Compiling ruduino v0.2.0
error: could not compile `core`

Caused by:
  process didn't exit successfully: `rustc --crate-name core --edition=2018 /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=775b9b151bd266b1 -C extra-filename=-775b9b151bd266b1 --out-dir /home/bacongobbler/code/blink/target/avr-atmega328p/release/deps --target /home/bacongobbler/code/blink/avr-atmega328p.json -Z force-unstable-if-unmarked -L dependency=/home/bacongobbler/code/blink/target/avr-atmega328p/release/deps -L dependency=/home/bacongobbler/code/blink/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed

Using the debug target also fails with more information:

~/code/blink ><> cargo build -Z build-std=core --target avr-atmega328p.json
   Compiling blink v0.1.0 (/home/bacongobbler/code/blink)
error: linking with `avr-gcc` failed: exit code: 1
  |
  = note: "avr-gcc" "-mmcu=atmega328p" "-L" "/home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.14gicplk3a8rd2mf.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.14qeofa20egw9nwf.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.1wmmysfy11urhzf0.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.24kbbo2eafqv76ap.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.2mrol613m7r8fe4h.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.2ygh13f44y84rejg.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.3gpysx65vrtx1mw3.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.3hgcd7rk5gitckx.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.4fk979zh9rz3tdvf.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.4xxrwed9dq0c99sc.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.5c9h7xhuo2dh8daz.rcgu.o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.fooo9so7gsdl2oq.rcgu.o" "-o" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.elf" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps" "-L" "/home/bacongobbler/code/blink/target/debug/deps" "-L" "/home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libruduino-320958a79d2f2860.rlib" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/librustc_std_workspace_core-29c9d0aa85cbe977.rlib" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcore-69e33a9af4453194.rlib" "-Wl,--end-group" "/home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcompiler_builtins-f1cb32ff07da7789.rlib" "-Wl,-Bdynamic" "-lgcc"
  = note: /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.3gpysx65vrtx1mw3.rcgu.o: In function `core::intrinsics::is_nonoverlapping::h95d5cae38d8a279d':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1754: undefined reference to `abort'
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1754: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.3gpysx65vrtx1mw3.rcgu.o: In function `core::intrinsics::copy_nonoverlapping::h106c315c8151203b':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1860: undefined reference to `memcpy'
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1855: undefined reference to `abort'
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1855: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.3gpysx65vrtx1mw3.rcgu.o: In function `core::intrinsics::is_aligned_and_not_null::h4f686583b9419b1a':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1745: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.4fk979zh9rz3tdvf.rcgu.o: In function `core::ptr::swap_nonoverlapping_bytes::h263f7c0912ae4c3d':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:472: undefined reference to `abort'
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:494: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/blink-40c8e0f02000ab5f.4fk979zh9rz3tdvf.rcgu.o:/home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:500: more undefined references to `abort' follow
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcore-69e33a9af4453194.rlib(core-69e33a9af4453194.core.a37ui6x9-cgu.13.rcgu.o): In function `core::intrinsics::copy_nonoverlapping::h12295594d5eb04a5':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1860: undefined reference to `memcpy'
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1855: undefined reference to `abort'
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:1855: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcore-69e33a9af4453194.rlib(core-69e33a9af4453194.core.a37ui6x9-cgu.3.rcgu.o): In function `core::panicking::panic::hf3e1dc38e8693d18':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/bignum.rs:287: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcore-69e33a9af4453194.rlib(core-69e33a9af4453194.core.a37ui6x9-cgu.3.rcgu.o): In function `core::panicking::panic_fmt::hbbf5d4a80efa2a13':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:85: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcore-69e33a9af4453194.rlib(core-69e33a9af4453194.core.a37ui6x9-cgu.9.rcgu.o): In function `core::option::Option$LT$T$GT$::unwrap::h73d81fcba2eb990c':
          /home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:381: undefined reference to `abort'
          /home/bacongobbler/code/blink/target/avr-atmega328p/debug/deps/libcore-69e33a9af4453194.rlib(core-69e33a9af4453194.core.a37ui6x9-cgu.9.rcgu.o):/home/bacongobbler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:(.text._ZN4core6option15Option$LT$T$GT$6unwrap17h73d81fcba2eb990cE+0x5e): more undefined references to `abort' follow
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `blink`

To learn more, run the command again with --verbose.

LLVM ERROR: Expected a constant shift amount

I'm trying to build this for an Arduino UNO. The spec sheet of the device can be found here: https://docs.arduino.cc/resources/datasheets/A000066-datasheet.pdf

I run the following commands before building:

rustup override set nightly

and

export AVR_CPU_FREQUENCY_HZ=16000000

to set the desired environment.

Then I run the following command to build for the board:

cargo build -Z build-std=core --target avr-atmega328p.json --release

The avr-atmega328p.json file is included at the root level.

However I'm faced with the following error:

..
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.21
LLVM ERROR: Expected a constant shift amount!
error: could not compile `compiler_builtins` (lib)
warning: build failed, waiting for other jobs to finish...

Has anyone faced this before?

Failing to build in debug mode

When running cargo build -Z build-std=core --target avr-atmega328p.json --release the code compiles as expected, but when I try to run cargo build -Z build-std=core --target avr-atmega328p.json it errors out when trying to link as it fails to find abort.

cargo build -Z build-std=core --target avr-atmega328p.json --verbose full output
cargo build -Z build-std=core --target avr-atmega328p.json --verbose                                                                                                                                                      master [7c58f52]
       Fresh bitflags v0.7.0
       Fresh lazy_static v0.2.11
       Fresh core v0.0.0 (/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
       Fresh xml-rs v0.4.1
       Fresh rustc-std-workspace-core v1.99.0 (/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
       Fresh xmltree v0.4.0
       Fresh compiler_builtins v0.1.32
       Fresh avr-mcu v0.2.6
       Fresh ruduino v0.2.0
   Compiling blink v0.1.0 (/home/stefan/projects/rust/blink)
     Running `rustc --crate-name blink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=dbd5bc0bab399880 -C extra-filename=-dbd5bc0bab399880 --out-dir /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps --target /home/stefan/projects/rust/blink/avr-atmega328p.json -C incremental=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/incremental -L dependency=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps -L dependency=/home/stefan/projects/rust/blink/target/debug/deps --extern 'noprelude:compiler_builtins=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcompiler_builtins-1047601e27e05202.rlib' --extern 'noprelude:core=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib' --extern ruduino=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libruduino-99c4dc9b63733f14.rlib -Z unstable-options`
error: linking with `avr-gcc` failed: exit code: 1
  |
  = note: "avr-gcc" "-mmcu=atmega328p" "-L" "/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.1ca5aaqj6bdnuex4.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.1ebk1l9v3hjau2n1.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.1fndbknct4lu4wlz.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.2cv8u6cottlyccro.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.2zf72k7r92954j3z.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.3it9xiduxr7ti8mx.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.3kjq30baaid37pjd.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.4gq8agxkxhg3wz0k.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.4hgcoc9n8q9um29z.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.56sqtto8s98qrgy4.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.5uaamws58ocokst.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.quw4540n0ektdc4.rcgu.o" "-o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.elf" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "-L" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps" "-L" "/home/stefan/projects/rust/blink/target/debug/deps" "-L" "/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libruduino-99c4dc9b63733f14.rlib" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/librustc_std_workspace_core-c75f23490d0e2274.rlib" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib" "-Wl,--end-group" "/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcompiler_builtins-1047601e27e05202.rlib" "-Wl,-Bdynamic" "-lgcc"
  = note: /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.3it9xiduxr7ti8mx.rcgu.o: in function `core::ptr::swap_nonoverlapping_bytes':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:484: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:506: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:512: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.5uaamws58ocokst.rcgu.o: in function `core::ptr::swap_nonoverlapping':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:437: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:437: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.5uaamws58ocokst.rcgu.o:/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:442: more undefined references to `abort' follow
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.quw4540n0ektdc4.rcgu.o: in function `core::intrinsics::copy_nonoverlapping':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:2150: undefined reference to `memcpy'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:2145: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:2145: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/blink-dbd5bc0bab399880.quw4540n0ektdc4.rcgu.o: in function `core::intrinsics::is_aligned_and_not_null':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics.rs:2033: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.3.rcgu.o): in function `core::intrinsics::is_aligned_and_not_null':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:104: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.3.rcgu.o): in function `core::intrinsics::is_nonoverlapping':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:104: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.3.rcgu.o):/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:106: more undefined references to `abort' follow
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.3.rcgu.o): in function `core::intrinsics::copy_nonoverlapping':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:110: undefined reference to `memcpy'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:110: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:110: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.3.rcgu.o): in function `core::panicking::panic':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:112: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.3.rcgu.o): in function `core::panicking::panic_fmt':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/lossy.rs:111: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.9.rcgu.o): in function `core::option::Option<T>::unwrap':
          /home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:368: undefined reference to `abort'
          /usr/bin/avr-ld: /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib(core-ef7fa51ce8a961de.core.8suzmktt-cgu.9.rcgu.o):/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:(.text._ZN4core6option15Option$LT$T$GT$6unwrap17h367ffc255134e11fE+0x5e): more undefined references to `abort' follow
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `blink`.

Caused by:
  process didn't exit successfully: `rustc --crate-name blink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=dbd5bc0bab399880 -C extra-filename=-dbd5bc0bab399880 --out-dir /home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps --target /home/stefan/projects/rust/blink/avr-atmega328p.json -C incremental=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/incremental -L dependency=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps -L dependency=/home/stefan/projects/rust/blink/target/debug/deps --extern 'noprelude:compiler_builtins=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcompiler_builtins-1047601e27e05202.rlib' --extern 'noprelude:core=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libcore-ef7fa51ce8a961de.rlib' --extern ruduino=/home/stefan/projects/rust/blink/target/avr-atmega328p/debug/deps/libruduino-99c4dc9b63733f14.rlib -Z unstable-options` (exit code: 1)

error: "/usr/lib/rustlib/src/rust/Cargo.lock" does not exist

Maybe somebody can help me out with some pointers on what's probably a very basic question/problem. I'm very new to Rust, so my knowledge of the ecosystem is very light, and it's been tough to try to track down what I'm missing. I was hoping to play with Rust in an embedded environment, so that's where I've jumped right into. I'm trying to get the "blink" program up and running on an Arduino Uno that I have laying around. Unfortunately, I can't even get past step 1 (i.e., I can't get it to compile). Again, this is probably something basic I'm missing, so don't assume that it's an intricate issue. :)

I keep getting this error, and nothing I seem to do clears it up:

error: "/usr/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
rustup component add rust-src

That path does exist. There's a Cargo.toml there. There's no Cargo.lock.

This is on a fresh and updated Ubuntu 20.04 VM. I'm pretty sure this is the list of commands that got me to where I am now (maybe some are redundant; maybe I've messed some up):

sudo apt install rustc
sudo snap install --classic rustup
rustup install stable
rustup default stable
sudo apt install rust-src
rustup component add rust-src
sudo apt install gcc-avr
sudo apt install avr-libc
sudo apt install binutils-avr
sudo apt install avrdude
sudo apt install arduino-core
sudo apt install git

cd ~
git clone https://github.com/avr-rust/blink
cd blink

rustup override set nightly

export AVR_CPU_FREQUENCY_HZ=16000000
cargo build -Z build-std=core --target avr-atmega328p.json --release

Any ideas? Are there any good references out there to basically just step through what I'm trying to accomplish (the true hello-world embedded bring-up example)? I've kind of just pieced together info from a few different places at this point.

Thanks!

failed to read libcompiler_builtins/Cargo.toml

OS: Darwin 16.7.0 (MacOS Sierra 10.12.6)

Followed special instructions for mac in avr-rust/rust/readme up to rustup toolchain link avr-toolchain without rustup default avr-toolchain

% env |fgrep RUST
RUST_TARGET_PATH=/Users/temoto/dev/github.com/avr-rust/blink
XARGO_RUST_SRC=/Users/temoto/dev/github.com/avr-rust/rust/src

% RUST_BACKTRACE=1 rustup run avr-toolchain xargo build --target avr-atmega328p --release
   Compiling core v0.0.0 (/Users/temoto/dev/github.com/avr-rust/rust/src/libcore)
    Finished release [optimized] target(s) in 43.86s
error: failed to load source for a dependency on `compiler_builtins`

Caused by:
  Unable to update /Users/temoto/dev/github.com/avr-rust/rust/src/libcompiler_builtins

Caused by:
  failed to read `/Users/temoto/dev/github.com/avr-rust/rust/src/libcompiler_builtins/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
error: `"cargo" "build" "--release" "--manifest-path" "/var/folders/5s/j0nv22m55090n3x2h_pc17s80000gn/T/xargo.1ZmNvJ8QDbMP/Cargo.toml" "--target" "avr-atmega328p" "-p" "compiler_builtins"` failed with exit code: Some(101)
stack backtrace:
   0:        0x10e099dae - backtrace::backtrace::trace::h2b288dae4e90468b
   1:        0x10e09a94c - <backtrace::capture::Backtrace as core::default::Default>::default::h550523ee2bda132d
   2:        0x10e09a9cd - backtrace::capture::Backtrace::new::h3c27268eb4bacd81
   3:        0x10e0995f2 - error_chain::make_backtrace::hbe0ec31a030f79de
   4:        0x10e099688 - <error_chain::State as core::default::Default>::default::hf698b87d27c816d2
   5:        0x10e052853 - <std::process::Command as xargo::extensions::CommandExt>::run::hf63ef3ddf82c049c
   6:        0x10e05a29e - xargo::sysroot::build::hf6c5e0460be6e1f5
   7:        0x10e05e408 - xargo::sysroot::update::h62344c6baa369a4f
   8:        0x10e04c299 - xargo::main::h98ed4b12355b82e8
   9:        0x10e067b35 - std::rt::lang_start::{{closure}}::h11c6703c26ec252f
  10:        0x10e0aeb47 - std::panicking::try::do_call::h7aed6cf30733d762
  11:        0x10e0c298e - ___rust_maybe_catch_panic
  12:        0x10e0af41a - std::rt::lang_start_internal::hf650867aab82d8a2
  13:        0x10e04cd0b - _main
RUST_BACKTRACE=1 rustup run avr-toolchain xargo build --target avr-atmega328p  55.70s user 1.97s system 129% cpu 44.621 total

similar name exists in the module: `atmega328p`

Reporting my expirement

$ cargo +nightly-2021-01-07 build -Z build-std=core --target avr-atmega328p.json --release
   Compiling blink v0.1.0 (/home/gs0604/src/rust/RustAVR/blink)
error[E0432]: unresolved import `ruduino::cores::atmega328`
 --> src/main.rs:6:5
  |
6 | use ruduino::cores::atmega328 as avr_core;
  |     ^^^^^^^^^^^^^^^^---------^^^^^^^^^^^^
  |     |               |
  |     |               help: a similar name exists in the module: `atmega328p`
  |     no `atmega328` in `cores`

The +nightly-2021-01-07 is because #29, the README.md says.

cargo build -Z build-std=core --target avr-atmega328p.json --release

Cannot compile libcore

I followed instructions for avr-rust and blink compilation. But I am getting this error:

$ RUST_BACKTRACE=1 rustup run avr-toolchain xargo build --target avr-atmega328p --release --verbose
+ "rustc" "rustc" "--print" "sysroot"
+ "rustc" "rustc" "--print" "target-list"
+ RUSTFLAGS="--sysroot /home/greatgodoffire/.xargo -Z force-unstable-if-unmarked"
+ "cargo" "cargo" "build" "--release" "--manifest-path" "/tmp/xargo.MNxWNBlqynYS/Cargo.toml" "--target" "avr-atmega328p" "-v" "-p" "core"
warning: Patch `rustc-std-workspace-alloc v1.0.0 (/home/greatgodoffire/rust/rust/src/tools/rustc-std-workspace-alloc)` was not used in the crate graph.
Patch `rustc-std-workspace-core v1.0.0 (/home/greatgodoffire/rust/rust/src/tools/rustc-std-workspace-core)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
   Compiling core v0.0.0 (/home/greatgodoffire/rust/rust/src/libcore)
     Running `rustc --crate-name core --edition=2018 /home/greatgodoffire/rust/rust/src/libcore/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=e4bf3f58269cc549 -C extra-filename=-e4bf3f58269cc549 --out-dir /tmp/xargo.MNxWNBlqynYS/target/avr-atmega328p/release/deps --target avr-atmega328p -L dependency=/tmp/xargo.MNxWNBlqynYS/target/avr-atmega328p/release/deps -L dependency=/tmp/xargo.MNxWNBlqynYS/target/release/deps --sysroot /home/greatgodoffire/.xargo -Z force-unstable-if-unmarked`
error: Unrecognized option: 'json'

error: could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core --edition=2018 /home/greatgodoffire/rust/rust/src/libcore/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=e4bf3f58269cc549 -C extra-filename=-e4bf3f58269cc549 --out-dir /tmp/xargo.MNxWNBlqynYS/target/avr-atmega328p/release/deps --target avr-atmega328p -L dependency=/tmp/xargo.MNxWNBlqynYS/target/avr-atmega328p/release/deps -L dependency=/tmp/xargo.MNxWNBlqynYS/target/release/deps --sysroot /home/greatgodoffire/.xargo -Z force-unstable-if-unmarked` (exit code: 1)
error: `"cargo" "cargo" "build" "--release" "--manifest-path" "/tmp/xargo.MNxWNBlqynYS/Cargo.toml" "--target" "avr-atmega328p" "-v" "-p" "core"` failed with exit code: Some(101)
stack backtrace:
   0: error_chain::make_backtrace
   1: <error_chain::State as core::default::Default>::default
   2: <std::process::Command as xargo::extensions::CommandExt>::run
   3: xargo::sysroot::build
   4: xargo::sysroot::update
   5: xargo::main_inner
   6: std::rt::lang_start::{{closure}}
   7: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
      std::panicking::try::do_call
             at src/libstd/panicking.rs:292
   8: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:78
   9: std::panicking::try
             at src/libstd/panicking.rs:270
      std::panic::catch_unwind
             at src/libstd/panic.rs:394
      std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  10: main
  11: __libc_start_main
  12: _start

I'm using Ubuntu 16.04 and I've compiled avr-rust yesterday.

$ xargo --version
xargo 0.3.19
cargo 1.42.0-nightly (9d32b7b01 2020-01-26)

Cannot build newer version

Which version of avr-rust should be used to build this?
And, most importantly, which version of libcore?

I have just built avr-rust from HEAD (commit 512f3ae0cb18e9bb975a8d9fb4c73cd93d49ccbb) and I cannot find a matching libcore.

compiler_builtins fails to compile due to using recently stabilized cfg_target_vendor

I'm not sure if this belongs here or on the main avr-rust/rust repo, but just wanted to post this here in case it's helpful to anyone else.

I'm using Xargo on Arch Linux with the latest commit of the avr-rust/rust master branch.

I managed to get past avr-rust/rust-legacy-fork#128 using hercek's patches, but building compiler_builtins failed because of a use of the cfg_config_vendor feature. That feature was stabilized earlier this year, but the it looks like the AVR patched Rust version hasn't pulled upstream since the stabilization.

To fix this, I simply modified the downloaded source for lib.rs in compiler_builtins in the Cargo registry folder (~/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.12/src/lib.rs on my machine), adding the missing #![feature(cfg_target_vendor)] line to the existing feature flags in that file.

I also get a message that indicates that it might be possible to set a version for compiler_builtins, though I wasn't able to figure out how:
warning: dependency (compiler_builtins) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions

The last version of compiler_builtins that has the cfg_target_vendor feature flag appears to be 0.1.5. (relevant commit)

More version info:

$ rustup run avr-toolchain xargo -V
xargo 0.3.14
cargo 1.36.0-nightly (6be12653d 2019-04-19)

$ rustup run avr-toolchain rustc -V
rustc 1.33.0-dev

Compilation fails at before compiling libcore

I followed instructions for avr-rust and blink compilation. But I am getting this error:

โžค rustup run avr-toolchain xargo build --target avr-atmega328p --release
warning: Patch `rustc-std-workspace-core v1.0.0 (/home/linguini/Desktop/rust/rust-avr/src/tools/rustc-std-workspace-core)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --sysroot /home/linguini/.xargo -Z force-unstable-if-unmarked --target avr-atmega328p --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 1)
--- stderr
error: Error loading target specification: Could not find specification for target "avr-atmega328p"
  |
  = help: Use `--print target-list` for a list of built-in targets


error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.GqdRz0LJNIMX/Cargo.toml" "--target" "avr-atmega328p" "-p" "core"` failed with exit code: Some(101)
stack backtrace:
   0: error_chain::make_backtrace::h90af62d5c4a6fbd6 (0x55fde99c316b)
   1: <error_chain::State as core::default::Default>::default::h23f817a122243ac9 (0x55fde99c3235)
   2: <std::process::Command as xargo::extensions::CommandExt>::run::h01346a6b4f35f543 (0x55fde9976d4b)
   3: xargo::sysroot::build::h240260972f2e09ed (0x55fde997e541)
   4: xargo::sysroot::update::h94fd82f52808b493 (0x55fde998265d)
   5: xargo::main::ha282b52dabbcaa07 (0x55fde996fc7a)
   6: std::rt::lang_start::{{closure}}::h6c099b348d99c7de (0x55fde99738f2)
   7: std::rt::lang_start_internal::{{closure}}::h53f6e74893a27d59 (0x55fde99ee162)
             at src/libstd/rt.rs:59
      std::panicking::try::do_call::h8945e3e0fe63365a
             at src/libstd/panicking.rs:307
   8: __rust_maybe_catch_panic (0x55fde99fb1a9)
             at src/libpanic_unwind/lib.rs:102
   9: std::panicking::try::hee49dda4da841cb1 (0x55fde99ee058)
             at src/libstd/panicking.rs:286
  10: std::panic::catch_unwind::h89d0b17e1bb724c9 (0x55fde99e1665)
             at src/libstd/panic.rs:398
      std::rt::lang_start_internal::hcbec2a0475a1169a
             at src/libstd/rt.rs:58
  11: main (0x55fde9970a61)
  12: __libc_start_main (0x7f6283dcf222)
  13: _start (0x55fde99601ad)
  14: <unknown> (0x0)

I'm using Arch Linux and I used latest version of avr-rust from avr-support branch(cea79f77f5eac10eddf63e1e8728fd0e34c5998f).

โžค rustup -V
rustup 1.16.0
โžค xargo -V
xargo 0.3.13
cargo 1.34.0-nightly (865cb7010 2019-02-10)

Does it work with dependencies?

For instance, I'm currently working with a project in Arduino's C, and it uses adafruit/RTClib. How exactly do we perform something like the following in rust instead of C?

#include "RTClib.h"
#define DHTPIN 2
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);
dht.begin();
float h = dht.readHumidity();
Serial.print(h);

/usr/bin/avr-ld: unrecognized option '--eh-frame-hdr'

When running cargo build -Z build-std=core --target avr-atmega328p.json --release with
avr-gcc (GCC) 10.2.0 and rustc 1.46.0-nightly (346aec9b0 2020-07-11) i get the error:

   = note: /usr/bin/avr-ld: unrecognized option '--eh-frame-hdr'

I unfortunately don't know how to debug this any further so I'm just filing this issue.

The full command output
Running `rustc --crate-name blink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C metadata=342e6bfc99a63f66 -C extra-filename=-342e6bfc99a63f66 --out-dir /home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps --target /home/stefan/projects/rust/blink/avr-atmega328p.json -L dependency=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps -L dependency=/home/stefan/projects/rust/blink/target/release/deps --extern 'noprelude:compiler_builtins=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libcompiler_builtins-e9a85b3245518f86.rlib' --extern 'noprelude:core=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libcore-68e26358f39e7781.rlib' --extern ruduino=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libruduino-9899aa9e928bb47e.rlib -Z unstable-options`
error: linking with `avr-gcc` failed: exit code: 1
  |
  = note: "avr-gcc" "-mmcu=atmega328p" "-Wl,--eh-frame-hdr" "-L" "/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/blink-342e6bfc99a63f66.blink.2s4qwe14-cgu.0.rcgu.o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/blink-342e6bfc99a63f66.blink.2s4qwe14-cgu.1.rcgu.o" "-o" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/blink-342e6bfc99a63f66.elf" "-Wl,--gc-sections" "-no-pie" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps" "-L" "/home/stefan/projects/rust/blink/target/release/deps" "-L" "/home/stefan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/avr-atmega328p/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libruduino-9899aa9e928bb47e.rlib" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/librustc_std_workspace_core-6f91c9807e743908.rlib" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libcore-68e26358f39e7781.rlib" "-Wl,--end-group" "/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libcompiler_builtins-e9a85b3245518f86.rlib" "-Wl,-Bdynamic" "-lgcc"
  = note: /usr/bin/avr-ld: unrecognized option '--eh-frame-hdr'
          /usr/bin/avr-ld: use the --help option for usage information
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: could not compile `blink`.

Caused by:
  process didn't exit successfully: `rustc --crate-name blink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C metadata=342e6bfc99a63f66 -C extra-filename=-342e6bfc99a63f66 --out-dir /home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps --target /home/stefan/projects/rust/blink/avr-atmega328p.json -L dependency=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps -L dependency=/home/stefan/projects/rust/blink/target/release/deps --extern 'noprelude:compiler_builtins=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libcompiler_builtins-e9a85b3245518f86.rlib' --extern 'noprelude:core=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libcore-68e26358f39e7781.rlib' --extern ruduino=/home/stefan/projects/rust/blink/target/avr-atmega328p/release/deps/libruduino-9899aa9e928bb47e.rlib -Z unstable-options` (exit code: 1)

Linker does not support -no-pie command line option.

This issue is to report that

WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.

is a known warning.

And this issue to tell how a succesfull build looks.

stappers@myhost:~/src/rust/RustAVR/blink
$ cargo clean ; cargo version ; rustc --version
cargo 1.63.0-nightly (38472bc19 2022-05-31)
rustc 1.63.0-nightly (fee3a459d 2022-06-05)
stappers@myhost:~/src/rust/RustAVR/blink
$ cargo build --release
   Compiling proc-macro2 v1.0.39
   Compiling unicode-ident v1.0.0
   Compiling compiler_builtins v0.1.73
   Compiling syn v1.0.96
   Compiling json v0.12.4
   Compiling core v0.0.0 (/home/stappers/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling xml-rs v0.8.4
   Compiling lazy_static v1.4.0
   Compiling target-cpu-fetch v0.1.3
   Compiling xmltree v0.10.3
   Compiling target-cpu-macro v0.1.3
   Compiling avr-mcu v0.3.5
   Compiling quote v1.0.18
   Compiling ruduino v0.4.0 (https://github.com/avr-rust/ruduino?branch=master#a33d38a7)
   Compiling const_env_impl--value v0.1.2
   Compiling const_env--value v0.1.2
   Compiling rustc-std-workspace-core v1.99.0
     (/home/stappers/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling avr-config v2.0.1
   Compiling avr-std-stub v1.0.3
   Compiling avr_delay v0.4.0 (https://github.com/avr-rust/delay#cfe9848f)
   Compiling blink v0.1.0 (/home/stappers/src/rust/RustAVR/blink)
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished release [optimized] target(s) in 7.12s
stappers@myhost:~/src/rust/RustAVR/blink
$ file target/avr-atmega328p/release/blink.elf 
target/avr-atmega328p/release/blink.elf: ELF 32-bit LSB executable, Atmel AVR 8-bit, version 1 (SYSV),
  statically linked, with debug_info, not stripped
stappers@myhost:~/src/rust/RustAVR/blink
$ 

Busy loop is optimized out, preventing blinking

After setting up my cross compiler as per the avr-rust/rust readme, and compiling the unmolested blink program, I upload to my arduino uno clone, and the LED (PORTB 5 or arduino pin 13) doesn't blink, or even come on. reversing the order of the writes doesn't seem to help, but if I add a "loop {}" after setting PORTB to 0xFF, the led will stay lit as I expect.

Is it possible that small_delay is getting optimized away? If I do something like

    loop {
        for _ in 0..100000 {
            unsafe { write_volatile(PORTB, 0x00) }
        }
        for _ in 0..100000 {
            unsafe { write_volatile(PORTB, 0xFF) }
        }
    }

I get a proper fast blink.

Compilation fails at "rustc --print sysroot"

Building and installing rust-avr both completed successfully for me, but when I try to compile the blink example I get the following error:

flo@host:~/rust-blink$ rustup run avr-toolchain xargo build --target avr-atmega328p --release
error: `"rustc" "--print" "sysroot"` failed with exit code: Some(1)
stack backtrace:
   0: <no info> (0x55d409d6fb27)
   1: <no info> (0x55d409d6fbb5)
   2: <no info> (0x55d409d2a1ba)
   3: <no info> (0x55d409d2a750)
   4: <no info> (0x55d409d4228e)
   5: <no info> (0x55d409d22412)
   6: <no info> (0x55d409d82ef2)
   7: <no info> (0x55d409da2189)
   8: <no info> (0x55d409d8db5a)
   9: <no info> (0x55d409d43ac4)
  10: <no info> (0x7f126c84109a)
  11: <no info> (0x55d409d171e9)
  12: <no info> (0x0)

and when I run "rustc --print sysroot" directly it says

flo@host:~/fabac/ex09/rust-src$ rustc --print sysroot
error: couldn't load codegen backend "/home/flo/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so": "/home/flo/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so: invalid ELF header"

couldn't allocate input reg for constrain 'w'

I get this error compiling the project.
The whole error message:

PS C:\Users\woppe\Documents\Rust\blink> cargo build -Z build-std=core --target avr-atmega328p.json --release
   Compiling compiler_builtins v0.1.49
warning: target json file contains unused fields: no-compiler-rt

   Compiling avr-config v1.0.0
   Compiling avr-config v2.0.1
   Compiling avr-std-stub v1.0.2
   Compiling avr_delay v0.3.1
warning: `avr-config` (lib) generated 1 warning (1 duplicate)
warning: `avr-std-stub` (lib) generated 1 warning (1 duplicate)
warning: `avr-config` (lib) generated 1 warning (1 duplicate)
   Compiling ruduino v0.3.2
error: couldn't allocate input reg for constraint 'w'
  --> C:\Users\woppe\.cargo\registry\src\github.com-1ecc6299db9ec823\avr_delay-0.3.1\src\lib.rs:34:17
   |
34 |         unsafe {llvm_asm!("1: sbiw $0,1
   |                 ^

warning: `avr_delay` (lib) generated 1 warning (1 duplicate)
error: could not compile `avr_delay` due to previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
LLVM ERROR: Not supported instr: <MCInst 312 <MCOperand Reg:1> <MCOperand Imm:13> <MCOperand Reg:41>>
warning: `compiler_builtins` (lib) generated 1 warning
warning: `ruduino` (lib) generated 1 warning (1 duplicate)
error: build failed

Remove "how to setup a cross compiler" in README.md

I'm just getting started with AVR on rust, and the "blink" repo comes up first in google. The "How to set up a cross compiler" link threw me off for a while since AVR support is now (I believe) included in nightly rust, so I think that should be removed from the README.

Missing bin directory under stage1

I'm not exactly sure where to file this issue, so I figured I'd start here.
I successfully compiled the current head of the avr-support branch of the compiler (25ddeb2bfe14b3b0b60c2afdc5de99e2103f9176)

I added the avr-toolchain per the instructions and set it to be my default toolchain.
I then followed the instructions and exported my environment variables.

When I build, I get the following error.
It appears that libcore is built successfully, then blink fails to compile.
I've checked on the bin directory and it is indeed missing.

rubberduck@rubberduck-laptop:~/src/rust-blink$ xargo build --target avr-atmega328p --release
   Compiling core v0.0.0 (/home/rubberduck/src/rust/src/libcore)                                                                       
    Finished release [optimized] target(s) in 2m 48s                                                                                   
warning: dependency (compiler_builtins) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
    Updating crates.io index
   Compiling compiler_builtins v0.1.5                                                                                                  
    Finished release [optimized] target(s) in 24.61s                                                                                   
error: intermittent IO error while iterating directory `/home/rubberduck/src/rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin`
caused by: IO error for operation on /home/rubberduck/src/rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin: No such file or directory (os error 2)
caused by: No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` for a backtrace

Simplify cargo build invocation

Right now we essentially have env AVR_CPU_FREQUENCY_HZ=16000000 cargo +nightly build -Z build-std=core --target avr-atmega328p.json --release, which is fairly long.

Maybe it is better that users have to type in the target and build-std flags so they become aware of their necessity, but otherwise they could be omitted with the use of .cargo/config.toml. Perhaps a note about them in the README would be enough?

[build]
target = "avr-atmega328p.json"

[unstable]
build-std = ["core"]

# Cargo versions before 2021-02-23 won't recognize this: https://github.com/rust-lang/cargo/pull/9175
[env]
AVR_CPU_FREQUENCY_HZ = 16000000

At which point the command is simply cargo +nightly build --release (once the LLVM error is resolved and the user has a new enough cargo). We don't even need +nightly if ./rust-toolchain is added.

FYI: possible moving crate

This is to share with you an observation of something that I didn't expect to see.

$ cargo update
    Updating git repository `https://github.com/avr-rust/ruduino`
    Updating crates.io index
    Updating git repository `https://github.com/avr-rust/delay`
    Updating avr_delay v0.4.0 (https://github.com/avr-rust/delay#cfe9848f) -> #6ba963c3
    Updating ruduino v0.4.0 (https://github.com/avr-rust/ruduino?branch=master#a33d38a7) -> #c113fc88
gs0604@trancilo:~/src/rust/RustAVR/blink
$

The #6ba963c3 is another (short) commit hash as of the 0.4.0 tag from crate avr_delay.

During build is again #6ba963c3 seen.

$ cargo build --release
   Compiling avr_delay v0.4.0 (https://github.com/avr-rust/delay#6ba963c3)
   Compiling ruduino v0.4.0 (https://github.com/avr-rust/ruduino?branch=master#c113fc88)
   Compiling blink v0.1.0 (/home/gs0604/src/rust/RustAVR/blink)
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished release [optimized] target(s) in 0.43s
$

It is #398d435 that goes with v0.4.0.

So it seems that blink builds with a moving crate, it should be build with stable crates.

Plan is to get https://github.com/avr-rust/ruduino/blob/master/Cargo.toml#L32 currently

avr_delay = { git = "https://github.com/avr-rust/delay", version = "0.4.0" }

back into something like:

avr_delay = "0.N"

Meanwhile be aware of this situation.

Compilation fails because of libcore

I followed instructions for avr-rust and blink compilation. But I am getting this error:

$ rustup run avr-toolchain xargo build --target avr-atmega328p --release
   Compiling core v0.0.0 (/data/projects/rust/src/libcore)
Expected either Y or Z register
UNREACHABLE executed at /Volumes/data/projects/rust/src/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp:146!
error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core /data/projects/rust/src/libcore/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=e108d56649d84ee9 -C extra-filename=-e108d56649d84ee9 --out-dir /var/folders/gr/btjlj89x0y17vf4ndzl5vklh0000gn/T/xargo.J7xalPBrudXQ/target/avr-atmega328p/release/deps --target avr-atmega328p -L dependency=/var/folders/gr/btjlj89x0y17vf4ndzl5vklh0000gn/T/xargo.J7xalPBrudXQ/target/avr-atmega328p/release/deps -L dependency=/var/folders/gr/btjlj89x0y17vf4ndzl5vklh0000gn/T/xargo.J7xalPBrudXQ/target/release/deps --sysroot /Users/dima/.xargo -Z force-unstable-if-unmarked` (signal: 6, SIGABRT: process abort signal)
error: `"cargo" "build" "--release" "--manifest-path" "/var/folders/gr/btjlj89x0y17vf4ndzl5vklh0000gn/T/xargo.J7xalPBrudXQ/Cargo.toml" "--target" "avr-atmega328p" "-p" "core"` failed with exit code: Some(101)
stack backtrace:
   0: error_chain::make_backtrace::h166fa119e1985af1 (0x10096842f)
   1: <error_chain::State as core::default::Default>::default::h18ae0d13c0463715 (0x100968508)
   2: <std::process::Command as xargo::extensions::CommandExt>::run::h88ad1c2e9a782259 (0x1009199c8)
   3: xargo::sysroot::build::hd0470fbf77e421f3 (0x100921bc9)
   4: xargo::sysroot::update::hd8eeb1f442bbaa50 (0x100925e3b)
   5: xargo::main::h47d600b4ed14ec0b (0x10091270b)
   6: std::rt::lang_start::{{closure}}::h374674c83cbdbbae (0x100935145)
   7: std::panicking::try::do_call::h851b364ae5b66c84 (0x10098a657)
   8: ___rust_maybe_catch_panic (0x10099843e)
   9: std::panicking::try::h58b3913a15145a6c (0x10098a547)
  10: std::rt::lang_start_internal::h38db6b8e7df2b1dd (0x10097e4d2)
  11: _main (0x1009134a8)

I'm using Mac and I used latest version of avr-rust from avr-support branch (cea79f77f5eac).

build/setup error

% rustup run avr-toolchain xargo build --target avr-atmega328p --release
    Updating git repository `https://github.com/avr-rust/libcore`
   Compiling core v0.1.0 (https://github.com/avr-rust/libcore?branch=rust-26015da0#ede6063b)
    Finished release [optimized] target(s) in 21.92s
error: intermittent IO error while iterating directory `/home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin`
caused by: IO error for operation on /home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin: No such file or directory (os error 2)
caused by: No such file or directory (os error 2)

Not sure what's going on, but there's clearly no bin directory in there:

niklas@llw ~/src/avr-rust/blink (git)-[master] % find /home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/
/home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/
/home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
/home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_privacy-332844a755d8f78a.so
/home/niklas/src/avr-rust/build/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgraphviz-fa458b100835357c.so
...
% echo $XARGO_RUST_SRC
../rust

% echo $RUST_TARGET_PATH
/home/niklas/src/avr-rust/blink

% git rev-parse HEAD
e2053a60069536eb09f0a98e0d347b6a8ae9643a

What can I do about this?

cannot find macro `llvm_asm` in this scope

hi, getting this during compiling

cargo build -Z build-std=core --target avr-atmega328p.json --release
...

   Compiling avr_delay v0.3.1
error: cannot find macro `llvm_asm` in this scope
  --> /Users/zag2art/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:34:17
   |
34 |         unsafe {llvm_asm!("1: sbiw $0,1
   |                 ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
  --> /Users/zag2art/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:41:13
   |
41 |     unsafe {llvm_asm!("1: sbiw $0,1
   |             ^^^^^^^^

is that an avr_delay issue or this blink project?

Note: compiling this on Mac folowing "The AVR-Rust Guidebook"

failes to upload on real hardware

`
C:\Users\djdis\Documents\blink>avrdude -patmega328p -carduino -P \.\COM14 -D -b 115200 -Uflash:w:target\avr-atmega328p\release\blink.elf:i -v -v -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"

Using Port                    : \\.\COM14
Using Programmer              : arduino
Overriding Baud Rate          : 115200
AVR Part                      : ATMEGA328P
Chip Erase delay              : 9000 us
PAGEL                         : PD7
BS2                           : PC2
RESET disposition             : dedicated
RETRY pulse                   : SCK
serial program mode           : yes
parallel program mode         : yes
Timeout                       : 200
StabDelay                     : 100
CmdexeDelay                   : 25
SyncLoops                     : 32
ByteDelay                     : 0
PollIndex                     : 3
PollValue                     : 0x53
Memory Detail                 :

Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

Programmer Type : Arduino
Description     : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget         : 0.3 V
Varef           : 0.3 V
Oscillator      : 28.800 kHz
SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: safemode read 1, lfuse value: 0
avrdude: safemode read 2, lfuse value: 0
avrdude: safemode read 3, lfuse value: 0
avrdude: safemode: lfuse reads as 0
avrdude: safemode read 1, hfuse value: 0
avrdude: safemode read 2, hfuse value: 0
avrdude: safemode read 3, hfuse value: 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode read 1, efuse value: 0
avrdude: safemode read 2, efuse value: 0
avrdude: safemode read 3, efuse value: 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "target\avr-atmega328p\release\blink.elf"
avrdude: WARNING: no end of file record found for Intel Hex file "target\avr-atmega328p\release\blink.elf"
avrdude: writing flash (0 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 0 bytes of flash written
avrdude: verifying flash memory against target\avr-atmega328p\release\blink.elf:
avrdude: load data flash data from input file target\avr-atmega328p\release\blink.elf:
avrdude: WARNING: no end of file record found for Intel Hex file "target\avr-atmega328p\release\blink.elf"
avrdude: input file target\avr-atmega328p\release\blink.elf contains 0 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 11.02s

avrdude: verifying ...
avrdude: 0 bytes of flash verified

avrdude: safemode read 1, lfuse value: 0
avrdude: safemode read 2, lfuse value: 0
avrdude: safemode read 3, lfuse value: 0
avrdude: safemode: lfuse reads as 0
avrdude: safemode read 1, hfuse value: 0
avrdude: safemode read 2, hfuse value: 0
avrdude: safemode read 3, hfuse value: 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode read 1, efuse value: 0
avrdude: safemode read 2, efuse value: 0
avrdude: safemode read 3, efuse value: 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

`

i think this is problem
avrdude: WARNING: no end of file record found for Intel Hex file "target\avr-atmega328p\release\blink.elf" avrdude: writing flash (0 bytes):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.