tcl/stm32u5x: fix clock config used at 'reset init' 97/6597/4
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>
Thu, 16 Sep 2021 16:47:31 +0000 (17:47 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 19 Mar 2022 09:12:59 +0000 (09:12 +0000)
Change-Id: If004a04b93be47439809ea3fa336b14de7a12277
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6597
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
tcl/target/stm32u5x.cfg

index b627d41803417e1eb75c2fb4bd3df2058939c650..44b51e2b65c5507ea1e4700446bcf6fe52cd4d2f 100644 (file)
@@ -22,21 +22,24 @@ proc stm32u5x_clock_config {} {
        # RCC_AHB3ENR = PWREN
        mww [expr {0x46020C94 + $offset}] 0x00000004
        # delay for register clock enable (read back reg)
-       mrw [expr {0x56020C94 + $offset}]
+       mrw [expr {0x46020C94 + $offset}]
        # PWR_VOSR : VOS Range 1
-       mww [expr {0x4602080C + $offset}] 0x00030000
-       # delay for register write (read back reg)
-       mrw [expr {0x4602080C + $offset}]
+       mmw [expr {0x4602080C + $offset}] 0x00030000 0
+       # while !(PWR_VOSR & VOSRDY)
+       while {!([mrw [expr {0x4602080C + $offset}]] & 0x00008000)} {}
        # FLASH_ACR : 4 WS for 160 MHz HCLK
        mww [expr {0x40022000 + $offset}] 0x00000004
-       # RCC_PLL1CFGR => PLL1M=0000=/1, PLL1SRC=MSI 4MHz
-       mww [expr {0x46020C28 + $offset}] 0x00000001
+       # RCC_PLL1CFGR => PLL1MBOOST=0, PLL1M=0=/1, PLL1FRACEN=0, PLL1SRC=MSI 4MHz
+       #                 PLL1REN=1, PLL1RGE => VCOInputRange=PLLInputRange_4_8
+       mww [expr {0x46020C28 + $offset}] 0x00040009
+       # Enable EPOD Booster
+       mmw [expr {0x4602080C + $offset}] 0x00040000 0
+       # while !(PWR_VOSR & BOOSTRDY)
+       while {!([mrw [expr {0x4602080C + $offset}]] & 0x00004000)} {}
        # RCC_PLL1DIVR => PLL1P=PLL1Q=PLL1R=000001=/2, PLL1N=0x4F=80
        # fVCO = 4 x 80 /1 = 320
        # SYSCLOCK = fVCO/PLL1R = 320/2 = 160 MHz
-       mmw [expr {0x46020C34 + $offset}] 0x0000004F 0
-       # RCC_PLL1CFGR => PLL1REN=1
-       mmw [expr {0x46020C28 + $offset}] 0x00040000 0
+       mww [expr {0x46020C34 + $offset}] 0x0101024F
        # RCC_CR |= PLL1ON
        mmw [expr {0x46020C00 + $offset}] 0x01000000 0
        # while !(RCC_CR & PLL1RDY)

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)