Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit b484f79

Browse files
committed
MAKER-431 add clupload into tools
Added and renamed clupload for both Edison and Galileo
1 parent 45ce281 commit b484f79

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

clupload/cluploadEdison_osx.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/sh
2+
#
3+
# clupload script to invoke lsz
4+
# Copyright (C) 2014 Intel Corporation
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
# Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
echo "starting download script"
22+
echo "Args to shell:" $*
23+
#
24+
# ARG 1: Path to lsz executable.
25+
# ARG 2: Elf File to download
26+
# ARG 3: TTY port to use.
27+
#
28+
#path may contain \ need to change all to /
29+
path_to_exe=$1
30+
fixed_path=${path_to_exe//\\/\/}
31+
#
32+
tty_port_id=$3
33+
echo "Serial Port PORT" $com_port_id "(note: should be /dev/cu.xxxxxx for OSX)"
34+
echo "Using tty Port" $tty_port_id
35+
#
36+
echo "Sending Command String to move to download if not already in download mode"
37+
echo "~sketch downloadEdison" > $tty_port_id
38+
#Give the host time to stop the process and wait for download
39+
sleep 1
40+
#
41+
#Move the existing sketch on target.
42+
echo "Deleting existing sketch on target"
43+
"$fixed_path/lsz" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" < $tty_port_id > $tty_port_id
44+
#"$fixed_path/lsz.exe" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" < $tty_port_id > $tty_port 1>&0
45+
#
46+
# Execute the target download command
47+
#
48+
#Download the file.
49+
host_file_name=$2
50+
"$fixed_path/lsz" --escape --binary --overwrite $host_file_name < $tty_port_id > $tty_port_id
51+
#
52+
#mv the downloaded file to /sketch/sketch.elf
53+
target_download_name="${host_file_name##*/}"
54+
echo "Moving downloaded file to /sketch/sketch.elf on target"
55+
"$fixed_path/lsz" --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" < $tty_port_id > $tty_port_id
56+
#
57+
#

clupload/cluploadGalileo_osx.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/sh
2+
3+
# clupload script to invoke lsz
4+
# Copyright (C) 2014 Intel Corporation
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
# Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
echo "starting download script"
21+
echo "Args to shell:" $*
22+
#
23+
# ARG 1: Path to lsz executable.
24+
# ARG 2: Elf File to download
25+
# ARG 3: TTY port to use.
26+
#
27+
#path may contain \ need to change all to /
28+
path_to_exe=$1
29+
fixed_path=${path_to_exe//\\/\/}
30+
#
31+
tty_port_id=$3
32+
echo "Serial Port PORT" $com_port_id "(note: should be /dev/cu.xxxxxx for OSX)"
33+
echo "Using tty Port" $tty_port_id
34+
#
35+
echo "Sending Command String to move to download if not already in download mode"
36+
echo "~sketch downloadGalileo" > $tty_port_id
37+
#Give the host time to stop the process and wait for download
38+
sleep 1
39+
#
40+
#Move the existing sketch on target.
41+
echo "Deleting existing sketch on target"
42+
"$fixed_path/lsz" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" < $tty_port_id > $tty_port_id
43+
#"$fixed_path/lsz.exe" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" < $tty_port_id > $tty_port 1>&0
44+
#
45+
# Execute the target download command
46+
#
47+
#Download the file.
48+
host_file_name=$2
49+
"$fixed_path/lsz" --escape --binary --overwrite $host_file_name < $tty_port_id > $tty_port_id
50+
#
51+
#mv the downloaded file to /sketch/sketch.elf
52+
target_download_name="${host_file_name##*/}"
53+
echo "Moving downloaded file to /sketch/sketch.elf on target"
54+
"$fixed_path/lsz" --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" < $tty_port_id > $tty_port_id
55+
#
56+
#

0 commit comments

Comments
 (0)