Coder Social home page Coder Social logo

uf2conv-rs's Introduction

uf2conv

Adds a uf2 header Microsofts HID Flashing Format (UF2) for copying over to UF2 bootloader mass storage devices. UF2 is factory programmed extensively by Microsoft MakeCode and Adafruit hardware.

Install

cargo install uf2conv

Usage

 $ uf2conv
error: The following required arguments were not provided:
    <INPUT>

USAGE:
    uf2conv <INPUT> --base <base> --family <family> --output <output>

For more information try --help

Base usage you'll want to give the --base memory address for your chip. This is where the code starts after the bootloader. In the case of embedded rust, thats found in your memory.x where you'll find FLASH (rx) : ORIGIN = 0x00000000+0x4000 or FLASH (rx) : ORIGIN = 0x00000000 + 16K Where 16K in bytes is 16384 decimal or 0x4000 hex base.

$ uf2conv pygamer_blinky_basic.bin --base 0x4000 --output pygamer_blinky_basic.uf2

And you can copy that uf2 file to your embedded device's drive that appears when you enter bootloader mode.

Rust: How to get a bin file

Use cargo-binutils which replaces the cargo build command to find and convert elf files into binary.

Install the dependencies

$ rustup component add llvm-tools-preview
$ cargo install uf2conv cargo-binutils

Then in your embedded project, say PyGamer

$ cargo objcopy --example blinky_basic --features unproven --release -- -O binary pygamer_blinky_basic.bin
$ uf2conv pygamer_blinky_basic.bin --base 0x4000 --output pygamer_blinky_basic.uf2

uf2conv-rs's People

Contributors

atul9 avatar jacobrosenthal avatar sajattack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

uf2conv-rs's Issues

uf2 crate name

Damn, you got the uf2 crate name on me.

so my uf2 has a binary and a library.
https://github.com/jacobrosenthal/uf2-rs

My binary does flashing, verify, etc. I think convert would work well as a subcommand there as well so Im hoping to bring your lib in there. But I also think I think theres a good reason to have your converter not depend on my usb dependencies so I think it should be available separate as it is now.

it would be good to actually make a cargo-conv type crate that can do uf2 and dfu conversions, like cargo conv --examples ferris_img --release -o ./Volumes/Pygamer/ferris_img.uf2 or something

Can you think of a name I should use, or would you be willing to give up uf2? and take like uf2-conv?

help understanding relationship between memory.x and base offset

Hi, I was told that for my particular bootloader, I should set -b to 0x26000, which accounts for the adafruit bootloader + the proprietary Bluetooth stack that the nrf52840 uses.

Should I set memory.x to 0x26000? What exactly is the relationship between memory.x and the base offset?

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.