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

Arduino Nano: avrdude error: programmer is not responding #547

Closed
BrandonLeeDotDev opened this issue May 9, 2024 · 11 comments
Closed

Arduino Nano: avrdude error: programmer is not responding #547

BrandonLeeDotDev opened this issue May 9, 2024 · 11 comments
Labels

Comments

@BrandonLeeDotDev
Copy link

BrandonLeeDotDev commented May 9, 2024

I can push from Arduino IDE, however cannot from rust with example

lsb_release -a

user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.10
Release:	23.10
Codename:	mantic

gcc --version

user@terminal:~/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug$ gcc --version
gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cargo build

user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ cargo build
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
   Compiling arduino-nano-examples v0.0.0 (/home/user/Documents/project_transmit/avr-hal/examples/arduino-nano)
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.37s

rustup show

user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/user/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2023-12-28-x86_64-unknown-linux-gnu
nightly-2024-03-22-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
1.52.0-x86_64-unknown-linux-gnu
1.53.0-x86_64-unknown-linux-gnu
1.56.0-x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-2024-03-22-x86_64-unknown-linux-gnu (directory override for '/home/user/Documents/project_transmit/avr-hal/examples/arduino-nano')
rustc 1.79.0-nightly (0ad927c0c 2024-03-21)

cargo run --bin nano-blink

user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ export RAVEDUDE_PORT=/dev/ttyUSB0
user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ env | grep RAV
RAVEDUDE_PORT=/dev/ttyUSB0
user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ cargo run --bin nano-blink
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.04s
     Running `ravedude nano -cb 57600 /home/user/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug/nano-blink.elf`
       Board Arduino Nano
 Programming /home/user/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug/nano-blink.elf => /dev/ttyUSB0
avrdude error: programmer is not responding
avrdude warning: attempt 1 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 2 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 3 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 4 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 5 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 6 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 7 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 8 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 9 of 10: not in sync: resp=0x00
avrdude error: programmer is not responding
avrdude warning: attempt 10 of 10: not in sync: resp=0x00
avrdude error: unable to open programmer arduino on port /dev/ttyUSB0

avrdude done.  Thank you.

Error: avrdude failed
@Rahix
Copy link
Owner

Rahix commented May 9, 2024

Please provide more information. What's not working? What behavior are you observing? What did you do to trigger this?

You can't expect us to guess what is going on from this little information.

@BrandonLeeDotDev
Copy link
Author

@Rahix updated...

@stappersg
Copy link
Contributor

stappersg commented May 10, 2024 via email

@Rahix Rahix changed the title Cant Build WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without. Arduino Nano: avrdude error: programmer is not responding May 10, 2024
@Rahix Rahix added the ravedude label May 10, 2024
@Rahix
Copy link
Owner

Rahix commented May 10, 2024

@BrandonLeeDotDev what version of avrdude and ravedude do you have installed? Please check the avrdude command that's used by your Arduino IDE to flash. Then change the ravedude invocation in .cargo/config.toml to include --debug-avrdude to see what avrdude command ravedude issues.

@Rahix
Copy link
Owner

Rahix commented May 10, 2024

Also, please check whether you have the issue discussed in #299.

@BrandonLeeDotDev
Copy link
Author

@Rahix

user@terminal:~/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug$ avrdude --version
...
avrdude version 7.1, URL: <https://github.com/avrdudes/avrdude>
user@terminal:~/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug$ ravedude --version
ravedude v0.1.8 (no git)

Cargo.toml

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

[target.'cfg(target_arch = "avr")']
runner = "ravedude new-nano -cb 115200 --debug-avrdude"

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

after adding debug flag above && new-nano. I had already figured out the baud rate was incorrect...

