# Emcraft STM32F7 SOM, driven from a brintOS machine over an Olimex # ARM-USB-TINY-H granted through WebUSB. # # The adapter is not named here: mfg-jtag.cfg names it, and every per-SOM config # in this image sources that one file. The indirection is the station's own (see # the file), and it keeps the adapter one setting rather than an edit to each # board config -- which matters because the adapter and the WebUSB grant have to # name the same device. Another adapter is `som-program-f7 --adapter `, or # BRINTOS_JTAG_IFACE set before this file is sourced; nothing here changes. source [find mfg-jtag.cfg] # The adapter's own first transport unless the caller names one # (`som-program-f7 --transport swd`, or BRINTOS_JTAG_TRANSPORT set before this # file is sourced): jtag for the Olimex and the J-Link, hla_swd for an ST-Link, # which offers no plain jtag. target/stm32f7x.cfg creates the DAP for whichever # transport ends up selected. if {[info exists BRINTOS_JTAG_TRANSPORT]} { transport select $BRINTOS_JTAG_TRANSPORT } # STM32F756, per the station's olimex-arm-usb-ocd-h-stm32f7.cfg. Its work area # is raised from the 128 KB stm32f7x.cfg default, as the station raised it. set CHIPNAME STM32F756 set WORKAREASIZE 0x40000 source [find target/stm32f7x.cfg] # The connect speed, before any reset: the station's 150 kHz. adapter speed 150 # --------------------------------------------------------------------------- # THE SPEED AFTER A RESET IS CHOSEN HERE, BECAUSE OTHERWISE stm32f7x.cfg CHOOSES # IT AND NOTHING SAYS SO. # # openocd 0.12's target/stm32f7x.cfg installs `reset-start { adapter speed 2000 }`, # which fires on every reset and overrides whatever the board config set. # Measured on this bench 2026-09-18: `adapter speed` reads 150 kHz after `init` # and 2000 kHz after `reset halt`. So the line above governs the connect and # nothing else, and every flash write -- which follows the `reset init` inside # openocd's own `program` -- ran at 2 MHz whether or not anyone chose that. # # The station did choose 150 kHz and kept it: its openocd 0.9.0 target file sets # adapter_khz 2000 at load and installs no reset handler, so its board file's # later 150 stood for the whole run. The override is a 0.12 behaviour, not # something inherited from the station. # # 2 MHz is this image's default because it is what the write costs -- measured # into this SOM's memory from the host, 11.8 KiB/s at 150 kHz against 141 KiB/s # at 2 MHz, with the readback matching at both -- and because it is safe # straight out of reset, where the core runs from the 16 MHz HSI and the adapter # wants to stay under F_CPU/6. # # Override one run with `-c "set BRINTOS_JTAG_SPEED "` BEFORE -f, which is # what `som-program-f7 --speed` does. if {![info exists BRINTOS_JTAG_SPEED]} { set BRINTOS_JTAG_SPEED 2000 } $_TARGETNAME configure -event reset-end "adapter speed $BRINTOS_JTAG_SPEED"