OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-fw/] [configure-fpga.sh] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 nussgipfel
#!/bin/sh
2
 
3
echo "*idn?" > /dev/usbtmc1
4
 
5
BOARD=$(cat /dev/usbtmc1)
6
 
7
if [ "$?" = 0 ];
8
then
9
    kdialog --caption="GECKO3COM" \
10
        --msgbox "Welcome to the GECKO3COM configuration tool\n Ready to configure board:\n$BOARD" \
11
        --title "Ready"
12
 
13
    FILE=$(kdialog --getopenfilename :label1 "*.bit" --caption "GECKO3COM" \
14
        --title "Select FPGA *bit file to download")
15
    if [ "$?" = 0 ];
16
    then
17
 
18
        dcopRef=$(kdialog --progressbar "Configuring FPGA..."  --caption="GECKO3COM" 10)
19
 
20
        echo -n "fpga:conf " > /tmp/fpga_conf.dat
21
        cat "$FILE" >> /tmp/fpga_conf.dat
22
 
23
        dcop $dcopRef setProgress 2
24
 
25
        cp /tmp/fpga_conf.dat /dev/usbtmc1 | dcop $dcopRef setProgress 8
26
 
27
        dcop $dcopRef close
28
 
29
        if [ "$?" = 0 ];
30
        then
31
 
32
            echo "fpga:done?" > /dev/usbtmc1
33
            RESULT=$(cat /dev/usbtmc1)
34
 
35
            if [ "$?" = 0 ] && [ "$RESULT" = 1 ];
36
            then
37
                kdialog --msgbox "Successfully configured!" --title "Finished" --caption="GECKO3COM";
38
            else
39
                kdialog --error "FPGA is not done.\nConfiguration failed!" --caption="GECKO3COM"
40
 
41
                usbtmc_ioctl 1 clear
42
                echo "*idn?" > /dev/usbtmc1;
43
            fi;
44
        else
45
            kdialog --error "Failed to configure FPGA" --caption="GECKO3COM"
46
            usbtmc_ioctl 1 clear
47
            echo "*idn?" > /dev/usbtmc1;
48
        fi
49
 
50
        rm /tmp/fpga_conf.dat;
51
    fi;
52
 
53
else
54
    kdialog --sorry "No FPGA board found!" --caption="GECKO3COM"
55
    usbtmc_ioctl 1 clear
56
    echo "*idn?" > /dev/usbtmc1;
57
fi;
58
 
59
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.