33.代码搬移

33.代码搬移

这节里的代码搬移是针对SRAM的:

  1. 起始地址:

2440的起始地址是0

6410的起始地址是0x0c000000.

210的起始地址是0x

6410:

210:

链接起始地址:

2440:0x30008000

6410:0x50008000

210:0x20008000

终点:就是lds的链接起始地址:

2440:0x30008000

6410:0x50008000

210:0x20008000

拷贝的大小是4KB:

2440:

copy_to_ram:

    ldr r0, =0x0

    ldr r1, =0x30008000

    add r3, r0, #1024*4

copy_loop:

    ldr r2, [r0], #4

    str r2, [r1], #4

    cmp r0, r3

    bne copy_loop

    

    mov pc, lr

6410:

copy_to_ram:

    ldr r0, =0x0c000000

    ldr r1, =0x50008000

    add r3, r0, #1024*4

copy_loop:

    ldr r2, [r0], #4

    str r2, [r1], #4

    cmp r0, r3

    bne copy_loop

    

    mov pc, lr

210:

copy_to_ram:

    ldr r0, =0xd0020000

    ldr r1, =0x20008000

    add r3, r0, #1024*4

copy_loop:

    ldr r2, [r0], #4

    str r2, [r1], #4

    cmp r0, r3

    bne copy_loop

    mov pc, lr

看到三个板子的代码都是一样的,只是起始地址和结束地址不一样。

原文地址:https://www.cnblogs.com/FORFISH/p/5188757.html