{"id":31601741,"url":"https://github.com/bjorntheprogrammer/elf2flash","last_synced_at":"2025-10-06T07:59:20.785Z","repository":{"id":316295737,"uuid":"1062797124","full_name":"BjornTheProgrammer/elf2flash","owner":"BjornTheProgrammer","description":"A tool to help flash elf2 files to the pico","archived":false,"fork":false,"pushed_at":"2025-09-30T23:47:26.000Z","size":149,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-01T01:18:53.644Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BjornTheProgrammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T18:35:44.000Z","updated_at":"2025-10-01T00:57:13.000Z","dependencies_parsed_at":"2025-09-23T20:30:18.683Z","dependency_job_id":"9fcdb986-db2a-4c3e-9bff-6e46991d472f","html_url":"https://github.com/BjornTheProgrammer/elf2flash","commit_stats":null,"previous_names":["bjorntheprogrammer/elf2flash"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/BjornTheProgrammer/elf2flash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornTheProgrammer%2Felf2flash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornTheProgrammer%2Felf2flash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornTheProgrammer%2Felf2flash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornTheProgrammer%2Felf2flash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BjornTheProgrammer","download_url":"https://codeload.github.com/BjornTheProgrammer/elf2flash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornTheProgrammer%2Felf2flash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278577931,"owners_count":26009701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-06T07:59:14.495Z","updated_at":"2025-10-06T07:59:20.779Z","avatar_url":"https://github.com/BjornTheProgrammer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elf2flash\n\nA tool for converting ELF binaries into UF2 format and flashing them to a microcontroller (RP2040, RP2350, CircuitPlaygroundBluefruit, etc.) and other supported boards.\n\n```bash\ncargo install elf2flash\n```\n\n## Options\n\n```\nUsage: elf2flash [OPTIONS] [COMMAND]\n\nCommands:\n  convert  Convert ELF to UF2 file on disk\n  deploy   Deploy ELF directly to a connected board\n  help     Print this message or the help of the given subcommand(s)\n\nOptions:\n  -v, --verbose \u003cVERBOSE\u003e  Set the logging verbosity [default: info] [possible values: off, error, warn, info, debug, trace]\n  -h, --help               Print help\n  -V, --version            Print version\n```\n\n### Deploying\n\n```\nUsage: elf2flash deploy [OPTIONS] \u003cINPUT\u003e\n\nArguments:\n  \u003cINPUT\u003e  Input ELF file\n\nOptions:\n  -b, --board \u003cBOARD\u003e\n          Same options as convert…\n  -v, --verbose \u003cVERBOSE\u003e\n          Set the logging verbosity [default: info] [possible values: off, error, warn, info, debug, trace]\n  -f, --family \u003cFAMILY\u003e\n          Override family ID\n  -e, --flash-sector-erase-size \u003cFLASH_SECTOR_ERASE_SIZE\u003e\n          Flash erase sector size\n  -p, --page-size \u003cPAGE_SIZE\u003e\n          Page size\n  -s, --serial\n          Connect to serial after deploy\n  -t, --term\n          Send termination message on Ctrl+C\n  -h, --help\n          Print help\n```\n\n### Deploy for any project\n```\nelf2flash deploy --board rp2040 firmware.elf\n```\n\nFamily IDs can be referenced from [uf2families.json](https://github.com/microsoft/uf2/blob/master/utils/uf2families.json).\nYou can pass values in decimal (`12345`), hexadecimal (`0xe48bff59`), or binary (`0b1010...`) formats.\n\n## Usage\n\nTo make your Rust project automatically flash the microcontroller whenever you run `cargo run`, add this to your `.cargo/config.toml`.\n\n```toml\n[target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))']\nrunner = \"elf2flash deploy -t -s\"\n\n[build]\n# target = \"thumbv6m-none-eabi\" # Pico 1 / Cortex-M0/M0+\ntarget = \"thumbv8m.main-none-eabihf\" # Pico 2 / Cortex-M23/M33\n\n[env]\nDEFMT_LOG = \"debug\"\n```\n\nIf multiple boards are connected, `elf2flash` will detect them and attempt to flash each valid UF2 partition automatically.\nYou can also force a specific board using `--board rp2040` or `--board rp2350`.\n\n## Adding support for a board\n\nIf you want to flash to an unsupported uf2 board, just add in the flags `--family`, `--flash-sector-erase-size`, and `--page-size`, these have resonable defaults, so if you are unsure what the value is, just don't provide it, and attempt running.\n\nIf you wish to add a new default supported board, open a PR or an issue with the board you wish to support.\n\nIf you open a PR just add a new board under `./crates/elf2flash-core/src/boards/`.\n\nHere is an example for supporting the circuit_playground_bluefruit board.\n\n```rust\nuse crate::boards::{BoardInfo, UsbDevice};\n\n#[derive(Debug, Default, Clone)]\npub struct CircuitPlaygroundBluefruit;\n\nimpl BoardInfo for CircuitPlaygroundBluefruit {\n    fn is_device_board(\u0026self, device: \u0026UsbDevice) -\u003e bool {\n        // https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/boards/circuitplayground_nrf52840/board.h\n        if device.vendor_id != 0x239A {\n            return false;\n        }\n        match device.product_id {\n            0x0045 =\u003e true,\n            _ =\u003e false,\n        }\n    }\n\n    fn family_id(\u0026self) -\u003e u32 {\n        0xada52840\n    }\n\n    fn board_name(\u0026self) -\u003e String {\n        \"circuit_playground_bluefruit\".to_string()\n    }\n}\n```\n\nIf adding the flags doesn't work, please create an issue for your board.\n\n## Why this project instead of elf2uf2?\n\nThis project:\n\n* Fixes several issues in [`elf2uf2-rs`](https://github.com/JoNil/elf2uf2-rs)\n  ([#36](https://github.com/JoNil/elf2uf2-rs/pull/36), [#38](https://github.com/JoNil/elf2uf2-rs/issues/38), [#40](https://github.com/JoNil/elf2uf2-rs/issues/40), [#41](https://github.com/JoNil/elf2uf2-rs/pull/41), [#42](https://github.com/JoNil/elf2uf2-rs/pull/42))\n* Provides a reusable library (`elf2flash-core`) for programmatic use\n* Supports multiple families and explicit board selection\n* Adds progress reporting, automatic board/partition detection, and optional serial logging after deploy\n\n## Credits\n\nThanks to [JoNil](https://github.com/JoNil) for the excellent [`elf2uf2-rs`](https://github.com/JoNil/elf2uf2-rs) project, which this builds upon and extends.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjorntheprogrammer%2Felf2flash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjorntheprogrammer%2Felf2flash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjorntheprogrammer%2Felf2flash/lists"}