Other Parts Discussed in Thread: C2000WARE
主题中讨论的其他器件:C2000WARE
我正在使用闪存、我必须将这个函数复制到哪个文件?
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.
Other Parts Discussed in Thread: C2000WARE
我正在使用闪存、我必须将这个函数复制到哪个文件?
Manoj,
您在片段末尾看到的#pragma 是将其放入 RAM 所需的步骤之一。 其他2个是:
1)在.cmd 文件内、您应该会看到.TI.ramfunc 被放置为加载/运行段;加载到闪存中、然后从 RAM 运行
以下是位于以下位置的 GENERAL_FLASH_lnk.cmd 文件的示例:C:\ti\cc2000\C2000Ware_5_00_00_00\device_support\f280013x\common\cmd
#if defined(__TI_EABI__)
.TI.ramfunc : LOAD = FLASH_BANK0_SEC_0_7,
RUN = RAMLS0,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)
#else
.TI.ramfunc : LOAD = FLASH_BANK0_SEC_0_7,
RUN = RAMLS0,
LOAD_START(_RamfuncsLoadStart),
LOAD_SIZE(_RamfuncsLoadSize),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
RUN_SIZE(_RamfuncsRunSize),
RUN_END(_RamfuncsRunEnd),
ALIGN(8)
#endif
2)在程序中调用 initSysCtrl()之前,需要调用 memcopy 函数。 下面是我们的 sysctrl.c 文件;您会看到用于放置它的预定义"闪存"的编译时间#if、具体取决于编译是否用于闪存构建。 如果您始终计划为闪存构建代码、则可以删除此代码所在的#if。
oid InitSysCtrl(void)
{
//
// Disable the watchdog
//
DisableDog();
#ifdef _FLASH
//
// Copy time critical code and Flash setup code to RAM. This includes the
// following functions: InitFlash()
//
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
// symbols are created by the linker. Refer to the device .cmd file.
//
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
//
// Call Flash Initialization to setup flash waitstates. This function must
// reside in RAM.
//
InitFlash();
#endif
此致!
马修
Manoj,
看看这篇文章 https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/618792/tms320f28027-how-does-emulation-boot-mode-is-configured ,在 F280013x 上的实现可能会略有不同,但概念是相同的。 在 CCS 主工具栏的"Scripts"下应该可以一键式地设置此设置。
器件 TRM 还讨论了 EMUBOOT 流 https://www.ti.com/lit/pdf/spruix1
此致!
马修