source [find interface/stlink.cfg]
source [find target/stm32g4x.cfg]
reset_config srst_only srst_nogate
init
reset halt
stm32g4x unlock 0
reset halt
flash probe 0
# Uncomment the following lines for ITM logging to "itm.fifo" and adapt core
# clock (16MHz by default) and pin frequency if necessary:
#stm32g4x.tpiu configure -protocol uart -traceclk 16000000 -pin-freq 8000000 -output itm.fifo -formatter off
#stm32g4x.tpiu enable
#itm ports on