主题中讨论的其他器件:C2000WARE、 TMS320F28069
您好、C2000专家、
项目代码即将发布、需要独立运行。 到目前为止、它的运行得益于仿真器。
该工程在早期就已耗尽 RAM 空间、因此修改了链接器命令文件以从闪存运行。 此时、当通过 仿真器(XDS100v3)从 CCS (v10.4、TI 编译器 v21.6.0.LTS)调用代码时、代码从闪存正常运行。
没有仿真器、代码就无法运行。
通过将 GPIO34和37保持在高电平、同时/TRST 保持在低电平、已配置引导模式3。 OTP 未更改。
链接器命令文件如下所示:
MEMORY { PAGE 0: /* Program Memory */ /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */ RAMM0 : origin = 0x000050, length = 0x000570 PRAML0 : origin = 0x008000, length = 0x000300 /* on-chip RAM block L0 */ OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */ CSM_RSVD : origin = 0x3F7F80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */ BEGIN : origin = 0x3F7FF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */ CSM_PWL_P0 : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASH. CSM password locations in FLASHA */ FLASH0 : origin = 0x3F4000, length = 0x002000 /* on-chp FLASH */ // FLASH1 : origin = 0x3F6000, length = 0x000500 /* on-chip FLASH */ FLASH2 : origin = 0x3F6000, length = 0x001000 /* on-chip FLASH */ FLASH3 : origin = 0x3F7000, length = 0x000f80 /* on-chip FLASH */ IQTABLES : origin = 0x3FE000, length = 0x000B50 /* IQ Math Tables in Boot ROM */ IQTABLES2 : origin = 0x3FEB50, length = 0x00008C /* IQ Math Tables in Boot ROM */ IQTABLES3 : origin = 0x3FEBDC, length = 0x0000AA /* IQ Math Tables in Boot ROM */ ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */ RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */ VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */ PAGE 1 : /* Data Memory */ /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */ /* Registers remain on PAGE1 */ BOOT_RSVD : origin = 0x000000, length = 0x000050 /* Part of M0, BOOT rom will use this for stack */ RAMM1 : origin = 0x000600, length = 0x000200 /* on-chip RAM block M1 */ DRAML0 : origin = 0x008300, length = 0x000100 /* on-chip RAM block L0 */ } /* Allocate sections to memory blocks. Note: codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code execution when booting to flash ramfuncs user defined section to store functions that will be copied from Flash into RAM */ SECTIONS { /* Allocate program areas: */ .cinit : > FLASH0 | FLASH1 | FLASH2 PAGE = 0 .pinit : > FLASH0 | FLASH1 | FLASH2 PAGE = 0 .text : > FLASH0, PAGE = 0 codestart : > BEGIN PAGE = 0 ramfuncs : LOAD = FLASH0, RUN = RAMM0 | PRAML0, LOAD_START(_RamfuncsLoadStart), LOAD_END(_RamfuncsLoadEnd), RUN_START(_RamfuncsRunStart), LOAD_SIZE(_RamfuncsLoadSize), PAGE = 0 csmpasswds : > CSM_PWL_P0 PAGE = 0 csm_rsvd : > CSM_RSVD PAGE = 0 /* Allocate uninitalized data sections: */ .stack : > RAMM1, PAGE = 1 .ebss : > DRAML0 | RAMM1, PAGE = 1 .esysmem : > DRAML0 | RAMM1, PAGE = 1 .cio : > DRAML0 | RAMM1, PAGE = 1 /* Initalized sections go in Flash */ /* For SDFlash to program these, they must be allocated to page 0 */ .econst : > FLASH0 | FLASH1 | FLASH2 PAGE = 0 .switch : > FLASH0 | FLASH1 | FLASH2 PAGE = 0 /* Allocate IQ math areas: */ IQmath : > PRAML0 PAGE = 0 /* Math Code */ IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD /* .reset is a standard section used by the compiler. It contains the */ /* the address of the start of _c_int00 for C Code. /* /* When using the boot ROM this section and the CPU vector */ /* table is not needed. Thus the default type is set here to */ /* DSECT */ .reset : > RESET, PAGE = 0, TYPE = DSECT vectors : > VECTORS PAGE = 0, TYPE = DSECT }
根据 TI C2000 MCU 1日专题讨论会、我注意到以下内容:
F2802x_CodeStartBranch.asm 已添加到项目中。 使用 CCS/仿真器、对器件进行编程并复位器件后、PC 位于0x3ff7bf。 然后、当 EMU_BOOT_FLASH 脚本运行时、并且我在反汇编窗口中单步执行(一组时间)以 codestartbranch 命令、然后我可以看到_c_int00是 LB 位置:
另外一个单步操作将使我进入程序的开始:
如果我在 Run 菜单下选择 Go Main、PC 会运行至 main 并停止。 这是否表示闪存已正确编程、并且引导加载程序已正确配置为跳转到闪存、一切准备就绪? 在这里、我可以点击 F8、程序正常运行。
当我拔下仿真器并重启目标电源时、程序不会运行。
问题1:
在没有仿真器的情况下、在目标系统上运行代码需要执行哪些步骤?
通过搜索论坛、我们不会缺少信息。 恰恰相反、这是令人无法抗拒的。
问题2:
有人能告诉我一份简要的文档来解释从仿真器运行代码到独立代码的迁移吗?
谢谢、
Robin