Documentation: fix warning "unbalanced square brackets"
[openocd.git] / contrib / loaders / flash / nrf5 / nrf5.S
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4 * Copyright (C) 2014 Angus Gratton *
5 * gus@projectgus.com *
6 ***************************************************************************/
7
8 .text
9 .syntax unified
10 .cpu cortex-m0
11 .thumb
12
13 /*
14 * Params :
15 * r0 = byte count
16 * r1 = buffer start
17 * r2 = buffer end
18 * r3 = target address
19 * r6 = watchdog refresh value
20 * r7 = watchdog refresh register address
21 */
22
23 .thumb_func
24 .global _start
25 _start:
26 wait_fifo:
27 // Kick the watchdog
28 str r6, [r7, #0]
29 // Load write pointer
30 ldr r5, [r1, #0]
31 // Abort if it is NULL
32 cmp r5, #0
33 beq.n exit
34 // Load read pointer
35 ldr r4, [r1, #4]
36 // Continue waiting if it equals the write pointer
37 cmp r4, r5
38 beq.n wait_fifo
39 // Copy one word from buffer to target, and increment pointers
40 ldmia r4!, {r5}
41 stmia r3!, {r5}
42 // If at end of buffer, wrap back to buffer start
43 cmp r4, r2
44 bcc.n no_wrap
45 mov r4, r1
46 adds r4, #8
47 no_wrap:
48 // Update read pointer inside the buffer
49 str r4, [r1, #4]
50 // Deduce the word transferred from the byte count
51 subs r0, #4
52 // Start again
53 bne.n wait_fifo
54 exit:
55 // Wait for OpenOCD
56 bkpt #0x00
57
58 .pool

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)