您好!
我查看了 TI 定制 BL 示例、并在 TI 示例中配置了我的 AS:
链接器文件:
PVECS1 : org = 0x00000800, len = 0x00000004 /* copy of vector table for main FW */
.
.
.pvectors1 : {} > PVECS1
.
.
加载 asm 文件:
.global _user_main . . .sect ".pvectors1" .state32 _user_main
然后在 main.c 中,我声明函数: void user_main (void);我只需调用它跳转到 main FW:user_main();
针对它的 asm 输出是正确的、但不是完美的(B 可用于代替 BL)、_user_main 常数也被正确定义为0x800:
.dwpsn file "../main.c",line 64,column 13,is_stmt,isa 1
$C$DW$41 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$41, DW_AT_low_pc(0x00)
.dwattr $C$DW$41, DW_AT_name("_user_main")
.dwattr $C$DW$41, DW_AT_TI_call
BL _user_main ; [] |64|
; CALL OCCURS {_user_main } ; [] |64|
我收到了常规警告: 警告#10441-D:生成符号"_user_main"的 trampoline、该符号位于不可执行段中
但链接器不想将其组合在一起: user_main();就像调用 nop 一样:它不做任何事情。 我可以使用标准 C hack 跳转到主固件: ((void (*)(void)) 0x800)();
奇怪的是、将常规中断转发到主 FW 工作正常:
linker:
PVECS2 : org = 0x00000804, len = 0x00000004 /* Vector table */
.
.
.pvectors2 : {} > PVECS2
.
.
asm:
.sect ".bvectors"
.state32
B b_int00 ;after reset jump to BL main
B vec_2 ;forward interrupt to main FW
.
.
.
.sect ".pvectors2"
.state32
vec_2