Skip to content

Commit

Permalink
fix(programmer): properly define programmer interface
Browse files Browse the repository at this point in the history
Fixes #2415

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Jul 4, 2024
1 parent 74255d5 commit d739bec
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 47 deletions.
72 changes: 36 additions & 36 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Nucleo_144.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build
Nucleo_144.build.flash_offset=0x0
Nucleo_144.upload.maximum_size=0
Nucleo_144.upload.maximum_data_size=0
Nucleo_144.programmer.default=stlink
Nucleo_144.programmer.default=stlink_swd
Nucleo_144.vid.0=0x0483
Nucleo_144.pid.0=0x5740
Nucleo_144.vid.1=0x0483
Expand Down Expand Up @@ -395,7 +395,7 @@ Nucleo_64.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.
Nucleo_64.build.flash_offset=0x0
Nucleo_64.upload.maximum_size=0
Nucleo_64.upload.maximum_data_size=0
Nucleo_64.programmer.default=stlink
Nucleo_64.programmer.default=stlink_swd
Nucleo_64.vid.0=0x0483
Nucleo_64.pid.0=0x5740
# STlink V1/V2.1/V3
Expand Down Expand Up @@ -875,7 +875,7 @@ Nucleo_32.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.
Nucleo_32.build.flash_offset=0x0
Nucleo_32.upload.maximum_size=0
Nucleo_32.upload.maximum_data_size=0
Nucleo_32.programmer.default=stlink
Nucleo_32.programmer.default=stlink_swd
Nucleo_32.vid.0=0x0483
Nucleo_32.pid.0=0x5740
# STlink V1/V2.1/V3
Expand Down Expand Up @@ -1038,7 +1038,7 @@ Disco.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer
Disco.build.flash_offset=0x0
Disco.upload.maximum_size=0
Disco.upload.maximum_data_size=0
Disco.programmer.default=stlink
Disco.programmer.default=stlink_swd
Disco.vid.0=0x0483
Disco.pid.0=0x5740
# STlink V1/V2.1/V3
Expand Down Expand Up @@ -1359,7 +1359,7 @@ Eval.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSeri
Eval.build.flash_offset=0x0
Eval.upload.maximum_size=0
Eval.upload.maximum_data_size=0
Eval.programmer.default=stlink
Eval.programmer.default=stlink_swd
Eval.vid.0=0x0483
Eval.pid.0=0x5740
# STlink V1/V2.1/V3
Expand Down Expand Up @@ -1425,7 +1425,7 @@ STM32MP1.name=STM32MP1 series coprocessor
STM32MP1.build.flash_offset=0x0
STM32MP1.upload.maximum_size=0
STM32MP1.upload.maximum_data_size=0
STM32MP1.programmer.default=stlink
STM32MP1.programmer.default=stlink_swd
STM32MP1.vid.0=0x0483
STM32MP1.pid.0=0x5740

