1 /***************************************************************************
2 * Copyright (C) 2017 Tomas Vanek *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc. *
18 ***************************************************************************/
21 Disable watchdog, 32-bit version for newer Kinetis
23 r0 ... WDOG32 base (in)
25 Used instruction set should work on both Cortex-M4 and M0+
33 /* WDOG registers offsets */
42 /* test WDOG_CS bit CMD32EN */
50 str r3, [r0, WDOG_CNT]
54 /* WDOG_CNT = key, halfword by halfword */
55 strh r3, [r0, WDOG_CNT]
57 strh r3, [r0, WDOG_CNT]
59 /* WDOG_CS: clear EN bit 7, set UPDATE bit 5 */
66 /* All active WDOG registers have to be updated, set dummy timeout */
67 /* WDOG_TOVAL = 0x400 */
69 str r3, [r0, WDOG_TOVAL]
70 /* OpenOCD checks exit point address. Jump to the very end. */
75 /* Avoid padding at .text segment end. Otherwise exit point check fails. */
76 .skip ( . - start + 2) & 2, 0