diff --git a/STM32F1/boards.txt b/STM32F1/boards.txt index cc16007..cb660a9 100644 --- a/STM32F1/boards.txt +++ b/STM32F1/boards.txt @@ -215,6 +215,7 @@ genericSTM32F103C.menu.upload_method.BMPMethod.build.upload_flags=-DCONFIG_MAPLE genericSTM32F103C.menu.upload_method.jlinkMethod=JLink genericSTM32F103C.menu.upload_method.jlinkMethod.upload.protocol=jlink genericSTM32F103C.menu.upload_method.jlinkMethod.upload.tool=jlink_upload +genericSTM32F103C.menu.upload_method.jlinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER ########################### Generic STM32F103R ########################### diff --git a/tools/linux/jlink_upload b/tools/linux/jlink_upload index d07ffba..733bfdf 100755 --- a/tools/linux/jlink_upload +++ b/tools/linux/jlink_upload @@ -1,5 +1,7 @@ #!/bin/bash -echo loadbin "$1" , 0x8000000 > "$1".jlink + +echo erase > "$1".jlink +echo loadbin "$1" , 0x8000000 >> "$1".jlink echo r >> "$1".jlink echo q >> "$1".jlink diff --git a/tools/win/jlink_upload.bat b/tools/win/jlink_upload.bat new file mode 100644 index 0000000..e797e50 --- /dev/null +++ b/tools/win/jlink_upload.bat @@ -0,0 +1,19 @@ +rem: @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 two line below are needed to fix path issues with incorrect slashes before the bin file name +set tmpBinFilePath=%1 +set tmpBinFilePath=%tmpBinFilePath:/=\% + +rem: create commander script file with the tmp bin that the Arduino IDE creates + +@echo erase > %tmpbinfilepath%.jlink +@echo loadbin %tmpbinfilepath% , 0x8000000 >> %tmpbinfilepath%.jlink +@echo r >> %tmpbinfilepath%.jlink +@echo q >> %tmpbinfilepath%.jlink + +JLink.exe -device STM32F103C8 -if SWD -speed auto -CommanderScript %tmpBinFilePath%.jlink \ No newline at end of file