Expand Down Expand Up @@ -1474,7 +1474,7 @@ GenC0.build.st_extra_flags=-D{build.product_line} {build.xSerial} -D__CORTEX_SC=
GenC0.build.flash_offset=0x0
GenC0.upload.maximum_size=0
GenC0.upload.maximum_data_size=0
GenC0.programmer.default=stlink
GenC0.programmer.default=stlink_swd
GenC0.debug.server.openocd.scripts.2=target/stm32c0x.cfg
GenC0.vid.0=0x0483
GenC0.pid.0=0x5740
Expand Down Expand Up @@ -1619,7 +1619,7 @@ GenF0.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer
GenF0.build.flash_offset=0x0
GenF0.upload.maximum_size=0
GenF0.upload.maximum_data_size=0
GenF0.programmer.default=stlink
GenF0.programmer.default=stlink_swd
GenF0.debug.server.openocd.scripts.2=target/stm32f0x.cfg
GenF0.vid.0=0x0483
GenF0.pid.0=0x5740
Expand Down Expand Up @@ -2528,7 +2528,7 @@ GenF1.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer
GenF1.build.flash_offset=0x0
GenF1.upload.maximum_size=0
GenF1.upload.maximum_data_size=0
GenF1.programmer.default=stlink
GenF1.programmer.default=stlink_swd
GenF1.debug.server.openocd.scripts.2=target/stm32f1x.cfg
GenF1.vid.0=0x0483
GenF1.pid.0=0x5740
Expand Down Expand Up @@ -3373,7 +3373,7 @@ GenF2.build.series=STM32F2xx
GenF2.build.flash_offset=0x0
GenF2.upload.maximum_size=0
GenF2.upload.maximum_data_size=0
GenF2.programmer.default=stlink
GenF2.programmer.default=stlink_swd
GenF2.debug.server.openocd.scripts.2=target/stm32f2x.cfg
GenF2.vid.0=0x0483
GenF2.pid.0=0x5740
Expand Down Expand Up @@ -3832,7 +3832,7 @@ GenF3.build.series=STM32F3xx
GenF3.build.flash_offset=0x0
GenF3.upload.maximum_size=0
GenF3.upload.maximum_data_size=0
GenF3.programmer.default=stlink
GenF3.programmer.default=stlink_swd
GenF3.debug.server.openocd.scripts.2=target/stm32f3x.cfg
GenF3.vid.0=0x0483
GenF3.pid.0=0x5740
Expand Down Expand Up @@ -4288,7 +4288,7 @@ GenF4.build.series=STM32F4xx
GenF4.build.flash_offset=0x0
GenF4.upload.maximum_size=0
GenF4.upload.maximum_data_size=0
GenF4.programmer.default=stlink
GenF4.programmer.default=stlink_swd
GenF4.debug.server.openocd.scripts.2=target/stm32f4x.cfg
GenF4.vid.0=0x0483
GenF4.pid.0=0x5740
Expand Down Expand Up @@ -5304,7 +5304,7 @@ GenF7.build.series=STM32F7xx
GenF7.build.flash_offset=0x0
GenF7.upload.maximum_size=0
GenF7.upload.maximum_data_size=0
GenF7.programmer.default=stlink
GenF7.programmer.default=stlink_swd
GenF7.debug.server.openocd.scripts.2=target/stm32f7x.cfg
GenF7.vid.0=0x0483
GenF7.pid.0=0x5740
Expand Down Expand Up @@ -5832,7 +5832,7 @@ GenG0.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer
GenG0.build.flash_offset=0x0
GenG0.upload.maximum_size=0
GenG0.upload.maximum_data_size=0
GenG0.programmer.default=stlink
GenG0.programmer.default=stlink_swd
GenG0.debug.server.openocd.scripts.2=target/stm32g0x.cfg
GenG0.vid.0=0x0483
GenG0.pid.0=0x5740
Expand Down Expand Up @@ -7246,7 +7246,7 @@ GenG4.build.series=STM32G4xx
GenG4.build.flash_offset=0x0
GenG4.upload.maximum_size=0
GenG4.upload.maximum_data_size=0
GenG4.programmer.default=stlink
GenG4.programmer.default=stlink_swd
GenG4.debug.server.openocd.scripts.2=target/stm32g4x.cfg
GenG4.vid.0=0x0483
GenG4.pid.0=0x5740
Expand Down Expand Up @@ -8415,7 +8415,7 @@ GenH5.build.series=STM32H5xx
GenH5.build.flash_offset=0x0
GenH5.upload.maximum_size=0
GenH5.upload.maximum_data_size=0
GenH5.programmer.default=stlink
GenH5.programmer.default=stlink_swd
# Current openocd version does not support H5
# GenH5.debug.server.openocd.scripts.2=target/stm32h5x.cfg
GenH5.vid.0=0x0483
Expand Down Expand Up @@ -8505,7 +8505,7 @@ GenH7.build.mcu=cortex-m7
GenH7.build.flash_offset=0x0
GenH7.upload.maximum_size=0
GenH7.upload.maximum_data_size=0
GenH7.programmer.default=stlink
GenH7.programmer.default=stlink_swd
GenH7.debug.server.openocd.scripts.2=target/stm32h7x.cfg
GenH7.vid.0=0x0483
GenH7.pid.0=0x5740
Expand Down Expand Up @@ -9140,7 +9140,7 @@ GenL0.build.series=STM32L0xx
GenL0.build.flash_offset=0x0
GenL0.upload.maximum_size=0
GenL0.upload.maximum_data_size=0
GenL0.programmer.default=stlink
GenL0.programmer.default=stlink_swd
GenL0.debug.server.openocd.scripts.2=target/stm32l0x.cfg
GenL0.vid.0=0x0483
GenL0.pid.0=0x5740
Expand Down Expand Up @@ -10423,7 +10423,7 @@ GenL1.build.series=STM32L1xx
GenL1.build.flash_offset=0x0
GenL1.upload.maximum_size=0
GenL1.upload.maximum_data_size=0
GenL1.programmer.default=stlink
GenL1.programmer.default=stlink_swd
GenL1.debug.server.openocd.scripts.2=target/stm32l1x.cfg
GenL1.vid.0=0x0483
GenL1.pid.0=0x5740
Expand Down Expand Up @@ -10746,7 +10746,7 @@ GenL4.build.series=STM32L4xx
GenL4.build.flash_offset=0x0
GenL4.upload.maximum_size=0
GenL4.upload.maximum_data_size=0
GenL4.programmer.default=stlink
GenL4.programmer.default=stlink_swd
GenL4.debug.server.openocd.scripts.2=target/stm32l4x.cfg
GenL4.vid.0=0x0483
GenL4.pid.0=0x5740
Expand Down Expand Up @@ -11511,7 +11511,7 @@ GenL5.build.series=STM32L5xx
GenL5.build.flash_offset=0x0
GenL5.upload.maximum_size=0
GenL5.upload.maximum_data_size=0
GenL5.programmer.default=stlink
GenL5.programmer.default=stlink_swd
GenL5.debug.server.openocd.scripts.2=target/stm32l5x.cfg
GenL5.vid.0=0x0483
GenL5.pid.0=0x5740
Expand Down Expand Up @@ -11573,7 +11573,7 @@ GenU5.build.series=STM32U5xx
GenU5.build.flash_offset=0x0
GenU5.upload.maximum_size=0
GenU5.upload.maximum_data_size=0
GenU5.programmer.default=stlink
GenU5.programmer.default=stlink_swd
GenU5.debug.server.openocd.scripts.2=target/stm32u5x.cfg
GenU5.vid.0=0x0483
GenU5.pid.0=0x5740
Expand Down Expand Up @@ -11698,7 +11698,7 @@ GenWB.build.series=STM32WBxx
GenWB.build.flash_offset=0x0
GenWB.upload.maximum_size=0
GenWB.upload.maximum_data_size=0
GenWB.programmer.default=stlink
GenWB.programmer.default=stlink_swd
GenWB.debug.server.openocd.scripts.2=target/stm32wbx.cfg
GenWB.vid.0=0x0483
GenWB.pid.0=0x5740
Expand Down Expand Up @@ -11805,7 +11805,7 @@ GenWBA.build.series=STM32WBAxx
GenWBA.build.flash_offset=0x0
GenWBA.upload.maximum_size=0
GenWBA.upload.maximum_data_size=0
GenWBA.programmer.default=stlink
GenWBA.programmer.default=stlink_swd
GenWBA.debug.server.openocd.scripts.2=target/stm32wbax.cfg
GenWBA.vid.0=0x0483
GenWBA.pid.0=0x5740
Expand Down Expand Up @@ -11853,7 +11853,7 @@ GenWL.build.series=STM32WLxx
GenWL.build.flash_offset=0x0
GenWL.upload.maximum_size=0
GenWL.upload.maximum_data_size=0
GenWL.programmer.default=stlink
GenWL.programmer.default=stlink_swd
GenWL.debug.server.openocd.scripts.2=target/stm32wlx.cfg
GenWL.vid.0=0x0483
GenWL.pid.0=0x5740
Expand Down Expand Up @@ -12030,7 +12030,7 @@ GenWL.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
3dprinter.build.flash_offset=0x0
3dprinter.upload.maximum_size=0
3dprinter.upload.maximum_data_size=0
3dprinter.programmer.default=stlink
3dprinter.programmer.default=stlink_swd
3dprinter.vid.0=0x0483
3dprinter.pid.0=0x5740

