This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
C:\TI\TivaWare_C_Series-1.0\boot_loader 里面的bl_link_ccs.cmd 文件:
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00010000
SRAM (RWX) : origin = 0x20000000, length = 0x00010000
}
/* Section allocation in memory */
SECTIONS
{
GROUP
{
.intvecs
.text
.const
.data
} load = FLASH, run = SRAM, LOAD_START(init_load), RUN_START(init_run), SIZE(init_size)
GROUP
{
.bss
.stack
} run = SRAM, RUN_START(bss_run), RUN_END(bss_end), SIZE(bss_size), RUN_END(__STACK_TOP)
}
怎样才能改成让 bootload 程序从flash开始运行?
我们在仿真调试这段程序时,发现 程序从RAM 0x20000000地址 开始运行,反汇编后可以看到 一段 从flash 把代码复制代码 到 0x200000xx。
就会出现当 随着偏移指针的增加 会覆盖 当前pc指针指向的地址。这时程序就出错,跳转向一个 异常陷阱。
所以我觉得要修改CMD文件让程序仿真时, 从FLASH 0x00000000开始运行。
bss_run bss_end bss_size __STACK_TOP init_load init_size 这些都不知道在那里定义的。
很不理解这个boot load 例子程序 的cmd文件为什么要这样写
平时我们使用的cmd文件很简单清晰, 如下:
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00040000
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
}
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
__STACK_TOP = __stack + 512;
Thomas 你好
对于Flash_based boot loader,复位后,会先将boot loader copy到RAM中运行,不能够直接在Flash中运行。
具体可参考Tivaware boot loader user guide 中的Startup Code部分