The target's debug would sometime get stuck while in low-power, making it difficult to resume communications, even after hardware resets. Some peripherals were also kept running when halted. This config should fix these issues
23 lines
641 B
INI
23 lines
641 B
INI
|
|
# using a STM32f103CB wich has 128kB of flash instead of the more common 64KB
|
|
set CHIPNAME stm32f103CB
|
|
set FLASH_SIZE 0x20000
|
|
|
|
# load default configurations
|
|
source [find interface/stlink.cfg]
|
|
source [find target/stm32f1x.cfg]
|
|
|
|
# override examine-end event
|
|
$CHIPNAME.cpu configure -event examine-end {
|
|
# write DBGMCU_CR, disable all peripherals (timers, dmas, watchdogs while
|
|
# halted by debug. Trace is not affected
|
|
mmw 0xE0042004 0x7E3FFF07 0
|
|
}
|
|
|
|
# inits debugging, from that point, commands can be used
|
|
init
|
|
# resets the target and halt it immediately afterward. Stops debug from being
|
|
# inacessible due to low-power states
|
|
reset halt
|
|
|