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]
    It's super crude and hacky, but here: https://rahix.de/tmp/r2-symtrace.py (needs r2pipe from pypi)
    E.g. ./r2-symtrace.py @sym.malloc /path/to/firmware.elf to find all allocation calls :)
    It generates a graphviz dot file on stdout, so can be piped into | xdot - for example
    mjhouse
    @mjhouse:matrix.org
    [m]
    rahix: I used that new ravedude release, and it works for the nano now.
    Added a comment to the pull too, just for posterity.
    rahix
    @rahix:matrix.org
    [m]
    thanks :)
    mjhouse
    @mjhouse:matrix.org
    [m]
    no problem. Thanks for making it. I like the ravedude website too, btw.
    mjhouse
    @mjhouse:matrix.org
    [m]
    Hey rahix am I doing this right?
            let i2c = I2cMaster::new(
                dp.TWI,
                a4, 
                a5,
                57600
            );
    and my object temperature and ambient temperature are both 0.00, but there aren't any errors.
            let a4 = pins.a4.into_pull_up_input(&mut pins.ddr);
            let a5 = pins.a5.into_pull_up_input(&mut pins.ddr);
    rahix
    @rahix:matrix.org
    [m]
    looks good in general, though 57600 is a bit odd. For i2c, 50kHz or 100kHz are common (check what the peripheral supports)
    is the library using floating point nunbers?
    mjhouse
    @mjhouse:matrix.org
    [m]
    Yeah, hold on and I'll dump the whole thing.
        let a4 = pins.a4.into_pull_up_input(&mut pins.ddr);
        let a5 = pins.a5.into_pull_up_input(&mut pins.ddr);
    
        let i2c = I2cMaster::new(
            dp.TWI,
            a4, 
            a5,
            57600
        );
    
        let addr = SlaveAddr::default();
        let mut sensor = Mlx9061x::new_mlx90614(i2c, addr, 5).unwrap();
    
        loop {
            let temp = sensor.object1_temperature().unwrap();
            println!("Object temperature: {}ÂșC", temp);
            ...
        }
    temp is an f32
    rahix
    @rahix:matrix.org
    [m]
    float support is pretty broken still, so it is probably just a miscompilation :/
    mjhouse
    @mjhouse:matrix.org
    [m]
    Speaking of which, I got f32/f64 working on the nano.
    instead of using fixed
    [profile.dev]
    ...
    lto = true
    overflow-checks = false
    ...
    turning off overflow checks lets you use them.
    rahix
    @rahix:matrix.org
    [m]
    interesting... but do they actually behave correctly? So far I've always encountered problems, where wrong results were produced
    mjhouse
    @mjhouse:matrix.org
    [m]
    Well, since I was having trouble printing the result to the serial output, I can't find out lol.
    As far as I could tell, yeah. But I didn't investigate too deeply.
    David
    @drmorr0:matrix.org
    [m]
    rahix: for the nano refactor, do you want it like it was before? (just as a feature of the arduino-uno board?) or do you want it as an entirely separate board in the boards/ directory?
    rahix
    @rahix:matrix.org
    [m]
    wait, you need to go to the next branch, it is all different now
    the boards folder is not used anymore at all
    1 reply
    there is an arduino-hal crate which has feature flags for each boards - you need to add arduino-nano there...
    and then we have examples/ with examples for each board. I am not sure if it makes sense to add separate examples for nano though, or if it is a better idea to just refer to the uno examples for them
    Take a look at Rahix/avr-hal#140 maybe as a rough guideline
    maybe I should just remove the legacy directories already to make it less confusing... sorry
    Carl Peto
    @carlos4242
    @rahix:matrix.org ... good call on the linker reverse trace
    @rahix:matrix.org ... good call on the linker reverse trace
    my problem fixed itself somehow... the link went back down from 38k (does not fit on atmega328p) to 8k (a bit fat but will fit)
    Also my link somehow got back down to 8k after some random rearranging. Swift is weird. They clearly aren't serious about keeping cruft out.
    I bookmarked it!
    I bookmarked it!
    David
    @drmorr0:matrix.org
    [m]
    thanks
    rahix
    @rahix:matrix.org
    [m]
    i'll get rid of it to make it less confusing!
    David
    @drmorr0:matrix.org
    [m]
    rahix: I guess I still have the same question just in a different form; the only (?) difference between the uno and the nano is the extra ADC pins, and it looks like that support is already there? at least it's present in the arduino-uno examples
    so do we really need to do anything for nano support? or is it basically just already done?
    David
    @drmorr0:matrix.org
    [m]
    I just flashed the uno-adc.rs example to my Nano and it appears to be working fine
    rahix
    @rahix:matrix.org
    [m]
    sorry for only responding now David :/ I took another look, you're right I must've copied that from the old arduino-uno crate with its nano support. I should have taken a closer look before sending you off with this! Now, I think the following would be a good plan:
    1. Add the arduino-nano feature flag to arduino-hal.
    2. Make the ADC6 and ADC7 pins only available for nano, not for uno. I think we should hide them so people don't accidentally use them on a board where it is not supported.
    3. Add an example crate for arduino-uno with just a blink and ADC example. I think for the rest we should just refer people to Arduino Uno, but it would be nice to a) have a blink example which you can just cargo run with zero setup, and b) show how the additional ADC pins can be used.
    What do you think?
    David
    @drmorr0:matrix.org
    [m]
    Yep, sounds good to me!
    Carl Peto
    @carlos4242
    I'm getting warnings that the atmega4809 is not a supported processor for llvm?
    Carls-MacBook-Pro:src carlpeto$ "/Applications/Swift For Arduino.app/Contents/XPCServices/S4ABuildEngine.xpc/Contents/Resources/llvm-avr/llc" -O3 -march=avr -mcpu=atmega4809 -filetype=obj -function-sections -o ../build/atmega4809/register_PORTE.DIR.swft.o ../build/atmega4809/register_PORTE.DIR.swft.ll
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    'atmega4809' is not a recognized processor for this target (ignoring processor)
    Carls-MacBook-Pro:src carlpeto$ "/Applications/Swift For Arduino.app/Contents/XPCServices/S4ABuildEngine.xpc/Contents/Resources/llvm-avr/llc" -O3 -march=avr -mcpu=atxmega3 -filetype=obj -function-sections -o ../build/atmega4809/register_PORTE.DIR.swft.o ../build/atmega4809/register_PORTE.DIR.swft.ll
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    'atxmega3' is not a recognized processor for this target (ignoring processor)
    rahix
    @rahix:matrix.org
    [m]
    you probably still need to set avrxmega3 IIRC