Expand Down Expand Up @@ -12262,7 +12262,7 @@ Blues.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer
Blues.build.flash_offset=0x0
Blues.upload.maximum_size=0
Blues.upload.maximum_data_size=0
Blues.programmer.default=stlink
Blues.programmer.default=stlink_swd
Blues.vid.0=0x30A4

# Swan R5 board
Expand Down Expand Up @@ -12325,7 +12325,7 @@ Elecgator.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.
Elecgator.build.flash_offset=0x0
Elecgator.upload.maximum_size=0
Elecgator.upload.maximum_data_size=0
Elecgator.programmer.default=stlink
Elecgator.programmer.default=stlink_swd
Elecgator.vid.0=0x0483
Elecgator.pid.0=0x5740

Expand Down Expand Up @@ -12367,7 +12367,7 @@ ESC_board.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.
ESC_board.build.flash_offset=0x0
ESC_board.upload.maximum_size=0
ESC_board.upload.maximum_data_size=0
ESC_board.programmer.default=stlink
ESC_board.programmer.default=stlink_swd
ESC_board.vid.0=0x0483
ESC_board.pid.0=0x5740

Expand Down Expand Up @@ -12425,7 +12425,7 @@ Garatronic.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build
Garatronic.build.flash_offset=0x0
Garatronic.upload.maximum_size=0
Garatronic.upload.maximum_data_size=0
Garatronic.programmer.default=stlink
Garatronic.programmer.default=stlink_swd
Garatronic.vid.0=0x0483
Garatronic.pid.0=0x5740

