forked from hannobraun/embedded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload
executable file
·27 lines (20 loc) · 809 Bytes
/
upload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
# ATTENTION:
# Before calling this script, the Arduino needs to be erased. Until we figure
# out how to do that automatically, doing it manually is a feasible workaround.
# Just make sure to press the tiny "ERASE" button on the Arduino Due before
# uploading and everything should work.
# You need to set the path of the microcontroller's device file here. The
# details depend on your system, but if you're on Linux, it should look
# something like the following default.
DEVICE=/dev/ttyACM0
# Please don't modify anything from here on, unless you know what you're doing.
mkdir -p output
./compile &&
arm-none-eabi-objcopy \
-O binary \
blink/target/target/release/blink \
output/blink.bin &&
(
cd uploader
cargo run -- $DEVICE upload-file ../output/blink.bin)