Giter Club home page Giter Club logo

Comments (13)

jcsoo avatar jcsoo commented on June 2, 2024 3

Hi, I'm the author of bobbin-cli. I've been away from embedded for a little while, but UF2 support has been on my TODO list since I first ran across the specification. Is there still interest in this?

from atsamd.

jacobrosenthal avatar jacobrosenthal commented on June 2, 2024 2

I implemented uf2 over hidapi over here
https://github.com/jacobrosenthal/uf2-rs

and cargo-uf2 here
https://github.com/jacobrosenthal/cargo-uf2

and am build and uploading with just
cargo uf2 --release --example timer

havent released anything yet between picking names, waiting on deps, and seeing if yaketti wants it inside of cargo-flash instead/as well

from atsamd.

sajattack avatar sajattack commented on June 2, 2024 1

I ran my first test of UF2 and it was a success.
blinky

from atsamd.

sajattack avatar sajattack commented on June 2, 2024 1

Yeah, bobbin wouldn't need BOSSA.

from atsamd.

jacobrosenthal avatar jacobrosenthal commented on June 2, 2024 1

Heads up Ive decided to rename my uf2 to hf2, as technically that's what the hid over flash protocol is actually called https://github.com/jacobrosenthal/hf2-rs

Its all published on crates.io finally, and has been pretty pretty rock solid for me over the past month. A lot of the adafruit bsps we have here ship the uf2 bootloader stock so once some of you check it out I think it would be a worth addition to the examples

Ive got a cargo subcommand available atcargo install cargo-hf2 and then just cargo hf2 --release --example timer to program an example from the boards here

or a hf2 binary cargo install hf2-cli if youve got a bin and don't want to use cargohf2 flash -f neopixel_rainbow.bin -a 0x4000

from atsamd.

wez avatar wez commented on June 2, 2024

Could it feasibly be integrated into bobbin? https://github.com/bobbin-rs/bobbin-cli/
That way you could do bobbin load to have it build, convert and copy the firmware onto the mass storage device, or bobbin run to do the same and then attach to the serial console.

One challenge with UF2 at the moment is that once the bootloader is done, the mass storage device goes away. Some work is needed in the broader rust ecosystem to get USB support to a point where the firmware side of UF2 could be done in rust also. Until we get to that point, the load portion of the flow will need to prompt the user to press the reset button to get into the bootloader.

from atsamd.

sajattack avatar sajattack commented on June 2, 2024

It looks like that would require changes to bobbin. It would be easier to use make or something that lets you run arbitrary shell commands.

from atsamd.

sajattack avatar sajattack commented on June 2, 2024

@wez I spoke with @tannewt and he said UF2 is bootloader only. There is no firmware side as you say.

from atsamd.

wez avatar wez commented on June 2, 2024

re: firmware, I'm envisioning a really easy future world where you can initiate flashing completely from the host system. I use this for example in some keyboard firmware where I press some hotkeys to jump into the bootloader ready for flashing, rather than hunting around for a way to press the little reset button.

I think something similar would be nice for UF2, but it's really more about triggering the bootloader than it is about anything else.

What I think would be nice to have is:

  • A rust library wrapped in a little tool that can:
    1. enumerate and discover the mounted mass storage devices that are ready to accept a UF2 blob
    2. convert a firmware into a UF2 blob (you've already done this bit!)
    3. copy the blob into the device, taking care to avoid ambiguous copies (eg: if there happen to be multiple devices ready for this, bail out and ask the user to select which one)
  • For boards that have UF2 bootloaders, set up the cargo config to use this flashing tool
  • Integrate the above library into bobbin-cli (it's possible that this will cut down on some of the work above)

from atsamd.

sajattack avatar sajattack commented on June 2, 2024

Could we write something with the existing USB Serial implementation that accepts a command to jump to bootloader?

from atsamd.

wez avatar wez commented on June 2, 2024

The arduino firmwares typically look for an open/close of the USB CDC device as a hint to jump into the bootloader (you'll see various scripts and things use stty to trigger this condition). The usb_device stuff that we have today could be made to do this, but if you look at the example there's quite a lot of code that needs to live somewhere and be made configurable enough and driven by the end user app that this will need some thought on how to make it integrate nicely.

from atsamd.

fionawhim avatar fionawhim commented on June 2, 2024

What would the win be for UF2 rather than BOSSA? Would bobbin work without needing to separately install BOSSA?

I agree that the nicest thing for convenience would be support for the CDC open/close trick (which I think BOSSA supports via the --arduino-erase flag).

from atsamd.

jcsoo avatar jcsoo commented on June 2, 2024

I don't know all of the details of the CDC open/close trick, but that seems like it would be good for devices that already are presenting a serial interface. For those that aren't, there might be some easier ways of requesting reboot to bootloader. This could be a custom vendor-class endpoint that just waits for a magic packet, but maybe there are simpler options that don't require an endpoint: a specific control message, alternate setting, or device configuration?

from atsamd.

Related Issues (20)

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.