Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    jaxter184
    @jaxter184:matrix.org
    [m]
    anyway, neat blog post regardless
    Laris Qiao
    @laris
    for llvm_asm!(), I use this format for multi-lines
        unsafe { llvm_asm!("    LDI   $0, $1
                                LSR   $0
                                BRCS  .+2
                                LSR   $0
                                BRCS  .+2
                                BRCS  .+2
                            1:  DEC   $0
                                NOP
                                BRNE  1b"
                                :"=d"(cnt) :"M"(reg) :: "volatile"); }
    }
    @cricke:matrix.org
    Jared Forsyth
    @jaredly
    Does anyone have experience getting an arduino nano (atmega168pa) running? The Arduino IDE connects with it fine, but I can't seem to get avrdude to upload the .elf file (I just get ReceiveMessage(): timeout)
    Rahix
    @Rahix
    Can you share the full avrdude commandline you've tried?
    Jared Forsyth
    @jaredly
    avrdude -patmega168p -cavrispmkII -P/dev/tty.usbserial-1410 -b9600 -D -Uflash:w:target/atmega168/release/rust-micro.elf:e
    jwagen
    @jwagen:matrix.org
    [m]
    I am pretty sure that is the wrong baud rate I think it should be -b115200
    Or 57600. I am not quite sure
    Jared Forsyth
    @jaredly
    I've tried several different baud rates, kinda flailing around. neither of those are working either :/
    Rahix
    @Rahix
    did you try -carduino?
    Jared Forsyth
    @jaredly
    aha!!! wow thank you so much 😅
    ok this worked avrdude -patmega168 -carduino -P/dev/tty.usbserial-1410 -b19200 -D -Uflash:w:target/atmega168/release/rust-micro.elf:e
    Rahix
    @Rahix
    :)
    Josef Ippisch
    @TSPMP
    Can anybody compile the blink example on the latest nightly? I get the following error
    [user blink]$ cargo +nightly build -Z build-std=core --target avr-atmega328p.json --release
       Compiling bitflags v0.7.0
       Compiling compiler_builtins v0.1.39
       Compiling lazy_static v0.2.11
       Compiling core v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
       Compiling xml-rs v0.4.1
       Compiling xmltree v0.4.0
       Compiling avr-mcu v0.2.6
       Compiling ruduino v0.2.0
       Compiling rustc-std-workspace-core v1.99.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
    LLVM ERROR: Not supported instr: <MCInst 258 <MCOperand Reg:1> <MCOperand Imm:15> <MCOperand Reg:45>>
    error: could not compile `compiler_builtins`
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    Ben Schattinger
    @lights0123
    Josef Ippisch
    @TSPMP
    @lights0123 Looks like I am not the only one then. Thanks!
    jaxter184
    @jaxter184:matrix.org
    [m]
    ive been looking to do usb stuff, and until recently, i was planning to do it on an stm32, but it seems like the attiny85 is capable of usb?
    it doesn't say anything about it on the datasheet, but there's this project: https://digistump.com/wiki/digispark
    which suggests that its possible
    jwagen
    @jwagen:matrix.org
    [m]
    Only kind of. I think it supports bit banged low speed usb. I think the relevant project is called avr vusb
    jaxter184
    @jaxter184:matrix.org
    [m]
    ah yeah i was about to say
    i dont see anything in the avr-hal, and its not in the datasheet
    and the pages ive been looking at are pretty cryptic about how it works
    or maybe i just suck at reading
    jwagen
    @jwagen:matrix.org
    [m]
    For avr with usb your best bet is probably atmega32
    jaxter184
    @jaxter184:matrix.org
    [m]
    either way, i guess virtual low-speed usb is something that could be implemented as a crate?
    also, is atmega32 one of the newer series-x chips? i havent been able to get avrxmega3 compiling on my machine
    jwagen
    @jwagen:matrix.org
    [m]
    No I think atmega32 is one of the "classic" megas
    jaxter184
    @jaxter184:matrix.org
    [m]
    ah, i see, just atmega32 and not like atmega32xx
    it looks like they might have been discontinued?
    there arent any for sale on mouser
    jwagen
    @jwagen:matrix.org
    [m]
    Yes it is confusing. Atmega8, atmega16, and atmega32 are the same series all with usb.
    I don't think it's discontinued. It is used on the Arduino micro. It is quite popular among diy keyboards.
    Microchip is also known to not discontinue old parts.
    jaxter184
    @jaxter184:matrix.org
    [m]
    hmm yeah i guess ive never heard of a discontinued attiny/mega lol
    probably just an idiosynchrasy on mouser's part
    jwagen
    @jwagen:matrix.org
    [m]
    As for avr usb support in rust, it is currently lacking. I think it should be possible to implement the traits from the usb-device crate, but it is a bit of work.
    jaxter184
    @jaxter184:matrix.org
    [m]
    awesome, ill take a look at that issue, thanks for your help!
    jwagen
    @jwagen:matrix.org
    [m]
    Seems that someone has worked more on it than since last I looked into avr usb in rust.
    David
    @drmorr0
    I have a couple more posts up on my blog about my adventures with rust and avr: https://objectdisoriented.evokewonder.com
    this time with fewer top-level dancing GIFs :P
    rahix
    @rahix:matrix.org
    [m]
    jwagen
    @jwagen:matrix.org
    [m]
    @drmorr0: I am not sure which avr device you are working on, but if it is a tinyX, or Dx you can use https://github.com/stemnic/pyAVRdbg to debug with gdb if you have a supported debugger.
    The cheapest supposed debuggers is probably a curiosity nano Dev kit or the snap debugger.
    It should support most of the common debugging features such as break, single step and read and write variables.
    jwagen
    @jwagen:matrix.org
    [m]
    :point_up: Edit: drmorr0 (David): I am not sure which avr device you are working on, but if it is a tinyX, or Dx you can use https://github.com/stemnic/pyAVRdbg to debug with gdb if you have a supported debugger.
    The cheapest supported debuggers is probably a curiosity nano Dev kit or the snap debugger.
    David
    @drmorr0
    @jwagen:matrix.org thanks -- I'm on a Arduino Uno, so I'm not sure that will work
    @rahix:matrix.org oooh, that looks like what I want, thanks!
    jwagen
    @jwagen:matrix.org
    [m]
    @drmorr0: ok, i guess then you are limited to print debugging or using a simulator. Just wanted to mention it in case you did use one of the supported devices.