flash: cleanup stm32f2x loader
authorSpencer Oliver <spen@spen-soft.co.uk>
Mon, 14 Nov 2011 13:33:30 +0000 (13:33 +0000)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 18 Nov 2011 16:57:23 +0000 (16:57 +0000)
Change-Id: I89efdc45bcd61ded437d67d4cbee4c53345d4d76
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/197
Tested-by: jenkins
src/flash/nor/stm32f2x.c

index 0e8cec306fbb56eb6154d51705ddf33b8d001c54..6f041b10f8c85c3c9d1a93be843393621840d8d3 100644 (file)
@@ -317,29 +317,28 @@ static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer,
        /* see contrib/loaders/flash/stm32f2x.S for src */
 
        static const uint16_t stm32x_flash_write_code_16[] = {
        /* see contrib/loaders/flash/stm32f2x.S for src */
 
        static const uint16_t stm32x_flash_write_code_16[] = {
-//     00000000 <write>:
-          0x4b07, //           ldr     r3, [pc, #28]   (20 <STM32_PROG16>)
-          0x6123,  //          str     r3, [r4, #16]
-       0xf830, 0x3b02,         //ldrh.w        r3, [r0], #2
-       0xf821, 0x3b02,         //strh.w        r3, [r1], #2
-
-       //0000000c <busy>:
-       0x68e3,         //ldr   r3, [r4, #12]
-0xf413, 0x3f80, //     tst.w   r3, #65536      ; 0x10000
-0xd0fb,        //beq.n c <busy>
-0xf013, 0x0ff0,        //tst.w r3, #240        ; 0xf0
-0xd101,        //bne.n 1e <exit>
-0x3a01,        //subs  r2, #1
-0xd1f0,        //bne.n 0 <write>
-                               //0000001e <exit>:
-       0xbe00, //              bkpt    0x0000
-
-       //00000020 <STM32_PROG16>:
-       0x0101, 0x0000, //      .word   0x00000101
-
+               /* 00000000 <write>: */
+               0x4b07,                         /* ldr          r3, [pc, #28] (20 <STM32_PROG16>) */
+               0x6123,                         /* str          r3, [r4, #16] */
+               0xf830, 0x3b02,         /* ldrh.w       r3, [r0], #2 */
+               0xf821, 0x3b02,         /* strh.w       r3, [r1], #2 */
+
+               /* 0000000c <busy>: */
+               0x68e3,                         /* ldr          r3, [r4, #12] */
+               0xf413, 0x3f80,         /* tst.w        r3, #65536      ; 0x10000 */
+               0xd0fb,                         /* beq.n        c <busy> */
+               0xf013, 0x0ff0,         /* tst.w        r3, #240        ; 0xf0 */
+               0xd101,                         /* bne.n        1e <exit> */
+               0x3a01,                         /* subs         r2, #1 */
+               0xd1f0,                         /* bne.n        0 <write> */
+                                                       /* 0000001e <exit>: */
+               0xbe00,                         /* bkpt         0x0000 */
+
+               /* 00000020 <STM32_PROG16>: */
+               0x0101, 0x0000,         /* .word        0x00000101 */
        };
 
        };
 
-       // Flip endian
+       /* Flip endian */
        uint8_t stm32x_flash_write_code[sizeof(stm32x_flash_write_code_16)*2];
        for (unsigned i = 0; i < sizeof(stm32x_flash_write_code_16) / 2; i++)
        {
        uint8_t stm32x_flash_write_code[sizeof(stm32x_flash_write_code_16)*2];
        for (unsigned i = 0; i < sizeof(stm32x_flash_write_code_16) / 2; i++)
        {

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)