summaryrefslogtreecommitdiff
path: root/openpicc/at91flash
blob: 9733ddbc1a396f6264c84415e5c0e32e397f1fb5 (plain)
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
#!/bin/bash
# (C) Milosch Meriac <meriac@bitmanufaktur.de> 2006

UART='/dev/ttyUSB1'
SAM7='/usr/local/bin/sam7'

if [[ -a $1 ]]; then

    echo "1. please unplug the USB cable and insert the SAM-BA jumper (Pin 1+2)"
    echo "2. attach the USB cable"
    echo "3. wait ten seconds"
    echo "4. unplug the USB cable"
    echo "5. remove the SAM-BA jumper"
    echo "6. attach the USB cable"
    echo "7. wait several seconds to allow the device to be detected by Linux"
    echo "8. press [ENTER] to start flashing"    
    read
    echo -e "9. flashing '$1'...\n"
    $SAM7 -l $UART << ENDOFMYTEXT
set_clock
unlock_regions
flash $1
ENDOFMYTEXT
    echo '10. done!'
else
    echo "can't open flash image file '$1'"
fi
personal git repositories of Harald Welte. Your mileage may vary