Skip to content

Commit

Permalink
WIP: Allow uploading using open-ocd-supported programmers
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijskooijman committed Mar 20, 2020
1 parent df6b4f7 commit 225a22d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ GenF1.build.mcu=cortex-m3
GenF1.build.series=STM32F1xx
GenF1.build.cmsis_lib_gcc=arm_cortexM3l_math
GenF1.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} {build.bootloader_flags}
GenF1.build.openocd_script=openocd.cfg

# BLUEPILL_F103C6 board
GenF1.menu.pnum.BLUEPILL_F103C6=BluePill F103C6 (32K)
Expand Down
25 changes: 25 additions & 0 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,28 @@ tools.remoteproc_gen.script=run_arduino_gen.sh
tools.remoteproc_gen.upload.params.verbose=
tools.remoteproc_gen.upload.params.quiet=
tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{build.path}/{build.project_name}.elf" "{build.path}/run_arduino_{build.project_name}.sh"

#
# OpenOCD, for upload using programmer
#
tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}
tools.openocd.cmd=bin/openocd
tools.openocd.cmd.windows=bin/openocd.exe

tools.openocd.program.params.verbose=-d2
tools.openocd.program.params.quiet=-d0
tools.openocd.program.init_args=-c "telnet_port disabled" -s "{path}/share/openocd/scripts/"
tools.openocd.program.interface_args=-c "source [find interface/{program.interface}]"
tools.openocd.program.board_args=-f "{runtime.platform.path}/variants/{build.variant}/{build.openocd_script}"
tools.openocd.program.program_args=-c "program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} {program.init_args} {program.interface_args} {program.board_args} {program.program_args}

# Used for burn bootloader, must exist even if empty
tools.openocd.erase.params.verbose=-d2
tools.openocd.erase.params.quiet=-d0
tools.openocd.erase.pattern=

# Upload bootloader, but which?
#tools.openocd.bootloader.params.verbose=-d2
#tools.openocd.bootloader.params.quiet=-d0
#tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
31 changes: 31 additions & 0 deletions programmers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmsis_dap.name=CMSIS-DAP compatible programmer
cmsis_dap.communication=USB
cmsis_dap.protocol=
cmsis_dap.program.protocol=
cmsis_dap.program.interface=cmsis-dap.cfg
cmsis_dap.program.tool=openocd
cmsis_dap.program.extra_params=

stlink-v1.name=ST-LINK/V1
stlink-v1.communication=USB
stlink-v1.protocol=
stlink-v1.program.protocol=
stlink-v1.program.interface=stlink-v1.cfg
stlink-v1.program.tool=openocd
stlink-v1.program.extra_params=

stlink-v2.name=ST-LINK/V2
stlink-v2.communication=USB
stlink-v2.protocol=
stlink-v2.program.protocol=
stlink-v2.program.interface=stlink-v2.cfg
stlink-v2.program.tool=openocd
stlink-v2.program.extra_params=

stlink-v2-1.name=ST-LINK/V2-1
stlink-v2-1.communication=USB
stlink-v2-1.protocol=
stlink-v2-1.program.protocol=
stlink-v2-1.program.interface=stlink-v2-1.cfg
stlink-v2-1.program.tool=openocd
stlink-v2-1.program.extra_params=
1 change: 1 addition & 0 deletions variants/PILL_F103XX/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source [find target/stm32f1x.cfg]

0 comments on commit 225a22d

Please sign in to comment.