diff --git a/README.md b/README.md index c86bbda33..936507522 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Arduino_Tools [![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Tools.svg)](https://github.com/stm32duino/Arduino_Tools/releases/latest) -[![GitHub commits](https://img.shields.io/github/commits-since/stm32duino/Arduino_Tools/2.3.1.svg)](https://github.com/stm32duino/Arduino_Tools/compare/2.3.1...main) +[![GitHub commits](https://img.shields.io/github/commits-since/stm32duino/Arduino_Tools/2.4.0.svg)](https://github.com/stm32duino/Arduino_Tools/compare/2.4.0...main) Contains upload tools for STM32 based boards and some other usefull scripts. diff --git a/stm32CubeProg.sh b/stm32CubeProg.sh index 26fea2ced..065cb035f 100644 --- a/stm32CubeProg.sh +++ b/stm32CubeProg.sh @@ -17,6 +17,7 @@ ERASE= # Optional for Serial RTS= DTR= +PARITY=EVEN # Mandatory for DFU VID= PID= @@ -42,6 +43,7 @@ usage() { Optional: -r, --rts polarity of RTS signal ('low' by default) -d, --dtr polarity of DTR signal + --parity parity bit configuration ('even' by default) Specific options for DFU protocol: Mandatory: @@ -123,7 +125,7 @@ if [ -n "${GNU_GETOPT}" ]; then exit 1 fi else - if ! options=$(getopt -a -o a:hi:m:ef:o:c:r:s:d:v:p: --long address:,help,interface:,mode:,erase,file:,start:,offset:,com:,rts:,dtr:,vid:,pid: -- "$@"); then + if ! options=$(getopt -a -o a:hi:m:ef:o:c:r:s:d:v:p: --long address:,help,interface:,mode:,erase,file:,start:,offset:,com:,rts:,dtr:,vid:,pid:,parity: -- "$@"); then echo "Terminating..." >&2 exit 1 fi @@ -185,6 +187,10 @@ while true; do PID=$2 shift 2 ;; + --parity) + PARITY=$(echo "$2" | tr '[:lower:]' '[:upper:]') + shift 2 + ;; --) shift break @@ -240,7 +246,11 @@ case "${INTERFACE}" in exit 1 fi fi - ${STM32CP_CLI} --connect port="${PORT}" "${RTS}" "${DTR}" "${ERASE}" --quietMode --download "${FILEPATH}" "${ADDRESS}" --start "${START}" + if [ "$PARITY" != "NONE" ] && [ "$PARITY" != "EVEN" ] && [ "$PARITY" != "ODD" ]; then + echo "Wrong parity value waiting none, even or odd instead of ${PARITY}" >&2 + exit 1 + fi + ${STM32CP_CLI} --connect port="${PORT}" P="${PARITY}" "${RTS}" "${DTR}" "${ERASE}" --quietMode --download "${FILEPATH}" "${ADDRESS}" --start "${START}" ;; jlink) ${STM32CP_CLI} --connect port=JLINK ap=0 "${ERASE}" --quietMode --download "${FILEPATH}" "${ADDRESS}" --start "${START}" diff --git a/win/README.md b/win/README.md index b7f799e7d..f4117a29f 100644 --- a/win/README.md +++ b/win/README.md @@ -4,6 +4,6 @@ - `run_arduino_gen.sh` - `stm32CubeProg.sh` -Version FRP-5301-gda71f7c57 (64-bit), downloaded from [busybox-w32]. +Version FRP-5857-g3681e397f (64-bit), downloaded from [busybox-w32]. [busybox-w32]: https://frippery.org/busybox/ diff --git a/win/busybox.exe b/win/busybox.exe index 537b7f948..b059cb433 100644 Binary files a/win/busybox.exe and b/win/busybox.exe differ diff --git a/win/massStorageCopy.bat b/win/massStorageCopy.bat index b8ce7a9b5..a07d3af18 100644 --- a/win/massStorageCopy.bat +++ b/win/massStorageCopy.bat @@ -32,10 +32,9 @@ goto :eof :sub setlocal enabledelayedexpansion -for /F "skip=1 tokens=*" %%a in ('WMIC LOGICALDISK where "volumename like '%~1'" get deviceid 2^>NUL') do if not defined id set id=%%a - call set "deviceid=%%id: =%%" - if not "%deviceid%" == "" ( - %~dp0busybox.exe cp -f %SRC_PARSE% %deviceid% - if !errorlevel! == 0 (echo Upload complete on %1 ^(%deviceid%^)) +for /F "delims=" %%a in ('powershell -nologo -command ^ + "Get-CimInstance -ClassName 'Win32_LogicalDisk' -Filter 'DriveType = 2' | Where-Object { $_.VolumeName -eq '%~1' } | Select-Object -ExpandProperty DeviceID" 2^>NUL') do if not "%%a" == "" ( + %~dp0busybox.exe cp -f %SRC_PARSE% %%a + if !errorlevel! == 0 (echo Upload complete on %1 ^(%%a^)) exit !errorlevel!) goto :eof