Expand Down Expand Up @@ -12505,7 +12505,7 @@ GenFlight.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.
GenFlight.build.flash_offset=0x0
GenFlight.upload.maximum_size=0
GenFlight.upload.maximum_data_size=0
GenFlight.programmer.default=stlink
GenFlight.programmer.default=stlink_swd
GenFlight.vid.0=0x0483
GenFlight.pid.0=0x5740

Expand Down Expand Up @@ -12605,7 +12605,7 @@ IotContinuum.build.st_extra_flags=-D{build.product_line} {build.xSerial}
IotContinuum.build.flash_offset=0x0
IotContinuum.upload.maximum_size=0
IotContinuum.upload.maximum_data_size=0
IotContinuum.programmer.default=stlink
IotContinuum.programmer.default=stlink_swd
IotContinuum.vid.0=0x0483
IotContinuum.pid.0=0x5740

Expand Down Expand Up @@ -12651,7 +12651,7 @@ LoRa.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSeri
LoRa.build.flash_offset=0x0
LoRa.upload.maximum_size=0
LoRa.upload.maximum_data_size=0
LoRa.programmer.default=stlink
LoRa.programmer.default=stlink_swd
LoRa.vid.0=0x0483
LoRa.pid.0=0x5740

Expand Down Expand Up @@ -12807,7 +12807,7 @@ Midatronics.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {buil
Midatronics.build.flash_offset=0x0
Midatronics.upload.maximum_size=0
Midatronics.upload.maximum_data_size=0
Midatronics.programmer.default=stlink
Midatronics.programmer.default=stlink_swd
Midatronics.vid.0=0x0483
Midatronics.pid.0=0x5740

Expand Down Expand Up @@ -12858,7 +12858,7 @@ SparkFun.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.x
SparkFun.build.flash_offset=0x0
SparkFun.upload.maximum_size=0
SparkFun.upload.maximum_data_size=0
SparkFun.programmer.default=stlink
SparkFun.programmer.default=stlink_swd
SparkFun.vid.0=0x0483
SparkFun.pid.0=0x5740

Expand Down Expand Up @@ -12922,7 +12922,7 @@ ELV_Modular_System.build.board=ELV_Modular_System
ELV_Modular_System.build.variant_h=variant_{build.board}.h
ELV_Modular_System.upload.maximum_size=0
ELV_Modular_System.upload.maximum_data_size=0
ELV_Modular_System.programmer.default=stlink
ELV_Modular_System.programmer.default=stlink_swd
ELV_Modular_System.vid.0=0x0483
ELV_Modular_System.pid.0=0x5740

Expand Down
5 changes: 3 additions & 2 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ tools.stm32CubeProg.cmd=stm32CubeProg.sh
tools.stm32CubeProg.upload.params.verbose=
tools.stm32CubeProg.upload.params.quiet=
tools.stm32CubeProg.upload.pattern="{busybox}" sh "{path}/{cmd}" -i {upload.protocol} -f "{build.path}/{build.project_name}.bin" -o {build.flash_offset} {upload.options}
tools.stm32CubeProg.program.pattern="{busybox}" sh "{path}/{cmd}" -i {program.protocol} -f "{build.path}/{build.project_name}.bin" -o {build.flash_offset} {program.extra_params}

# blackmagic upload for generic STM32
tools.bmp_upload.cmd=arm-none-eabi-gdb
Expand Down Expand Up @@ -245,5 +246,5 @@ debug.server=openocd
debug.server.openocd.path={openocd_dir}/bin/openocd
debug.server.openocd.scripts_dir={openocd_dir}/openocd/scripts
# Common config
debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
debug.server.openocd.scripts.1={programmer.transport_script}
debug.server.openocd.scripts.0=interface/stlink.cfg
debug.server.openocd.scripts.1={runtime.platform.path}/debugger/select_hla.cfg
32 changes: 23 additions & 9 deletions programmers.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
stlink.name=STMicroelectronics ST-LINK
stlink.communication=USB
stlink.protocol=
stlink.program.protocol=
stlink.program.tool=openocd
stlink.program.tool.default=openocd
stlink.program.extra_params=
stlink.programmer.protocol=stlink
stlink.programmer.transport_script={runtime.platform.path}/debugger/select_hla.cfg
stlink_swd.name=STMicroelectronics ST-LINK (swd)
stlink_swd.communication=USB
stlink_swd.protocol=swd
stlink_swd.program.protocol=swd
stlink_swd.program.tool=stm32CubeProg
stlink_swd.program.tool.default=stm32CubeProg
stlink_swd.program.extra_params=

stlink_serial.name=STMicroelectronics ST-LINK (serial)
stlink_serial.communication=USB
stlink_serial.protocol=serial
stlink_serial.program.protocol=serial
stlink_serial.program.tool=stm32CubeProg
stlink_serial.program.tool.default=stm32CubeProg
stlink_serial.program.extra_params=-c {serial.port.file}

stlink_dfu.name=STMicroelectronics ST-LINK (dfu)
stlink_dfu.communication=USB
stlink_dfu.protocol=dfu
stlink_dfu.program.protocol=dfu
stlink_dfu.program.tool=stm32CubeProg
stlink_dfu.program.tool.default=stm32CubeProg
stlink_dfu.program.extra_params=-v {upload.vid} -p {upload.pid}

0 comments on commit d739bec

Please sign in to comment.