从BL1跳转到BL2

来源:互联网 发布:拜特软件 编辑:程序博客网 时间:2024/05/21 20:27

跳转的方式有两种,相对跳转和绝对跳转。
相对跳转也即用B,BL汇编指令;
绝对跳转即对PC寄存器赋值。
从BL1跳转到BL2采用绝对跳转。代码很简单:ldr pc, =gboot_main
跳转是否成功可通过点亮led灯验证。

代码:

#define GPBCON (volatile unsigned long*)0x56000010#define GPBDAT (volatile unsigned long*)0x56000014int gboot_main(){    *(GPBCON) = 0x15400;    *(GPBDAT) = 0x6BF;    return 0;    }
0 0