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.

[参考译文] LAUNCHXL2-TMS57012:F021闪存 API 编译错误-未解析的符号 Fapi_enableEepromBankSectors、首先在./source/sys_main.obj 中引用

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1388051/launchxl2-tms57012-f021-flash-api-compilation-error---unresolved-symbol-fapi_enableeeprombanksectors-first-referenced-in-source-sys_main-obj

器件型号:LAUNCHXL2-TMS57012

工具与软件:

尊敬的 TI 工程师: 

我使用 halcogen 和 code composer studio。 
我也会得到其他闪存 API 函数的相同错误。 

"Properties"->"Include Options"->"Add"->"Flash API include file"。
这样、我就包含了闪存 API。 
为什么会出现此编译错误? 

我的代码。

/*用户代码 begin (0)*/
#include "types.h"
#include "F021.h"
/*用户代码结束*/

/*包含文件*/

#include "sys_common.h"

/*用户代码 begin (1)*/
#define SYS_CLK_FREQ 150
/*用户代码结束*/

/**@fn void main (void)
*@简要应用程序主函数
*@注意此函数默认为空。
*
*此函数在启动后调用。
*用户可以使用此函数来实现应用程序。
*/

/*用户代码 begin (2)*/
uint8_t DataBuffer[8]={0、1、2、3、4、5、6、7};

/*用户代码结束*/

int main (void)

/*用户代码 begin (3)*/
//_Enable_IRQ ();
如果((Fapi_initializeFlashBanks ((uint32_t) SYS_CLK_FREQ))= Fapi_Status_Success)

Fapi_setActiveFlashBank (Fapi_Flash 2001);

Fapi_enableEepromBankSectors (0xFFFFFFFF、0xFFFFFFFF);

while ( fapi_check_fsm_ready_busy !=4074 Fapi_Status_Fsm );

while ( FAPI_GET_FSM_STATUS != Fapi_Status_Success );/*不必包含这个*/

}

Fapi_issueAsyncCommandWithAddress (Fapi_Erase、(uint32_t*) 0xF0200000);

while ( fapi_check_fsm_ready_busy == Fapi_Status_Fsm y );

while (FAPI_GET_FSM_STATUS!= Fapi_Status_Success);

Fapi_issueProgrammingCommand ((uint32_t*) 0xF0200000、DataBuffer、8、0、0、Fapi_Auto EccGeneration);

while ( fapi_check_fsm_ready_busy == Fapi_Status_Fsm y );

while (FAPI_GET_FSM_STATUS!= Fapi_Status_Success);

while (1)


}
/*用户代码结束*/

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

    尊敬的 Enes:

    如果您使用的是 FAPI 库、那么您应该需要确保满足两项要求。

    1.您应该需要在链接器文件搜索路径中包含 F021库、如下所示:

    2.现在、您应该还需要将 F021库的 include 文件夹包含在内部版本 include 选项中、如下所示:

    根据我的理解、您只执行了第二步、可能您错过了我给出的第一步、因此请同时执行第一步。

    ——
    谢谢、此致、
    Jagadish。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我将"F021_API_CortexR4_BE_V3D16.lib"添加到"ARM 连接器"时修复了这个问题。 谢谢你。