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.

[参考译文] CCS/TM4C129ENCZAD:链路错误未解决符号I2C模块

Guru**** 2582405 points
Other Parts Discussed in Thread: TM4C129ENCPDT, TM4C129ENCZAD

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/601228/ccs-tm4c129enczad-link-error-unresolved-symbol-i2c-module

部件号:TM4C129ENCZAD
主题中讨论的其他部件:TM4C129ENCPDT

工具/软件:Code Composer Studio

在验证了I2C示例正确构建后,将I2C代码模块从I2C示例添加到了我的项目中。 (CCS版本:7.1 .0.0.0016万)。 (驱动程序路径:C:\tirtos_tivac_2_16_01_14\products\tidrivers_tivac_2_16_01_13\)


添加I2C代码和I2C头文件后,出现以下链接错误。

在CCS问题选项卡中:
说明                                                  资源   路径   位置                 类型
#1.001万链接期间发生错误;"IntOsc_SPI_Test.Ut"未构建   IntOsc_SPI_Test    C/C++问题

说明                                                       资源   路径   位置           类型
1.0234万-D</A> 未解析的符号仍保留   IntOsc_SPI_Test          C/C++问题

未解析的符号I2C_CONFIG,首先引用于C:/ti/tirtos_tivac_2_16_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<I2C.oem4f>   IntOsc_SPI_Test       C/C++问题


在CCS控制台中:
链接>

  未定义的第一个引用                                                                                                           
 文件中的符号                                                                                                                       
 -------------------  --------                                                                                                           
 I2C_config C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages /ti/drivers/lib/drivers_tivaware.aem4f<I2C.oem4f>

错误#1.0234万-D:仍存在未解析的符号
错误#1.001万:链接期间遇到错误;未生成"IntOsc_SPI_Test.Ut"

>>编译失败
Makefile:147:目标'IntOsc_SPI_Test.Out '的配方失败
gmake:***[IntOsc_SPI_Test.Out ]错误1
gmake:由于错误,目标'all'没有重制。

****构建已完成****

----------------

搜索文档,以下页面是我能够找到的内容:

文件:///C/:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/docs/doxygen/html/_i2_c_8h.html
没有提到要包括在链接器路径中的库

仅包含#include <ti/drivers/I2c.h>的状态

下一页,
文件:///C/:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/docs/doxygen/html/_i2_c_tiva_8h.html

国家将包括这两个国家,
#include <ti/drivers/I2C.h>
#include <ti/drivers/i2c/I2CTiva.h>

搜索论坛,发现了几个讨论,其中用户在不同模块中遇到相同类型的错误(未找到任何与TM4C129相关的I2C讨论)。 当提供解决方案时,它是一个指向某些库的路径,可以包括在链接器选项中,但没有指导我们应该如何知道或解决这个问题。

将我的项目的.cfg与I2C示例的.cfg进行比较。 我可以看出,它们的匹配程度非常接近I2C。


将我的项目的链接器属性与项目示例的属性进行比较:
链接器设置:
I2C示例:
-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --defe=CCS="CCS"--defe=part _TM4C129ENCPDT
--define=CCS --define=TIVAARE -g --gcc --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number
--gen_func_sections=on --abi=eabi -z -m"i2ctmp006_EK_TM4C129EXL_TI.map"--heap_size=0-stack_size=512
-i"C:/ti/ccsv7/tools/compiler/ti-CGT-arm_ARM_LTS/lib" 16.9 -i"C:16.9 /ti/ccsv7/tools/compiler/ti-CGT-arm_ARM_LTS/include"
--reread_libs --diag_wrap=off --display_error_number --warn_sections
--xml_link_info="i2ctmp006_EK_TM4C129EXL_TI_linkInfo.xml"--ROM_model


我的项目:
-mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --define=sequalone_scan --define=disable_encryption
--defe=mac_hack --defe=_posix_source --define=target_is_TM4C129_RA2 --define=use_TIRTOS --defe=TIVAARE
--define=part TM4C129ENCZAD --define=CCS ="CCS"-g --gcc --diag_warning=225 --diag_wrap=off --display_error_number
--gen_func_sections=on --abi=eabi -z -m"IntOsc_SPI_Test.map"--heap_size=0
--stack_size=512 -i"C:16.9 /ti/ccsv7/tools/compiler/ti-CGT-ARM_LTS/lib"
-i"C:/ti/ccsv7/tools/compiler/ti-CGT-arm_ARM_LTS/include" 16.9 --reread_libs --diag_wrap=off --display_error_number
--warn_sections --xml_link_info="IntOsc_SPI_Test_linkInfo.xml"--rom_model

我没有看到问题;我缺少什么?

将发布我的.cfg。

谢谢你。