{"id":26851340,"url":"https://github.com/lights0123/async-avr","last_synced_at":"2025-07-15T13:11:31.769Z","repository":{"id":44995981,"uuid":"282458826","full_name":"lights0123/async-avr","owner":"lights0123","description":"async/await for AVR with Rust","archived":false,"fork":false,"pushed_at":"2022-01-14T20:56:12.000Z","size":56,"stargazers_count":35,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-05T16:36:58.885Z","etag":null,"topics":["arduino","async-avr","async-await","avr","rust","rust-async","rust-avr"],"latest_commit_sha":null,"homepage":"https://lights0123.com/blog/2020/07/25/async-await-for-avr-with-rust/","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/lights0123.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}},"created_at":"2020-07-25T14:21:02.000Z","updated_at":"2025-02-01T21:33:00.000Z","dependencies_parsed_at":"2022-09-24T21:50:44.950Z","dependency_job_id":null,"html_url":"https://github.com/lights0123/async-avr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lights0123/async-avr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lights0123%2Fasync-avr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lights0123%2Fasync-avr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lights0123%2Fasync-avr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lights0123%2Fasync-avr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lights0123","download_url":"https://codeload.github.com/lights0123/async-avr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lights0123%2Fasync-avr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265437620,"owners_count":23765124,"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":["arduino","async-avr","async-await","avr","rust","rust-async","rust-avr"],"created_at":"2025-03-30T22:20:17.977Z","updated_at":"2025-07-15T13:11:31.728Z","avatar_url":"https://github.com/lights0123.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async-avr\n\n## Required packages\n\n**Arch linux**\n\n```bash\nsudo pacman -S avr-gcc avr-libc avrdude python-pip\n```\n\n**Ubuntu**\n\n```bash\nsudo apt-get install binutils gcc-avr avr-libc avrdude python3-pip\n```\n\n**macOS**\n\n```bash\nbrew tap osx-cross/avr\n# removal needed before upgrading\nbrew remove avr-gcc avr-binutils avr-libc\n# avr-libc is now included in avr-gcc\nbrew install avr-gcc avr-binutils\nbrew install avrdude\n```\n\nAlternatively, on a different OS or if you don't want to install system packages, you may use the\nbinaries included with the Arduino IDE. To do so, first find where Arduino preferences are located:\n\n- Windows Store App: `%HOME%\\Documents\\ArduinoData\\`\n- Windows: `%APPDATA%\\Arduino15\\`\n- macOS: `$HOME/Library/Arduino15/`\n- Linux: `~/.arduino15/`\n\nNow, append `packages/arduino/tools/avr-gcc/`, find the folder in that directory (e.g.\n`7.3.0-atmel3.6.1-arduino7` at the time of writing), and then finally add `/bin`. For example, on\nLinux, you may have `$HOME/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin`.\n\nOnce you have the above path, add it to your path. For example, on macOS or Linux, run\n`export PATH=\"$HOME/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin:${PATH}\"`.\n\n## Initial installation\n\n`async-avr` needs nightly rust, as of beginning 2021 a special release even see [Rahix/avr-hal#124](https://github.com/Rahix/avr-hal/issues/124)\n\ncreate a file called `rust-toolchain` with the contents:\n\n```toml\n[toolchain]\nchannel = \"nightly-2021-01-07\"\ncomponents = [\"rust-src\"]\n```\n\nthis file allows you to run all cargo commands with that nightly release automatically selected.\n\n## Compiling and Running\n\nWe can compile by running\n\n```bash\ncargo build --examples --release\n```\n\n**Note:** If you didn't create `rust-toolchain` this might work:\n\n```bash\ncargo +nightly build --examples --release\n```\n\nThen, to upload it to a device, run:\n\n```bash\navrdude -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:target/avr-atmega328p/release/examples/serial.elf:e\n```\n\nChange the upload path (`target/avr-atmega328p/release/examples/serial.elf`) to meet what you want\nto upload.\n\n### If you only have the Arduino IDE installed\n\nEnable \"Show verbose output during: upload\" in the Arduino IDE. Observe the build logs for an\n`avrdude` command—it should look something like:\n\n```bash\n/path/to/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/path/to/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/arduino_build_721874/Blink.ino.hex:i\n```\n\nCopy that command, but delete everything after `-Uflash:w:`. Then, without spaces, add the path to\nyour binary. This will typically be `target/avr-atmega328p/release/project_name.elf`, or\n`target/avr-atmega328p/release/examples/example_name.elf`. Finally, add `:e`. Your final command\nwill probably look something like:\n\n```bash\n/path/to/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/path/to/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:target/avr-atmega328p/release/example/serial.elf:e\n```\n\n\u003e ### What about converting to hex first?\n\u003e\n\u003e Arduino typically converts the compiled binary to raw hex, and many AVR-Rust projects have\n\u003e [followed that pattern][avr-objcopy]. However, there's generally no need to do that, as `avrdude`\n\u003e has the ability to upload ELF binaries directly.\n\n[avr-objcopy]:\n  https://github.com/Rahix/avr-hal/blob/bfc5dfe67107a68b4a673e54532354af126cb3ba/mkhex.sh#L32\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flights0123%2Fasync-avr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flights0123%2Fasync-avr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flights0123%2Fasync-avr/lists"}