1 /***************************************************************************
2 * Copyright (C) 2011 by Andreas Fritiofson *
3 * andreas.fritiofson@gmail.com *
5 * Copyright (C) 2013 by Paul Fertser *
6 * fercerpav@gmail.com *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
22 ***************************************************************************/
32 * r0 - flash base (in), status (out)
40 * r7 - current FLASH_CMD
43 #define FLASH_CMD 0x00
44 #define FLASH_ADR 0x04
47 #define FLASH_NVSTR (1 << 13)
48 #define FLASH_PROG (1 << 12)
49 #define FLASH_MAS1 (1 << 11)
50 #define FLASH_ERASE (1 << 10)
51 #define FLASH_SE (1 << 8)
52 #define FLASH_YE (1 << 7)
53 #define FLASH_XE (1 << 6)
55 ldr r7, [r0, #FLASH_CMD]
57 ldr r6, [r2, #0] /* read wp */
58 cmp r6, #0 /* abort if wp == 0 */
60 ldr r5, [r2, #4] /* read rp */
61 cmp r5, r6 /* wait until rp != wp */
64 ldr r6, [r5] /* "*target_address++ = *rp++" */
65 str r4, [r0, #FLASH_ADR]
66 str r6, [r0, #FLASH_DI]
68 ldr r6, =(FLASH_XE | FLASH_PROG)
70 str r7, [r0, #FLASH_CMD]
76 str r7, [r0, #FLASH_CMD]
82 str r7, [r0, #FLASH_CMD]
88 str r7, [r0, #FLASH_CMD]
91 str r7, [r0, #FLASH_CMD]
95 ldr r6, =#(FLASH_XE | FLASH_NVSTR)
97 str r7, [r0, #FLASH_CMD]
102 cmp r5, r3 /* wrap rp at end of buffer */
107 str r5, [r2, #4] /* store rp */
108 subs r1, r1, #1 /* decrement word count */
110 beq exit /* loop if not done */
113 mov r0, r6 /* return status in r0 */
117 * for r6 == 1 it'll take:
118 * 1 (prepare operand) + 4 (bl) + 2 (subs+cmp) + 1 (bne) + 3 (b) ->
119 * 11 tacts == 1.4us with 8MHz
120 * every extra iteration will take 5 tacts == 0.6us */
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)