Comments (13)
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.
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.
I ran my first test of UF2 and it was a success.
from atsamd.
Yeah, bobbin wouldn't need BOSSA.
from atsamd.
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.
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.
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.
@wez I spoke with @tannewt and he said UF2 is bootloader only. There is no firmware side as you say.
from atsamd.
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:
- enumerate and discover the mounted mass storage devices that are ready to accept a UF2 blob
- convert a firmware into a UF2 blob (you've already done this bit!)
- 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.
Could we write something with the existing USB Serial implementation that accepts a command to jump to bootloader?
from atsamd.
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.
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.
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)
- How can I use usb function on 0.15.0 or higher HOT 3
- `Spi` implementation relies on fragile timing HOT 4
- Add support for SAMC2x ? HOT 11
- Correct alternate for USB pins on some M4 BSPs? HOT 4
- `hal::sercom::uart::Config` could potentially check for the correct sercom clock HOT 2
- Allow a way to get >1 `impl Delay` type HOT 8
- pybadge support HOT 2
- How to keep the device in bootloader mode? HOT 3
- atsamd21e18a I2C HOT 6
- Unable to use cargo flash in the feather_m0 repo HOT 2
- Wio Terminal, eRPC communication, USART Overflow
- Incorrect values in SVD files HOT 3
- changing manufacturer in the UsbDeviceBuilder HOT 3
- Issue Building on MAC OS - LLVM ERROR HOT 2
- Mutually incompatible BSP features lead to testing difficulties
- "Read-While-Write" EEPROM emulation for ATSAMD21 micros? HOT 1
- ATSAME53N20A ADC question HOT 10
- Allow drivers to be used without clock configuration HOT 5
- Program gets stuck on UART initialization when using SERCOM0 on PA08 and PA09 HOT 1
- Is USB device working with Rtic on atsamE54 ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atsamd.