请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F28069 主题中讨论的其他器件:C2000WARE
工具/软件:TI C/C++编译器
我在链接到闪存 API 时遇到问题。 在链接器文件的 SECTIONS 部分、我有以下行
组 :load = app_flash, 运行= RAML0_1、 load_start (_RamfuncsLoadStart)、 load_end (_RamfuncsLoadEnd)、 run_start (_RamfuncsRunStart)、 CRC_TABLE (_CRCestVector)、 PAGE = 0 { ramfuncs {-l "2806x_BootROM_API_TABLE_Symbols.lib"(.econst)} {-l "2806x_BootROM_API_TABLE_Symbols.lib"(.text)} }
但是、在库包含中、我收到警告"警告#10068-D:无匹配段"、我在链接器路径中包含了库的路径。 我还确保 在我的代码中调用 Flash2806X_Program()函数。 因此、它应该使用库。
#include "Flash2806X_API_Config.h" #include "Flash2806X_API_Library.h"
也包含在其中。
为了使链接器文件拾取该库正在使用、我需要采取哪些不同的措施?
作为参考、我的代码如下所示:
#include "sw/drivers/CCPU/src/32b/F28x/f2806x/cpu.h"
#include "Flash2806x_api_Config.h"
#include "Flash2806x_api_Library.h"
#include "variables.h"
//-----
#ifdef __cplusplus
#pragma DATA_SECTION ("FlashScalingVar");
#else
#pragma DATA_SECTION (Flash_CPUScaleFactor、"FlashScalingVar");
#endif
UINT32 Flash_CPUScaleFactor;
//---
#ifdef __cplusplus
#pragma DATA_SECTION ("FlashCallbackVar");
#else
#pragma DATA_SECTION (Flash_CallbackPtr、"FlashCallbackVar");
#endif
void (* Flash_CallbackPtr)(void);
Flash_ST FlashG_FlashStatus;
struct parameterage_Storage_Instruct
(void)(void)
EALLOW;
Flash_CPUScaleFactor = scale_factor;
#ifdef ENABLE_Watchdog
Flash_CallbackPtr = FlashAPICallback;
#else
Flash_CallbackPtr = 0;
#endif
EDIS;
}
void storeParameters(){
uint16_t 索引=* parameterStorage.indexCurrent;
uint16状态;
int i;
if (!index){
返回;
}
I = 0;
while (index ==* parameterStorage.indexCurrent){
index &=~((uint16_t)(1 << i));
i++;
}
状态= Flash2806x_Program (((UINT16 *) parameterStorage.indexCurrent、(UINT16 *)&INDEX、sizeof (index)、&g_FlashStatus);
}