{"id":17310548,"url":"https://github.com/kpcyrd/elf2nucleus","last_synced_at":"2025-09-06T04:36:27.333Z","repository":{"id":215546541,"uuid":"739204695","full_name":"kpcyrd/elf2nucleus","owner":"kpcyrd","description":"Integrate micronucleus into the cargo buildsystem, flash an AVR firmware from an elf file","archived":false,"fork":false,"pushed_at":"2024-01-05T03:01:36.000Z","size":56,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T03:12:45.630Z","etag":null,"topics":["attiny85","avr","rust","rust-embedded"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/elf2nucleus","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kpcyrd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-05T02:32:54.000Z","updated_at":"2025-03-26T06:23:07.000Z","dependencies_parsed_at":"2024-01-05T04:22:06.880Z","dependency_job_id":"a4a13157-218c-4149-b99a-c87dd3e815b2","html_url":"https://github.com/kpcyrd/elf2nucleus","commit_stats":null,"previous_names":["kpcyrd/elf2nucleus"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpcyrd%2Felf2nucleus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpcyrd%2Felf2nucleus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpcyrd%2Felf2nucleus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpcyrd%2Felf2nucleus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpcyrd","download_url":"https://codeload.github.com/kpcyrd/elf2nucleus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894937,"owners_count":21179152,"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","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":["attiny85","avr","rust","rust-embedded"],"created_at":"2024-10-15T12:37:36.462Z","updated_at":"2025-04-14T14:12:55.476Z","avatar_url":"https://github.com/kpcyrd.png","language":"Rust","readme":"# elf2nucleus\n\nIntegrate micronucleus into the cargo buildsystem, flash an AVR firmware from an elf file.\n\n```toml\n# ./.cargo/config.toml\n[target.'cfg(target_arch = \"avr\")']\n# Choose a default \"cargo run\" tool\nrunner = \"elf2nucleus\"\n```\n\nAdding this to your cargo config should then allow you to use the cargo-native **run** command for flashing, without further need for a Makefile:\n\n```sh\nRUSTC_BOOTSTRAP=1 cargo run --release\n```\n\nPlease note that elf2nucleus builds on top of [micronucleus](https://github.com/micronucleus/micronucleus) which needs to be installed too.\n\nThis project was inspired by [elf2uf2-rs](https://github.com/JoNil/elf2uf2-rs) for the rp2040.\n\nAlso shoutout to [@cyber-murmel](https://github.com/cyber-murmel) who motivated me to develop this and helped me with AVR development.\n\n[![](https://repology.org/badge/vertical-allrepos/elf2nucleus.svg)](https://repology.org/project/elf2nucleus/versions)\n\n## Building firmware with cargo\n\nTo build an AVR firmware repository it's often enough to run:\n\n```sh\nRUSTC_BOOTSTRAP=1 cargo build --release\n```\n\ncargo then compiles the firmware and puts it into an elf container file like this:\n\n```\ntarget/avr-attiny85/release/attiny85-hello-world.elf\n```\n\nFor this `.cargo/config.toml` needs to be configured correctly, an example repository can be found at [github.com/kpcyrd/attiny85-hello-world](https://github.com/kpcyrd/attiny85-hello-world).\n\n## Flashing with elf2nucleus\n\nTo invoke elf2nucleus without cargo, you can run it like this:\n\n```sh\nelf2nucleus ./attiny85-hello-world.elf\n```\n\nIf you don't want to flash with elf2nucleus and instead read the firmware from an elf file into a raw binary file you can specify an additional output file name:\n\n```sh\nelf2nucleus ./attiny85-hello-world.elf ./firmware.bin\nmicronucleus --type raw --run --no-ansi ./firmware.bin\n```\n\n## Using Rust with micronucleus directly\n\nAt the time of writing, it's not possible to configure micronucleus as \"cargo run\" tool, because micronucleus can't read from elf files.\n\nIf you want to avoid using elf2nucleus you can use `avr-objcopy` to prepare the firmware file yourself:\n\n```sh\navr-objcopy --output-target=ihex target/avr-attiny85/release/attiny85-hello-world.elf target/avr-attiny85/release/attiny85-hello-world.hex\nmicronucleus --timeout 60 --run --no-ansi target/avr-attiny85/release/attiny85-hello-world.hex\n```\n\n## License\n\n`GPL-3.0-or-later`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpcyrd%2Felf2nucleus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpcyrd%2Felf2nucleus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpcyrd%2Felf2nucleus/lists"}