Skip to content

Commit

Permalink
[board] Add OpenOCD script for Nucleo-G0 boards
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Dec 19, 2019
1 parent 4bb60b5 commit fb21f62
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/modm/board/nucleo_g071rb/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def prepare(module, options):
return False

module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2",
":debug", ":architecture:clock", ":architecture:clock")
":debug", ":architecture:clock")
return True

def build(env):
Expand All @@ -32,7 +32,12 @@ def build(env):
env.template("../board.cpp.in", "board.cpp")
env.copy('.')

# Waiting on this patch to OpenOCD http://openocd.zylin.com/#/c/4807
# env.outbasepath = "modm/openocd/modm/board/"
# env.copy(repopath("tools/openocd/modm/st_nucleo_g0.cfg"), "st_nucleo_g0.cfg")
# env.collect(":build:openocd.source", "modm/board/st_nucleo_g0.cfg")
# Waiting on OpenOCD to add support for STM32G0
env.log.warning("\nUploading firmware and debugging for STM32G0 via OpenOCD requires this patch: http://openocd.zylin.com/#/c/4807"
"\nAlternatively you may copy the compiled binary onto the Nucleo USB Mass-Storage Device manually:"
"\n $ scons bin && cp path/to/build/release/project.bin /Volumes/NODE_G071RB")

# The patch doesn't include board config file though
env.outbasepath = "modm/openocd/modm/board/"
env.copy(repopath("tools/openocd/modm/st_nucleo_g0.cfg"), "st_nucleo_g0.cfg")
env.collect(":build:openocd.source", "modm/board/st_nucleo_g0.cfg")
11 changes: 11 additions & 0 deletions tools/openocd/modm/st_nucleo_g0.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Should work with all STM32G0 Nucleo Dev Boards.
# http://www.st.com/en/evaluation-tools/stm32-mcu-nucleo.html

source [find interface/stlink.cfg]

transport select hla_swd

source [find target/stm32g0x.cfg]

# use hardware reset
reset_config srst_only srst_nogate

0 comments on commit fb21f62

Please sign in to comment.