openpcd/openpicc/at91flash @ master
1 |
#!/bin/bash
|
---|---|
2 |
# (C) Milosch Meriac <meriac@bitmanufaktur.de> 2006
|
3 |
|
4 |
UART='/dev/ttyUSB1' |
5 |
SAM7='/usr/local/bin/sam7' |
6 |
|
7 |
if [[ -a $1 ]]; then |
8 |
|
9 |
echo "1. please unplug the USB cable and insert the SAM-BA jumper (Pin 1+2)" |
10 |
echo "2. attach the USB cable" |
11 |
echo "3. wait ten seconds" |
12 |
echo "4. unplug the USB cable" |
13 |
echo "5. remove the SAM-BA jumper" |
14 |
echo "6. attach the USB cable" |
15 |
echo "7. wait several seconds to allow the device to be detected by Linux" |
16 |
echo "8. press [ENTER] to start flashing" |
17 |
read
|
18 |
echo -e "9. flashing '$1'...\n" |
19 |
$SAM7 -l $UART << ENDOFMYTEXT |
20 |
set_clock
|
21 |
unlock_regions
|
22 |
flash $1 |
23 |
ENDOFMYTEXT
|
24 |
echo '10. done!' |
25 |
else
|
26 |
echo "can't open flash image file '$1'" |
27 |
fi
|