Skip to content

Commit 9c01fa9

Browse files
committed
Update scripts to be aligned with Arduino_STM32 tools
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 20eed25 commit 9c01fa9

10 files changed

+43
-8
lines changed

Diff for: linux/45-maple.rules

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ATTRS{idProduct}=="1001", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev"
22
ATTRS{idProduct}=="1002", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev"
3-
ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"
4-
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"
3+
ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple", ENV{ID_MM_DEVICE_IGNORE}="1"
4+
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple", ENV{ID_MM_DEVICE_IGNORE}="1"
55

Diff for: linux/maple_upload

+9
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ if [ ! -x "${DFU_UTIL}" ]; then
3838
fi
3939

4040
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
41+
42+
echo -n Waiting for ${dummy_port_fullpath} serial...
43+
44+
COUNTER=0
45+
while [ ! -r ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
46+
sleep 0.1
47+
done
48+
49+
echo Done

Diff for: linux/serial_upload

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
$(dirname $0)/stm32flash/stm32flash -g 0x8000000 -b 230400 -w "$4" /dev/"$1"
2+
$(dirname $0)/stm32flash/stm32flash -g 0x8000000 -b 115200 -w "$4" /dev/"$1"

Diff for: linux64/maple_upload

+9
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ if [ ! -x "${DFU_UTIL}" ]; then
3838
fi
3939

4040
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
41+
42+
echo -n Waiting for ${dummy_port_fullpath} serial...
43+
44+
COUNTER=0
45+
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
46+
sleep 0.1
47+
done
48+
49+
echo Done

Diff for: linux64/serial_upload

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
$(dirname $0)/stm32flash/stm32flash -g 0x8000000 -b 230400 -w "$4" /dev/"$1"
2+
$(dirname $0)/stm32flash/stm32flash -g 0x8000000 -b 115200 -w "$4" /dev/"$1"

Diff for: linux64/stlink_upload

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ LD_LIBRARY_PATH=$(dirname $0)/stlink/lib
33
$(dirname $0)/stlink/st-flash write "$4" 0x8000000
44
exit 0
55

6-
## Remove the lines 2 and 3 (above) if you want this script to wait until the Serial device has been enumerated and loaded before the script exits
7-
86
# Check for leaf device.
97
function leaf_status()
108
{

Diff for: macosx/maple_upload

+9
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ if [ ! -x ${DFU_UTIL} ]; then
5151
fi
5252

5353
${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
54+
55+
echo -n Waiting for ${dummy_port_fullpath} serial...
56+
57+
COUNTER=0
58+
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
59+
sleep 0.1
60+
done
61+
62+
echo Done

Diff for: macosx/serial_upload

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
$(dirname $0)/stm32flash/stm32flash -g 0x8000000 -b 230400 -w "$4" /dev/"$1"
2+
$(dirname $0)/stm32flash/stm32flash -g 0x8000000 -b 115200 -w "$4" /dev/"$1"

Diff for: win/maple_upload.bat

+10
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ set driverLetter=%driverLetter:~0,2%
66
%driverLetter%
77
cd %~dp0
88
java -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
9+
10+
for /l %%x in (1, 1, 40) do (
11+
ping -w 50 -n 1 192.0.2.1 > nul
12+
mode %1 > nul
13+
if ERRORLEVEL 0 goto comPortFound
14+
)
15+
16+
echo timeout waiting for %1 serial
17+
18+
:comPortFound

Diff for: win/serial_upload.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cd %~dp0
88
rem: the two line below are needed to fix path issues with incorrect slashes before the bin file name
99
set str=%4
1010
set str=%str:/=\%
11-
stm32flash -g 0x8000000 -b 230400 -w %str% %1
11+
stm32flash -g 0x8000000 -b 115200 -w %str% %1
1212
rem: C:\Python27\python.exe stm32loader.py -e -w -p %1 -g -b 115200 %str%
1313

1414
rem: ------------- use STM's own uploader

0 commit comments

Comments
 (0)