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.

[参考译文] 编译器/TMS320F28069:链接闪存 API 问题

Guru**** 2606725 points
Other Parts Discussed in Thread: C2000WARE

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/682370/compiler-tms320f28069-linking-flash-api-problems

器件型号: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);
} 


  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你好

    您可以在项目中像典型文件一样包含闪存 API 符号库、它不必像您正在执行的那样进行设置(加载/运行)。 符号库只是全局闪存 API 函数符号、它们在 ROM 中具有关联的函数地址。 当使用 ROM 中的闪存 API 时、无需将其复制到 RAM 即可运行。 查看 C2000Ware 中 F2806x 的/libraries 下的闪存 API 示例、这将向您展示要执行的操作。

    另见 :processors.wiki.ti.com/.../C28x_Compiler_-_Understanding_Linking

    此致
    Chris
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我没有意识到闪存 API 位于 ROM 中。 没有真正查看库文件的名称以查看其名称中是否有符号。 tou 正确、我不需要将函数加载到 RAM 中。 我刚刚按照闪存 API 自述文件中的步骤6操作。

    如果将来有人遇到这种情况:

    我的代码实际上不起作用的原因是我没有定义 EMUKeyVar 和 EMUBModeVar。 这意味着我的 FlashScalingVar 指针偏移2、因为我使用的是默认的 F2806x_Headers_nonBIOS.cmd 文件。

    我解决这个问题的所有方法都是添加的  

    #pragma DATA_SECTION (EMUKey、"EmuKeyVar");
    UINT16 EMUKey;
    #pragma DATA_SECTION (EMUBMode、"EmUBModeVAR");
    UINT16 EMUBMode; 

    一切都在进行中、感谢您的帮助

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    很高兴听到您的意见!

    此致
    Chris