Skip to content

Commit 6bbb5dc

Browse files
Added JLink upload to Windows and fixed intermitten JLink upload issues
1 parent 293b693 commit 6bbb5dc

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

STM32F1/boards.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ genericSTM32F103C.menu.upload_method.BMPMethod.build.upload_flags=-DCONFIG_MAPLE
215215
genericSTM32F103C.menu.upload_method.jlinkMethod=JLink
216216
genericSTM32F103C.menu.upload_method.jlinkMethod.upload.protocol=jlink
217217
genericSTM32F103C.menu.upload_method.jlinkMethod.upload.tool=jlink_upload
218+
genericSTM32F103C.menu.upload_method.jlinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
218219

219220
########################### Generic STM32F103R ###########################
220221

tools/linux/jlink_upload

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
2-
echo loadbin "$1" , 0x8000000 > "$1".jlink
2+
3+
echo erase > "$1".jlink
4+
echo loadbin "$1" , 0x8000000 >> "$1".jlink
35
echo r >> "$1".jlink
46
echo q >> "$1".jlink
57

tools/win/jlink_upload.bat

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
rem: @echo off
2+
rem: Note %~dp0 get path of this batch file
3+
rem: Need to change drive if My Documents is on a drive other than C:
4+
set driverLetter=%~dp0
5+
set driverLetter=%driverLetter:~0,2%
6+
%driverLetter%
7+
cd %~dp0
8+
rem: the two line below are needed to fix path issues with incorrect slashes before the bin file name
9+
set tmpBinFilePath=%1
10+
set tmpBinFilePath=%tmpBinFilePath:/=\%
11+
12+
rem: create commander script file with the tmp bin that the Arduino IDE creates
13+
14+
@echo erase > %tmpbinfilepath%.jlink
15+
@echo loadbin %tmpbinfilepath% , 0x8000000 >> %tmpbinfilepath%.jlink
16+
@echo r >> %tmpbinfilepath%.jlink
17+
@echo q >> %tmpbinfilepath%.jlink
18+
19+
JLink.exe -device STM32F103C8 -if SWD -speed auto -CommanderScript %tmpBinFilePath%.jlink

0 commit comments

Comments
 (0)