Thread 中讨论的其他器件:C2000WARE
工具与软件:
您好!
我已经完成了有关该主题的其他线程、但我仍然不太了解某些内容。
我要为280039C 创建定制 SPI 引导加载程序。 我希望此自定义 SPI 引导加载程序位于紧随其后的第一个闪存扇区中
"开始" : origin = 0x00080000, length = 0x00000002
/*闪存扇区*/
/*组0 */
SPI_BOOT_LOADER:origin = 0x080002、length = 0x000FFE
我将使用 C:\ti\c2000\C2000Ware_5_02_00_00\libraries\boot_rom\f28003x 中的引导 ROM 代码作为引导加载程序的起点。
我正在尝试了解这一切将如何工作的顺序。 我逐步完成了一个现有的 C2000Ware 项目。
在 linker.cmd 文件中、在闪存的开头有以下部分
begin :origin = 0x00080000、length = 0x00000002
部分中)
{
codestart :> beging, align(8)
在下载的应用程序中查看此位置、您会看到以下内容:

其中有用于跳转到0x8324D 的 OP 代码、 f28003x_codestartbranch.asm 所在的位置。
0008324d 00000008 f28003x_codestartbranch.obj (.text)
其中包含以下代码:
WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0
.ref _c_int00
.global code_start
***********************************************************************
* Function: codestart section
*
* Description: Branch to code starting point
***********************************************************************
.sect "codestart"
.retain
code_start:
.if WD_DISABLE == 1
LB wd_disable ;Branch to watchdog disable code
.else
LB _c_int00 ;Branch to start of boot._asm in RTS library
.endif
;end codestart section
***********************************************************************
* Function: wd_disable
*
* Description: Disables the watchdog timer
***********************************************************************
.if WD_DISABLE == 1
.text
wd_disable:
SETC OBJMODE ;Set OBJMODE for 28x object code
EALLOW ;Enable EALLOW protected register access
MOVZ DP, #7029h>>6 ;Set data page for WDCR register
MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
EDIS ;Disable EALLOW protected register access
LB _c_int00 ;Branch to start of boot._asm in RTS library
.endif
;end wd_disable
.end
问题:那么、 在 f28003x_codestartbranch.asm 中包含 linker.cmd 文件- codestart:> begin、align (8)-和 code_start (请参阅上面的代码)、会将 f28003x_codestartbranch.asm 的地址放在 开始0x80000处? 不确定这是怎么工作的?
它从这里分支到 LB _c_int00 ;分支到 boot28.asm 中 RTS 库的 boot._asm 的起始位置。 这会在跳转到 main 之前初始化一系列内容:
LCR __args_main ; execute main()
问题:我不确定上电时需要执行什么操作跳转到 0x080002处的自定义引导加载程序代码?
问题 启动序列中是否需要 f28003x_codestartbranch.asm 和 boot28.asm? 如果答案是肯定的、它们当前驻留在我的 SPI_BOOT_LOADER 段之外的.text 段中 。 我如何将其移至 SPI_BOOT_LOADER 部分?
感谢您的任何帮助、
Brent