user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ cargo build
   Compiling compiler_builtins v0.1.108
   Compiling core v0.0.0 (/home/user/.rustup/toolchains/nightly-2024-03-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling syn v1.0.109
   Compiling rustversion v1.0.16
   Compiling embedded-hal-bus v0.1.0
   Compiling paste v1.0.15
   Compiling quote v1.0.36
   Compiling avr-hal-generic v0.1.0 (/home/user/Documents/project_transmit/avr-hal/avr-hal-generic)
   Compiling ufmt-macros v0.3.0
   Compiling avr-device-macros v0.5.4
   Compiling rustc-std-workspace-core v1.99.0 (/home/user/.rustup/toolchains/nightly-2024-03-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling nb v1.1.0
   Compiling vcell v0.1.3
   Compiling critical-section v1.1.2
   Compiling bare-metal v1.0.0
   Compiling cfg-if v1.0.0
   Compiling void v1.0.2
   Compiling ufmt-write v0.1.0
   Compiling embedded-hal v1.0.0
   Compiling embedded-storage v0.2.0
   Compiling unwrap-infallible v0.1.5
   Compiling cfg-if v0.1.10
   Compiling avr-device v0.5.4
   Compiling ufmt v0.2.0
   Compiling panic-halt v0.2.0
   Compiling nb v0.1.3
   Compiling embedded-hal v0.2.7
   Compiling atmega-hal v0.1.0 (/home/user/Documents/project_transmit/avr-hal/mcu/atmega-hal)
   Compiling arduino-hal v0.1.0 (/home/user/Documents/project_transmit/avr-hal/arduino-hal)
   Compiling arduino-nano-examples v0.0.0 (/home/user/Documents/project_transmit/avr-hal/examples/arduino-nano)
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished `dev` profile [optimized + debuginfo] target(s) in 9.13s

Something to note here is it is compiling however... there is not change when I upload to the board...

user@terminal:~/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug$ avrdude -p m328p -c arduino -P /dev/ttyUSB0 -b 115200 flash:w:nano-blink.elf

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e950f (probably m328p)

avrdude done.  Thank you.

@Rahix
Copy link
Owner

Rahix commented May 10, 2024

Sorry, I'm not following. What is the problem at this point? You show cargo build. Are you saying that cargo run (i.e. running ravedude) still produces the same error as above with the nano-new config?

@BrandonLeeDotDev
Copy link
Author

@Rahix before the initial post it was compiling. Then it ceased. Until that point I assumed fault. After, I filed the issue. That said here is the output when trying to upload to the board from the elf

user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ cargo clean
     Removed 410 files, 205.4MiB total
user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ cargo build
   Compiling compiler_builtins v0.1.108
   Compiling core v0.0.0 (/home/user/.rustup/toolchains/nightly-2024-03-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling syn v1.0.109
   Compiling rustversion v1.0.16
   Compiling embedded-hal-bus v0.1.0
   Compiling paste v1.0.15
   Compiling quote v1.0.36
   Compiling avr-hal-generic v0.1.0 (/home/user/Documents/project_transmit/avr-hal/avr-hal-generic)
   Compiling ufmt-macros v0.3.0
   Compiling avr-device-macros v0.5.4
   Compiling rustc-std-workspace-core v1.99.0 (/home/user/.rustup/toolchains/nightly-2024-03-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling nb v1.1.0
   Compiling critical-section v1.1.2
   Compiling void v1.0.2
   Compiling embedded-hal v1.0.0
   Compiling bare-metal v1.0.0
   Compiling vcell v0.1.3
   Compiling cfg-if v1.0.0
   Compiling ufmt-write v0.1.0
   Compiling unwrap-infallible v0.1.5
   Compiling embedded-storage v0.2.0
   Compiling cfg-if v0.1.10
   Compiling ufmt v0.2.0
   Compiling panic-halt v0.2.0
   Compiling avr-device v0.5.4
   Compiling nb v0.1.3
   Compiling embedded-hal v0.2.7
   Compiling atmega-hal v0.1.0 (/home/user/Documents/project_transmit/avr-hal/mcu/atmega-hal)
   Compiling arduino-hal v0.1.0 (/home/user/Documents/project_transmit/avr-hal/arduino-hal)
   Compiling arduino-nano-examples v0.0.0 (/home/user/Documents/project_transmit/avr-hal/examples/arduino-nano)
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished `dev` profile [optimized + debuginfo] target(s) in 9.49s
user@terminal:~/Documents/project_transmit/avr-hal/examples/arduino-nano$ cargo run --bin nano-blink
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.04s
     Running `ravedude new-nano -cb 115200 --debug-avrdude /home/user/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug/nano-blink.elf`
thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravedude-0.1.8/src/main.rs:97:47:
board not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
user@terminal:~/Documents/project_transmit/avr-hal/target/debug$ cd ../../avr-atmega328p/debug
user@terminal:~/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug$ ls
build  examples     nano-adc.d    nano-blink.d    nano-panic.d
deps   incremental  nano-adc.elf  nano-blink.elf  nano-panic.elf
user@terminal:~/Documents/project_transmit/avr-hal/target/avr-atmega328p/debug$ avrdude -p m328p -c arduino -P /dev/ttyUSB0 -b 115200 flash:w:nano-blink.elf

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e950f (probably m328p)

avrdude done.  Thank you.

@BrandonLeeDotDev
Copy link
Author

@Rahix Adding the debug flag, nano-new, baud rate... etc changed nothing.. there is actually no additional info created using the debug flag as shown above... or am I just missing something?

@Rahix
Copy link
Owner

Rahix commented May 10, 2024

You need to actually read the error messages you are getting!

thread 'main' panicked at [...]/ravedude-0.1.8/src/main.rs:97:47:
board not found

And we can see the reason in the line above: You wrote new-nano instead of nano-new. Please try again with the correct name ;)

@BrandonLeeDotDev
Copy link
Author

@Rahix That was it! Thank you for the help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants