Adds a uf2 header Microsofts HID Flashing Format (UF2) for copying over to UF2 bootloader mass storage devices

Overview

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
You might also like...
This is a 100% Rust bootloader for the nRF9160 microcontroller written for Dutch IoT Solutions

nRF9160 Bootloader for Dutch IoT Solutions This is a 100% Rust bootloader for the nRF9160 microcontroller written for Dutch IoT Solutions. Currently,

For something between the likes of a toy bootloader or tiny kernel and Arch Linux.

For something between the likes of a toy bootloader or tiny kernel and Arch Linux.

A Rust crate for automatically generating C header files from Rust source file.

Please be aware that this crate is no longer actively maintained, please look into the much more feature rich cbindgen instead. rusty-cheddar rusty-ch

A single-header ANSI C immediate mode cross-platform GUI library
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

Work-in-progress Rust application that converts C++ header-only libraries to single self-contained headers.

unosolo Work-in-progress Rust application that converts C++ header-only libraries to single self-contained headers. Disclaimer This is my first Rust p

A new shellcode injection technique. Given as C++ header, standalone Rust program or library.
A new shellcode injection technique. Given as C++ header, standalone Rust program or library.

FunctionStomping Description This is a brand-new technique for shellcode injection to evade AVs and EDRs. This technique is inspired by Module Stompin

Network Block Storage server, written in Rust. Supports pluggable and chainable underlying storage

nbd-rs Disclaimer DO NEVER USE THIS FOR PRODUCTION Do not use this for any data that you cannot afford to lose any moment. Expect data loss, corruptio

Plugin for macro-, mini-quad (quads) to save data in simple local storage using Web Storage API in WASM and local file on a native platforms.

quad-storage This is the crate to save data in persistent local storage in miniquad/macroquad environment. In WASM the data persists even if tab or br

UnlimCloud provides unlimited cloud storage for your files, utilizing Telegram as the storage solution
UnlimCloud provides unlimited cloud storage for your files, utilizing Telegram as the storage solution

UnlimCloud provides unlimited cloud storage for your files, utilizing Telegram as the storage solution. Simply log in using your Telegram ID, and you are good to go.

notiflux - subscribe over WebSockets, publish over REST

notiflux notiflux is a pub/sub server where clients subscribe over a WebSocket and messages are broadcast over a POST request How does it work? Client

Single File Assets is a file storage format for images

SFA (Rust) Single File Assets is a file storage format for images. The packed images are not guaranteed to be of same format because the format while

Databento Binary Encoding (DBZ) - Fast message encoding and storage format for market data

dbz A library (dbz-lib) and CLI tool (dbz-cli) for working with Databento Binary Encoding (DBZ) files. Python bindings for dbz-lib are provided in the

An apocalypse-resistant data storage format for the truly paranoid.

Carbonado An apocalypse-resistant data storage format for the truly paranoid. Designed to keep encrypted, durable, compressed, provably replicated con

A save editor for Mass Effect Trilogy
A save editor for Mass Effect Trilogy

Trilogy Save Editor A save editor for Mass Effect Trilogy A bit late but just in time ! This software is similar to Gibbed's save editors (and forks)

1 library and 2 binary crates to run SSH/SCP commands on a
1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel

massh 1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel. The binary crates are CLI and GUI "frontends" for the li

CLI tool for mass tweet deletion

Damae Damae is a simple CLI tool for mass-deleting tweets. Its name comes from the Latin phrase "damnatio memoriae", which means "condemnation of memo

A simple mass search & replace tool

sr A simple mass search & replace tool. To install: $ brew install sr Usage Use the -s pattern flag to search for any regex in your entire codebase

Tool for mass import of hosts into Zabbix (and other API functions)

zabbix-tools A CLI tool for interacting with Zabbix API built in Rust. Designed for Zabbix 6.0. Functions added to test API and add hosts manually or

Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes!
Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes!

Excavation Site Alpha Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes! Drag blocks off the conveyor b

Comments
  • help understanding relationship between memory.x and base offset

    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?

    opened by TheButlah 2
  • uf2 crate name

    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?

    opened by jacobrosenthal 2
Owner
Paul Sajna
I program my home computer / Beam myself into the future
Paul Sajna
Experimental kernel for embedded devices written in Rust

bkernel is an experimental kernel for embedded devices written in Rust. I'm mostly trying out Rust now to see how it applies to kernel development. Pr

Alexey Shmalko 84 Dec 13, 2022
The official kernel for Popcorn OS, and operating system designed for handheld devices.

About Popkern is the kernel for Popcorn OS, an operating system designed for handheld devices. As such, the kernel is (to be) optimised at all levels

Team Scena 3 Sep 19, 2021
Tool and framework for securely reading untrusted USB mass storage devices.

usbsas is a free and open source (GPLv3) tool and framework for securely reading untrusted USB mass storage devices. Description Following the concept

CEA IT Security 250 Aug 16, 2023
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
The CBNF neural network header format.

cbnf The CBNF neural network header format. What is CBNF? CBNF is a neural network header format for use with efficiently updatable neural networks fo

Cosmo Bobak 2 Jul 11, 2023
cargo extension for flashing embedded rust programs via dfu based on jacobrosenthals cargo-hf2

cargo-dfu This crate provides a cargo subcommand to flash ELF binaries via dfu Most STM chips will probably work with this, although you might need to

Roman Kretschmer 0 Feb 6, 2022
An unofficial Logitech HID++>2.0 driver based on the original logiops by PixlOne

ruhroh An unofficial Logitech HID++>2.0 driver based on the original logiops by PixlOne Configuration Refer to the docs for details. The default locat

Matthew Wilks 3 Dec 11, 2022
ICSP (2-wire) dongle for flashing PIC32 microcontrollers

Pic32Probe This is an ICSP (2-wire) dongle for flashing PIC32 microcontrollers implemented on an Raspberry Pi RP2040 microcontroller. Use a simple RP2

Stephan 3 Sep 26, 2022
A Rust crate for parsing HID Report Descriptors.

Project Mu HID Crate Repository This repository contains a library crate that provides parsing services for HID Report Descriptors. This repository is

Microsoft 3 Sep 25, 2023
rustBoot is a standalone bootloader, written entirely in Rust

rustBoot is a standalone bootloader, written entirely in Rust, designed to run on anything from a microcontroller to a system on chip. It can be used to boot into bare-metal firmware or Linux.

null 78 Dec 28, 2022