diff --git a/BootLoaders/Archives/package_multi_4in1_stm32_board_v1.0.7.tar.gz b/BootLoaders/Archives/package_multi_4in1_stm32_board_v1.0.7.tar.gz new file mode 100644 index 0000000..0df5066 Binary files /dev/null and b/BootLoaders/Archives/package_multi_4in1_stm32_board_v1.0.7.tar.gz differ diff --git a/BootLoaders/Boards/stm32/boards.txt b/BootLoaders/Boards/stm32/boards.txt index 310e6c0..ceeea1f 100644 --- a/BootLoaders/Boards/stm32/boards.txt +++ b/BootLoaders/Boards/stm32/boards.txt @@ -37,7 +37,7 @@ multistm32f103c.bootloader.tool=serial_upload #---------------------------- UPLOAD METHODS --------------------------- multistm32f103c.menu.upload_method.TxFlashMethod=Flash from Tx -multistm32f103c.menu.upload_method.TxFlashMethod.build.board=MULTI_STM32_FLASH_FROM_TX=104 +multistm32f103c.menu.upload_method.TxFlashMethod.build.board=MULTI_STM32_FLASH_FROM_TX=107 multistm32f103c.menu.upload_method.TxFlashMethod.upload.tool=tx_upload multistm32f103c.menu.upload_method.TxFlashMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER multistm32f103c.menu.upload_method.TxFlashMethod.build.vect=VECT_TAB_ADDR=0x8002000 @@ -45,7 +45,7 @@ multistm32f103c.menu.upload_method.TxFlashMethod.build.ldscript=ld/bootloader_20 multistm32f103c.menu.upload_method.TxFlashMethod.bootloader.file=Multi4in1/StmMulti4in1.bin multistm32f103c.menu.upload_method.DFUUploadMethod=Upload via USB -multistm32f103c.menu.upload_method.DFUUploadMethod.build.board=MULTI_STM32_NO_BOOT=104 +multistm32f103c.menu.upload_method.DFUUploadMethod.build.board=MULTI_STM32_NO_BOOT=107 multistm32f103c.menu.upload_method.DFUUploadMethod.upload.protocol=maple_dfu multistm32f103c.menu.upload_method.DFUUploadMethod.upload.tool=maple_upload multistm32f103c.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER @@ -55,10 +55,20 @@ multistm32f103c.menu.upload_method.DFUUploadMethod.upload.usbID=1EAF:0003 multistm32f103c.menu.upload_method.DFUUploadMethod.upload.altID=2 multistm32f103c.menu.upload_method.DFUUploadMethod.bootloader.file=Multi4in1/StmMulti4in1.bin +multistm32f103c.menu.upload_method.serialIncBootloaderMethod=Upload via Serial inc. Bootloader (FTDI) +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.build.board=MULTI_STM32_WITH_BOOT=107 +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.upload.protocol=maple_serial +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.upload.tool=serial_upload_inc_bootloader +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.build.vect=VECT_TAB_ADDR=0x8002000 +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.build.ldscript=ld/bootloader_20.ld +multistm32f103c.menu.upload_method.serialIncBootloaderMethod.bootloader.file=Multi4in1/StmMulti4in1.bin + multistm32f103c.menu.upload_method.serialMethod=Upload via Serial (FTDI) multistm32f103c.menu.upload_method.serialMethod.upload.protocol=maple_serial multistm32f103c.menu.upload_method.serialMethod.upload.tool=serial_upload multistm32f103c.menu.upload_method.serialMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG -multistm32f103c.menu.upload_method.serialMethod.build.board=MULTI_STM32_NO_BOOT=104 +multistm32f103c.menu.upload_method.serialMethod.build.board=MULTI_STM32_NO_BOOT=107 +multistm32f103c.menu.upload_method.serialMethod.bootloader.file=Multi4in1/StmMulti4in1.bin ############################################################## diff --git a/BootLoaders/Boards/stm32/platform.txt b/BootLoaders/Boards/stm32/platform.txt index 423b88c..f3dde44 100644 --- a/BootLoaders/Boards/stm32/platform.txt +++ b/BootLoaders/Boards/stm32/platform.txt @@ -6,7 +6,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=Multi 4-in-1 STM32 -version=1.0.6 +version=1.0.7 compiler.warning_flags=-w -DDEBUG_LEVEL=DEBUG_NONE compiler.warning_flags.none=-w -DDEBUG_LEVEL=DEBUG_NONE @@ -150,6 +150,27 @@ tools.serial_upload.bootloader.params.verbose= tools.serial_upload.bootloader.params.quiet= tools.serial_upload.bootloader.pattern="{path}/{cmd}" {serial.port.file} 0x0 "{runtime.platform.path}/bootloaders/{bootloader.file}" +# Tool for generic STM32 upload via serial to Serial Port 1 including bootloader + +tools.serial_upload_inc_bootloader.cmd=serial_upload_inc_bootloader +tools.serial_upload_inc_bootloader.cmd.windows=serial_upload_inc_bootloader.bat +tools.serial_upload_inc_bootloader.cmd.macosx=serial_upload_inc_bootloader +tools.serial_upload_inc_bootloader.path={runtime.platform.path}/tools/win +tools.serial_upload_inc_bootloader.path.macosx={runtime.platform.path}/tools/macosx +tools.serial_upload_inc_bootloader.path.linux={runtime.platform.path}/tools/linux +tools.serial_upload_inc_bootloader.path.linux64={runtime.platform.path}/tools/linux64 +tools.serial_upload_inc_bootloader.upload.params.verbose=-d +tools.serial_upload_inc_bootloader.upload.params.quiet=n +tools.serial_upload_inc_bootloader.upload.pattern="{path}/{cmd}" {serial.port.file} 0x8000000 "{build.path}/{build.project_name}.bin" "{runtime.platform.path}/bootloaders/{bootloader.file}" + +tools.serial_upload_inc_bootloader.erase.params.verbose= +tools.serial_upload_inc_bootloader.erase.params.quiet= +tools.serial_upload_inc_bootloader.erase.pattern= + +tools.serial_upload_inc_bootloader.bootloader.params.verbose= +tools.serial_upload_inc_bootloader.bootloader.params.quiet= +tools.serial_upload_inc_bootloader.bootloader.pattern="{path}/{cmd}" {serial.port.file} 0x0 "{runtime.platform.path}/bootloaders/{bootloader.file}" + # Dummy tool for "flashing" via Tx # Doesn't do any actual upload but provides instructions and path to .bin file tools.tx_upload.cmd=tx_upload diff --git a/BootLoaders/Boards/stm32/tools/linux/do_version b/BootLoaders/Boards/stm32/tools/linux/do_version index 6b47f49..84d5106 100755 --- a/BootLoaders/Boards/stm32/tools/linux/do_version +++ b/BootLoaders/Boards/stm32/tools/linux/do_version @@ -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 ;; diff --git a/BootLoaders/Boards/stm32/tools/linux/serial_upload_inc_bootloader b/BootLoaders/Boards/stm32/tools/linux/serial_upload_inc_bootloader new file mode 100755 index 0000000..d2f9f4d --- /dev/null +++ b/BootLoaders/Boards/stm32/tools/linux/serial_upload_inc_bootloader @@ -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 diff --git a/BootLoaders/Boards/stm32/tools/linux64/do_version b/BootLoaders/Boards/stm32/tools/linux64/do_version index 6b47f49..84d5106 100755 --- a/BootLoaders/Boards/stm32/tools/linux64/do_version +++ b/BootLoaders/Boards/stm32/tools/linux64/do_version @@ -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 ;; diff --git a/BootLoaders/Boards/stm32/tools/linux64/serial_upload_inc_bootloader b/BootLoaders/Boards/stm32/tools/linux64/serial_upload_inc_bootloader new file mode 100755 index 0000000..d2f9f4d --- /dev/null +++ b/BootLoaders/Boards/stm32/tools/linux64/serial_upload_inc_bootloader @@ -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 diff --git a/BootLoaders/Boards/stm32/tools/macosx/do_version b/BootLoaders/Boards/stm32/tools/macosx/do_version index 6b47f49..84d5106 100755 --- a/BootLoaders/Boards/stm32/tools/macosx/do_version +++ b/BootLoaders/Boards/stm32/tools/macosx/do_version @@ -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 ;; diff --git a/BootLoaders/Boards/stm32/tools/macosx/serial_upload_inc_bootloader b/BootLoaders/Boards/stm32/tools/macosx/serial_upload_inc_bootloader new file mode 100755 index 0000000..60b7773 --- /dev/null +++ b/BootLoaders/Boards/stm32/tools/macosx/serial_upload_inc_bootloader @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +port=$1 +addr=$2 +fwfile=$3 +bootloaderfile=$4 + +$(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" diff --git a/BootLoaders/Boards/stm32/tools/win/do_version.bat b/BootLoaders/Boards/stm32/tools/win/do_version.bat index a62ff9b..d34e220 100644 --- a/BootLoaders/Boards/stm32/tools/win/do_version.bat +++ b/BootLoaders/Boards/stm32/tools/win/do_version.bat @@ -17,6 +17,7 @@ SET SKETCH_PATH=%SKETCH_PATH:"=% IF %MULTI_BOARD%==MULTI_NO_BOOT SET MULTI_TYPE=avr IF %MULTI_BOARD%==MULTI_FLASH_FROM_TX SET MULTI_TYPE=avr IF %MULTI_BOARD%==MULTI_STM32_NO_BOOT SET MULTI_TYPE=stm +IF %MULTI_BOARD%==MULTI_STM32_WITH_BOOT SET MULTI_TYPE=stm IF %MULTI_BOARD%==MULTI_STM32_FLASH_FROM_TX SET MULTI_TYPE=stm IF %MULTI_BOARD%==MULTI_ORANGERX SET MULTI_TYPE=orx diff --git a/BootLoaders/Boards/stm32/tools/win/serial_upload.bat b/BootLoaders/Boards/stm32/tools/win/serial_upload.bat index 65a42bc..a98f0d8 100644 --- a/BootLoaders/Boards/stm32/tools/win/serial_upload.bat +++ b/BootLoaders/Boards/stm32/tools/win/serial_upload.bat @@ -1,27 +1,16 @@ @echo off -rem: Note %~dp0 get path of this batch file -rem: Need to change drive if My Documents is on a drive other than C: +rem Note %~dp0 get path of this batch file +rem Need to change drive if My Documents is on a drive other than C: set driverLetter=%~dp0 set driverLetter=%driverLetter:~0,2% %driverLetter% cd %~dp0 -rem: the two line below are needed to fix path issues with incorrect slashes before the bin file name -set str=%3 -set str=%str:/=\% -echo stm32flash -v -g %2 -b 57600 -w %str% %1 +rem The lines below are needed to fix path issues with incorrect slashes before the bin file name +set fwpath=%3 +set fwpath=%fwpath:/=\% + +echo stm32flash -v -g %2 -b 57600 -w %fwpath% %1 echo. -stm32flash -v -g %2 -b 57600 -w %str% %1 -rem: C:\Python27\python.exe stm32loader.py -e -w -p %1 -g -b 115200 %str% - -rem: ------------- use STM's own uploader -rem: ---- Need to remove the COM bit from the comm port as the STM prog just wants the number -set commport=%1 -set commportnum=%commport:COM=% -rem: --- The maple board may nee the -i setting to be -i STM32_Med-density_128K or STM32_Med-density_64K -rem: ---- 64 bit version -rem: "%ProgramFiles(x86)%\STMicroelectronics\Software\Flash Loader Demonstrator\STMFlashLoader.exe" -c --pn %commportnum% --br 230400 -i STM32_High-density_256K -e --all -d --fn %str% --a 0x8000000 -r --a 0x8000000 - -rem: -- 32 bit version -rem: "%ProgramFiles%\STMicroelectronics\Software\Flash Loader Demonstrator\STMFlashLoader.exe" -c --pn %commportnum% --br 230400 -i STM32_Med-density_64K -e --all -d --fn %str% --a 0x8000000 -r --a 0x8000000 +stm32flash -v -g %2 -b 57600 -w %fwpath% %1 diff --git a/BootLoaders/Boards/stm32/tools/win/serial_upload_inc_bootloader.bat b/BootLoaders/Boards/stm32/tools/win/serial_upload_inc_bootloader.bat new file mode 100644 index 0000000..47267dd --- /dev/null +++ b/BootLoaders/Boards/stm32/tools/win/serial_upload_inc_bootloader.bat @@ -0,0 +1,31 @@ +@echo off +rem Note %~dp0 get path of this batch file +rem Need to change drive if My Documents is on a drive other than C: +set driverLetter=%~dp0 +set driverLetter=%driverLetter:~0,2% +%driverLetter% +cd %~dp0 + +rem The lines below are needed to fix path issues with incorrect slashes before the bin file name +set fwpath=%3 +set fwpath=%fwpath:/=\% + +set blpath=%4 +set blpath=%blpath:/=\% + +rem Erase the flash +echo stm32flash -o -b 57600 %1 +stm32flash -o -b 57600 %1 +if %errorlevel% neq 0 exit /b %errorlevel% + +rem Write the Multi bootloader +echo stm32flash.exe -v -g 0x8000000 -b 57600 -w %blpath% %1 +stm32flash.exe -v -g 0x8000000 -b 57600 -w %blpath% %1 +if %errorlevel% neq 0 exit /b %errorlevel% + +rem Write the Multi firmware +echo stm32flash -v -s 8 -e 0 -g 0x8002000 -b 57600 -w %fwpath% %1 +stm32flash -v -s 8 -e 0 -g 0x8002000 -b 57600 -w %fwpath% %1 +if %errorlevel% neq 0 exit /b %errorlevel% + +echo. diff --git a/BootLoaders/package_multi_4in1_board_index.json b/BootLoaders/package_multi_4in1_board_index.json index aa5ae68..361698a 100644 --- a/BootLoaders/package_multi_4in1_board_index.json +++ b/BootLoaders/package_multi_4in1_board_index.json @@ -224,6 +224,27 @@ "version": "4.8.3-2014q1" }] }, + { + "name": "Multi 4-in-1 STM32 Board", + "architecture": "STM32F1", + "version": "1.0.7", + "category": "Contributed", + "help": { + "online": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module" + }, + "url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/raw/master/BootLoaders/Archives/package_multi_4in1_stm32_board_v1.0.7.tar.gz", + "archiveFileName": "package_multi_4in1_stm32_board_v1.0.7.tar.gz", + "checksum": "SHA-256:f73fded48beaee55e646a3cf36d24beeedc336873c7824683a4912f2aee9e350", + "size": "10322111", + "boards": [{ + "name": "Multi 4-in-1 (STM32F103C)" + }], + "toolsDependencies": [{ + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }] + }, { "name": "Multi 4-in-1 OrangeRX Board - DEPRECATED, USE MULTI 4-IN-1 AVR BOARDS PACKAGE INSTEAD", "architecture": "orangerx", diff --git a/Multiprotocol/Validate.h b/Multiprotocol/Validate.h index 17a31ba..9308fa0 100644 --- a/Multiprotocol/Validate.h +++ b/Multiprotocol/Validate.h @@ -13,7 +13,7 @@ #endif #if defined (STM32_BOARD) && not defined (ORANGE_TX) //STM32 - #if not defined(ARDUINO_GENERIC_STM32F103C) && not defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX) && not defined(ARDUINO_MULTI_STM32_NO_BOOT) + #if not defined(ARDUINO_GENERIC_STM32F103C) && not defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX) && not defined(ARDUINO_MULTI_STM32_NO_BOOT) && not defined(ARDUINO_MULTI_STM32_WITH_BOOT) #error You must select one of these boards: "Multi 4-in-1 (STM32F103CB)" or "Generic STM32F103C series" #endif #endif @@ -31,7 +31,7 @@ #error You need to update your Multi 4-in-1 board definition. Open Boards Manager and update to the latest version of the Multi 4-in-1 AVR Boards. #endif //STM32 -#if (defined(ARDUINO_MULTI_STM32_NO_BOOT) && ARDUINO_MULTI_STM32_NO_BOOT < MIN_STM32_BOARD) || (defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX) && ARDUINO_MULTI_STM32_FLASH_FROM_TX < MIN_STM32_BOARD) +#if (defined(ARDUINO_MULTI_STM32_NO_BOOT) && ARDUINO_MULTI_STM32_NO_BOOT < MIN_STM32_BOARD) || (defined(ARDUINO_MULTI_STM32_FLASH_FROM_TX) && ARDUINO_MULTI_STM32_FLASH_FROM_TX < MIN_STM32_BOARD) || (defined(ARDUINO_MULTI_STM32_WITH_BOOT) && ARDUINO_MULTI_STM32_WITH_BOOT < MIN_STM32_BOARD) #error You need to update your Multi 4-in-1 board definition. Open Boards Manager and update to the latest version of the Multi 4-in-1 STM32 Board. #endif