mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-12-14 11:33:14 +00:00
Add stm32 serial upload method which includes bootloader (#180)
This commit is contained in:
@@ -18,6 +18,9 @@ case "$MULTI_BOARD" in
|
||||
MULTI_STM32_NO_BOOT)
|
||||
MULTI_TYPE=stm
|
||||
;;
|
||||
MULTI_STM32_WITH_BOOT)
|
||||
MULTI_TYPE=stm
|
||||
;;
|
||||
MULTI_STM32_FLASH_FROM_TX)
|
||||
MULTI_TYPE=stm
|
||||
;;
|
||||
|
||||
20
BootLoaders/Boards/stm32/tools/linux64/serial_upload_inc_bootloader
Executable file
20
BootLoaders/Boards/stm32/tools/linux64/serial_upload_inc_bootloader
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
port=$1
|
||||
addr=$2
|
||||
fwfile=$3
|
||||
bootloaderfile=$4
|
||||
|
||||
uname -m | grep "x86_64" 2>&1 1>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
# Do 64-bit stuff
|
||||
$(dirname $0)/../linux64/stm32flash/stm32flash -o -b 57600 /dev/"$port"
|
||||
$(dirname $0)/../linux64/stm32flash/stm32flash -v -g 0x8000000 -b 57600 -w "$bootloaderfile" /dev/"$port"
|
||||
$(dirname $0)/../linux64/stm32flash/stm32flash -v -s 8 -e 0 -g 0x8002000 -b 57600 -w "$fwfile" /dev/"$port"
|
||||
else
|
||||
# Do 32-bit stuff
|
||||
$(dirname $0)/stm32flash/stm32flash -o -b 57600 /dev/"$port"
|
||||
$(dirname $0)/stm32flash/stm32flash -v -g 0x8000000 -b 57600 -w "$bootloaderfile" /dev/"$port"
|
||||
$(dirname $0)/stm32flash/stm32flash -v -s 8 -e 0 -g 0x8002000 -b 57600 -w "$fwfile" /dev/"$port"
|
||||
fi
|
||||
Reference in New Issue
Block a user