flash Kinetis: handle all types of watchdog, disable in reset-init
[openocd.git] / contrib / loaders / watchdog / armv7m_kinetis_wdog.s
index bac924ab805dbac45f26fc8fae96577ae0dfea98..d7241927c96ff593a7def293e4b3db10bfad139d 100644 (file)
@@ -19,7 +19,9 @@
 
 /*
        Disable watchdog for Kinetis Kx and KVx
-       Parameters: none
+       Parameters:
+               r0 ... WDOG base (in)
+
        Used instruction set should work on both Cortex-M4 and M0+
 */
 
@@ -28,7 +30,6 @@
         .cpu cortex-m0
        .thumb
 
-WDOG_ADDR      = 0x40052000
 /* WDOG registers offsets */
 WDOG_STCTRLH   = 0
 WDOG_UNLOCK    = 0x0e
@@ -39,17 +40,16 @@ WDOG_KEY2   = 0xd928
        .thumb_func
 start:
 /* WDOG_UNLOCK = 0xC520 */
-       ldr     r3, =WDOG_ADDR
        ldr     r2, =WDOG_KEY1
-       strh    r2, [r3, WDOG_UNLOCK]
+       strh    r2, [r0, WDOG_UNLOCK]
 /* WDOG_UNLOCK = 0xD928 */
        ldr     r2, =WDOG_KEY2
-       strh    r2, [r3, WDOG_UNLOCK]
+       strh    r2, [r0, WDOG_UNLOCK]
 /* WDOG_STCTRLH clear bit 0 */
        movs    r4, #1
-       ldrh    r2, [r3, WDOG_STCTRLH]
+       ldrh    r2, [r0, WDOG_STCTRLH]
        bics    r2, r4
-       strh    r2, [r3, WDOG_STCTRLH]
+       strh    r2, [r0, WDOG_STCTRLH]
 /* OpenOCD checks exit point address. Jump to the very end. */
        b       done
 

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)