Skip to content

Update 004-flashing-a-crate-to-chip.md file #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/004-flashing-a-crate-to-chip.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# 4. Flashing a crate to a real AVR chip


The [AVRDUDE](https://www.nongnu.org/avrdude/) utility is recommended for flashing the final ELF file to a physical AVR microcontroller.

Flashing a Rust ELF file is no different to flashing a regular AVR-GCC C/C++ generated ELF file.
The [AVRDUDE](https://www.nongnu.org/avrdude/) utility is recommended for flashing the final ELF file to a physical AVR microcontroller.
Flashing a Rust ELF file is no different to flashing a regular AVR-GCC C/C++ generated ELF file. You can learn more about the AVRDUDE project from either of
the following:

* [AVRDUDE Project Homepage](https://www.nongnu.org/avrdude/)
* [LadyADA AVRDUDE Tutorial](http://ladyada.net/learn/avr/avrdude.html)

## Arduino Uno

Connect your Arduino Uno to your computer, and use `avrdude` to flash your crate. The example below uses the output from [the `blink` example](./003.2-example-building-blink.md).
Connect your Arduino Uno to your computer, and use `avrdude` to flash your crate. The example below uses the output from [the `blink` example](./003.3-example-building-blink.md):

```bash
avrdude -patmega328p -carduino -P[PORT] -b115200 -D -Uflash:w:target/avr-atmega328p/release/blink.elf:e
```

where
where:
* `-patmega328p` is the AVR part number
* `-carduino` is the programmer
* `-P[PORT]` is the serial port of your connected Arduino
* On Linux & macOS, replace `[PORT]` with your Arduino's serial port (like `/dev/ttyUSB0`)
* `-b115200` is the baud rate
* `-D` disables flash auto-erase
* `-Uflash:w:target/avr-atmega328p/release/blink.elf:e` writes the `blink.elf` program to the Arduino's flash memory
* `-Uflash:w:target/avr-atmega328p/release/blink.elf:e` writes the `blink.elf` program to the Arduino's flash memory.

For more debugging information, run `avrdude` with one or more `-v` flags.

Expand Down