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.
您好!
我在评估板 LAUNCHXL-F280025C 上使用 TMS320F280025C、目前为止一切都正常。
现在、我需要一个引导加载程序、在该程序中、我可以通过 CAN 在现场进行一些固件更新。 现在我已经挂断了
查找 F280025C 的引导加载程序示例(未加密且通过 UART/SCI 进行加密)、因为 中根本没有示例(甚至没有闪烁的 LED)
F280025C 的 C2000Ware_4_00_00_00 SDK 文件夹。
您是否在某个位置通过串行接口提供引导加载程序示例? 能否从应用程序触发引导加载程序而不是使用 GPIO 引脚?
我能否捕获数据并手动将其提供给引导加载程序、以便我可以事先进行说明?
我已经在 STM32控制器上做过很多次了、在那里可以获得令人惊叹的支持。 希望您可以提供类似的内容。
您可以从应用程序调用引导加载程序 API。但我将完成到 RAM 的完整传输、然后返回。因此、您无法并行进行解密。
C2000ware 中提供了使用 SCI 来使用引导加载程序的示例- C:\ti\c2000Ware_4_01_00_00_new\driverlib\f28002x\examples\fflash
TRM 中的"4.8使用引导加载程序的应用手册"部分可能会有所帮助。
谢谢、这是非常有益的。 因此、借助应用闪存 API、我可以 通过我选择的通信接口接收加密的数据包、并始终将解码 后的数据包作为 RAM 的整个扇区进行闪存。
我目前不确定的是、如何 从引导加载程序本身跳转到应用程序闪存地址。 尤其是我需要在链接器文件中更改什么?
我发现、在示例 flash_kernel_ex3_sci_flash_kernel 中、flash_kernel_ex3_codestartbranch 中存在以下代码:
;----------------------------------------------- ; ExitBoot ;----------------------------------------------- ;----------------------------------------------- ;This module cleans up after the boot loader ; ; 1) Make sure the stack is deallocated. ; SP = 0x400 after exiting the boot ; loader ; 2) Push 0 onto the stack so RPC will be ; 0 after using LRETR to jump to the ; entry point ; 2) Load RPC with the entry point ; 3) Clear all XARn registers ; 4) Clear ACC, P and XT registers ; 5) LRETR - this will also clear the RPC ; register since 0 was on the stack ;----------------------------------------------- ExitBoot: __stack: .usect ".stack",0 ;----------------------------------------------- ; Insure that the stack is deallocated ;----------------------------------------------- MOV SP,#__stack ;----------------------------------------------- ; Clear the bottom of the stack. This will endup ; in RPC when we are finished ;----------------------------------------------- MOV *SP++,#0 MOV *SP++,#0 ;----------------------------------------------- ; Load RPC with the entry point as determined ; by the boot mode. This address will be returned ; in the ACC register. ;----------------------------------------------- PUSH ACC POP RPC ;----------------------------------------------- ; Put registers back in their reset state. ; ; Clear all the XARn, ACC, XT, and P and DP ; registers ; ; NOTE: Leave the device in C28x operating mode ; (OBJMODE = 1, AMODE = 0) ;----------------------------------------------- ZAPA MOVL XT,ACC MOVZ AR0,AL MOVZ AR1,AL MOVZ AR2,AL MOVZ AR3,AL MOVZ AR4,AL MOVZ AR5,AL MOVZ AR6,AL MOVZ AR7,AL MOVW DP, #0 ;------------------------------------------------ ; Restore ST0 and ST1. Note OBJMODE is ; the only bit not restored to its reset state. ; OBJMODE is left set for C28x object operating ; mode. ; ; ST0 = 0x0000 ST1 = 0x0A0B ; 15:10 OVC = 0 15:13 ARP = 0 ; 9: 7 PM = 0 12 XF = 0 ; 6 V = 0 11 M0M1MAP = 1 ; 5 N = 0 10 reserved ; 4 Z = 0 9 OBJMODE = 1 ; 3 C = 0 8 AMODE = 0 ; 2 TC = 0 7 IDLESTAT = 0 ; 1 OVM = 0 6 EALLOW = 0 ; 0 SXM = 0 5 LOOP = 0 ; 4 SPA = 0 ; 3 VMAP = 1 ; 2 PAGE0 = 0 ; 1 DBGM = 1 ; 0 INTM = 1 ;----------------------------------------------- MOV *SP++,#0 MOV *SP++,#0x0A0B POP ST1 POP ST0 ;------------------------------------------------ ; Jump to the EntryAddr as defined by the ; boot mode selected and continue execution ;----------------------------------------------- LRETR ;eof ---------- .end
当我在闪存扇区5刷写我的应用并启动此应用时、当 main 返回跳转地址时、它将运行代码、但在我重置控制器后、引导加载程序永远不会再次启动、它会立即跳转到该应用程序。 我是否可以在启动时始终运行引导加载程序? 为了实现这一点、我需要在.asm 文件中修改哪些内容?
编辑:我认为我错了、引导加载程序似乎永远不会跳转到地址、它会以某种方式引导始终位于扇区5开始闪存地址的应用程序
您不需要使用 asm 文件进行跳转。 您可以使用下面的示例等简单指令、并跳转至应用的起始地址。
asm (" lb 0x8EFF0");