Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    rahix
    @rahix:matrix.org
    [m]
    hm, and I suppose you tried ravedude nano ....?
    enaut
    @enaut:matrix.org
    [m]
    ravedude nano --open-console --baudrate 57600 -P /dev/ttyUSB0 target/avr-atmega168/release/rust-arduino-blink.elf 
           Board Arduino Nano
     Programming target/avr-atmega168/release/rust-arduino-blink.elf => /dev/ttyUSB0
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
    enaut
    @enaut:matrix.org
    [m]
    I get that same error on the arduino IDE when I choose the default atmega328P
    Is ravedude automagically expecting arduino nanos to have the atmega328P chip?
    and thanks for your instant help!
    rahix
    @rahix:matrix.org
    [m]
    sorry, was afk just now
    yes, ravedude expects 328p because that's the only official nano ;)
    but I've head of the clones already, we should add proper support for them in ravedude & avr-hal
    jwagen
    @jwagen:matrix.org
    [m]
    Hmm, maybe it is the reset signaling that is not working. Try to push the reset button just before running the command
    rahix
    @rahix:matrix.org
    [m]
    well it does not make sense to try calling avrdude with -patmega328p for an ATmega168 anyway
    I'll hopefully get around to adding support in ravedude & avr-hal later this evening. If not, just ping me again enaut
    enaut
    @enaut:matrix.org
    [m]
    rahix wow thanks! :)
    jwagen I think reset is working just fine since the arduino stops the blinking pattern right when I press flash.
    rahix
    @rahix:matrix.org
    [m]
    enaut: please try Rahix/avr-hal#195 and report if that makes it work (I don't have any such devices on hand to test myself)
    I'll quickly add arduino-hal support as well in the meantime
    enaut
    @enaut:matrix.org
    [m]
    @rahix works nice as expected!
    rahix
    @rahix:matrix.org
    [m]
    great! I just pushed support for arduino-hal as well :)
    So if you point the git-revision in Cargo.toml to e72faada6bb7f67990216525aeb2132bbb3d53e9, you should be able to use it just like you'd do for the Arduino Nano (with ATmega328P)
    If you can test that as well, I'll merge the PR and add the board to the template repository
    enaut
    @enaut:matrix.org
    [m]
    sorry I'm not sure I can follow here... I installed ravedude from the git version and then I can use it. My current dependency on avr-hal looks like: [dependencies.arduino-uno] git = "https://github.com/Rahix/avr-hal" features=["arduino-nano"]
    what should work after that does not work before?
    rahix
    @rahix:matrix.org
    [m]
    add rev = "e72faada6bb7f67990216525aeb2132bbb3d53e9" and change the features to features = ["nano168"]

    what should work after that does not work before?

    as the two chips are almost identical, most likely nothing. But to keep everything clean I'd want to have the 168 version be handled separate, ontop of its own HAL layer. This means if there ever are any differences to care for, it is easy to differentiate the two.

    So more than supporting anything new, I just wanted to make sure I did not break anything with my changeset ;)
    enaut
    @enaut:matrix.org
    [m]
    I fail to be successfull... I added the small blink example to a git repository: https://github.com/enaut/temp-test
    ```
    ❯ cargo run
        Updating git repository `https://github.com/Rahix/avr-hal.git`
    error: no matching package named `arduino-uno` found
    location searched: https://github.com/Rahix/avr-hal.git?rev=e72faada6bb7f67990216525aeb2132bbb3d53e9
    perhaps you meant: arduino-hal
    required by package `rust-arduino-blink v0.1.0 (/home/dietrich/Projekte/Source/rust-arduino-blink)`
    what do I do wrong?
    rahix
    @rahix:matrix.org
    [m]
    hmm, wait a moment
    ooh, I totally missed that you're still using the old version of avr-hal... Sorry :(
    In that case, give me another minute - I'll prepare the new project template for the board, then you can just use that to test
    (We did some rather large changes to the crate-architecture of avr-hal recently... Maybe check https://github.com/Rahix/avr-hal#repository-structure to familiarize yourself with the new layout if you intend to update your own projects)
    enaut
    @enaut:matrix.org
    [m]
    OH thank you I suspected something like that!
    as that is my only proof of concept project so far no need to upgrade ;)
    rahix
    @rahix:matrix.org
    [m]
    alright, try generating a project with cargo generate --git https://github.com/Rahix/avr-hal-template.git --branch wip and then selecting Nano168 as the board. If I didn't mess anything up, cargo run should be enough with that to make your board blink (might need to set a port with cargo run -- -P /dev/ttyFOO).
    enaut
    @enaut:matrix.org
    [m]
    rahix Thank you so much! unfortunately I'm still not getting there... result now is:
    cargo run --bin test-nano168
        Finished dev [optimized + debuginfo] target(s) in 0.02s
         Running `ravedude nano168 -cb 57600 -P /dev/ttyUSB0 target/avr-atmega168/debug/test-nano168.elf`
           Board Nano Clone (ATmega168)
     Programming target/avr-atmega168/debug/test-nano168.elf => /dev/ttyUSB0
    and then nothing happens
    the weired thing is my other project works now with only cargo run (after I pasted the code from your example)
    rahix
    @rahix:matrix.org
    [m]
    huh, that is super strange
    enaut
    @enaut:matrix.org
    [m]
    Oh I found the difference what does profile=minimal in toolchain.toml do?
    on removing that everything works as expected
    rahix
    @rahix:matrix.org
    [m]
    oh really? that is confusing
    it shouldn't have an influence whatsoever... here is relevant documentation: https://rust-lang.github.io/rustup/concepts/profiles.html
    it just controls whether rustfmt and clippy are installed for the toolchain
    enaut
    @enaut:matrix.org
    [m]
    that is indeed confusing...
    rahix
    @rahix:matrix.org
    [m]
    especially because it should have influenced the other project exactly the same...
    enaut
    @enaut:matrix.org
    [m]
    dammit I'm dumb...
    I searched for the difference... and the only issue was... I was still connected to the Serial port in the other window...
    So the template works just fine!