Skip to content

Commit

Permalink
tfc/target: stm32: Fix missing DBG clock on stm32g0/l0
Browse files Browse the repository at this point in the history
On stm32g0 and stm32l0 series, DGCMCU clock should be enabled
before any access.
This was missing, fix this.

Signed-off-by: Erwan Gouriou <[email protected]>
  • Loading branch information
erwango authored and aaillet committed May 9, 2022
1 parent ed3af77 commit f82d434
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tcl/target/stm32g0x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ proc stm32g0x_default_reset_start {} {
}

proc stm32g0x_default_examine_end {} {
# Enable DBG clock
# RCC_APB1ENR |= DBGEN
mmw 0x4002103C 0x08000000 0

# DBGMCU_CR |= DBG_STANDBY | DBG_STOP
mmw 0x40015804 0x00000006 0

Expand Down
4 changes: 4 additions & 0 deletions tcl/target/stm32l0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ $_TARGETNAME configure -event reset-start {
}

$_TARGETNAME configure -event examine-end {
# Enable DBG clock
# RCC_APB2ENR |= DBGMCUEN
mmw 0x40001024 0x00400000 0

# DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP
mmw 0x40015804 0x00000007 0

Expand Down

0 comments on commit f82d434

Please sign in to comment.