nrf5: Include generated loader code
[openocd.git] / src / flash / nor / nrf5.c
index 5bef8487c9704c1d437fe170107ed30c5905b2bf..c569c1800aac8213a5d591effc270f7733b97b59 100644 (file)
@@ -900,30 +900,6 @@ static int nrf5_erase_page(struct flash_bank *bank,
        return res;
 }
 
-static const uint8_t nrf5_flash_write_code[] = {
-       /* See contrib/loaders/flash/cortex-m0.S */
-/* <wait_fifo>: */
-       0x0d, 0x68,             /* ldr  r5,     [r1,    #0] */
-       0x00, 0x2d,             /* cmp  r5,     #0 */
-       0x0b, 0xd0,             /* beq.n        1e <exit> */
-       0x4c, 0x68,             /* ldr  r4,     [r1,    #4] */
-       0xac, 0x42,             /* cmp  r4,     r5 */
-       0xf9, 0xd0,             /* beq.n        0 <wait_fifo> */
-       0x20, 0xcc,             /* ldmia        r4!,    {r5} */
-       0x20, 0xc3,             /* stmia        r3!,    {r5} */
-       0x94, 0x42,             /* cmp  r4,     r2 */
-       0x01, 0xd3,             /* bcc.n        18 <no_wrap> */
-       0x0c, 0x46,             /* mov  r4,     r1 */
-       0x08, 0x34,             /* adds r4,     #8 */
-/* <no_wrap>: */
-       0x4c, 0x60,             /* str  r4, [r1,        #4] */
-       0x04, 0x38,             /* subs r0, #4 */
-       0xf0, 0xd1,             /* bne.n        0 <wait_fifo> */
-/* <exit>: */
-       0x00, 0xbe              /* bkpt 0x0000 */
-};
-
-
 /* Start a low level flash write for the specified region */
 static int nrf5_ll_flash_write(struct nrf5_info *chip, uint32_t address, const uint8_t *buffer, uint32_t bytes)
 {
@@ -935,6 +911,10 @@ static int nrf5_ll_flash_write(struct nrf5_info *chip, uint32_t address, const u
        struct armv7m_algorithm armv7m_info;
        int retval = ERROR_OK;
 
+       static const uint8_t nrf5_flash_write_code[] = {
+#include "../../../contrib/loaders/flash/nrf5/nrf5.inc"
+       };
+
        LOG_DEBUG("Writing buffer to flash address=0x%"PRIx32" bytes=0x%"PRIx32, address, bytes);
        assert(bytes % 4 == 0);
 

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)