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.

[参考译文] RTOS/TM4C123GH6PM:在哪里声明 RTOS 配置文件中使用的函数?

Guru**** 2594580 points
Other Parts Discussed in Thread: TM4C123GH6PM, SYSBIOS

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/588073/rtos-tm4c123gh6pm-where-to-declare-functions-used-in-the-rtos-config-file

器件型号:TM4C123GH6PM
Thread 中讨论的其他器件: SYSBIOS

工具/软件:TI-RTOS

您好!

我认为这是一个很简单的问题。 如果我要通过 RTOS 配置文件中的 RTOS GUI 添加计时器或节拍、并且函数位于单独的源文件中、且具有其自己的标头、则会收到要调用的函数的"未定义符号"错误。 这是有道理的。

如何将声明包含到配置文件中? 或更好地做正确的:)

非常感谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    如果链接器抱怨未定义的符号、则意味着未链接您的单独编译单元、或者链接器看不到您的函数的其他原因。 您使用的是 CCS 吗? 是否可以从控制台窗口清理和重建并发布完整输出?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    是的、我使用的是 CCS。 控制台输出如下:

    ****为项目 Zelltester 构建配置调试****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake"-k all
    '生成文件:./rtos.cfg '
    '调用:XDCtools '
    "c:/ti/xdctools_3_32_01_22_core/xs "--xdcpath="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/tidrivers_tivac_2_16_00_08/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/uia_2_00_05_50/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/ns_1_11_00_10/packages;C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages /ti/ccsv6/ccs_base /Users/rico/workspace_v6_2/Zelltester /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include;" xdc.tools.ivo -o configgen -t.targets.elf.m4F -p ti.platforms.tiva:TM4C123GH6PM /ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b -r release -c "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS /ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix;-compileet\s\chex_exp_warning\-cn=cn-section-cn-cn=tex-cn_bote_display_band_defines=-cn=-cn-cn-cn-cn-cn=cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn/mspecon_display_display_display_botain=-cn=-cn-cn=-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn-cn=cn-cn-cn-cn-cn-cn-cn-cn/sim
    正在制作 package.mak (由于 package.bld)...
    正在为软件包 configPkg 生成接口(因为 package/package.xdc.inc 比 package.XDC 旧)...
    从 package/cfg/rtos_pem4f.cfg 配置 rtos.xem4f ...
    正在生成自定义 ti.sysbios 库 makefile ...
    正在开始构建库源...
    制作 C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios/sysbios.aem4f ...
    gmake[1]:输入目录`C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios
    clem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/BIOS.c
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/Hwi_asm.sv7M。。
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/Hwi_asm_switch.sv7M。。
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/IntrinsicsSupport_asm.sv7M。。
    asmem4f C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/m3/TaskSupport_asm.sv7M。。
    arem4f bios.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj m3_IntinsicsSupport_asm.obj m3_TaskSupport_asm.obj ...
    gmake[1]:离开目录`C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios
    已完成库构建。
    clem4f 封装/cfg/rtos_pem4f.c……
    '完成构建:./rtos.cfg '
    '
    1 Datei (en)卡阿片尔特。
    正在制作./src/sysbios/sysbios.aem4f ...
    gmake[1]:输入目录'C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios
    gmake[1]:没有为"全部"执行任何操作。
    gmake[1]:离开目录'C:/Users/rico/workspace_v6_2/Zelltester/src/sysbios
    '生成文件:./CANDriver.CPP'
    '调用:ARM 编译器'
    "c:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl /ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix "-mv7M4 -code_state=16 --float_support=FPv4SPD16 -me -off --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b --include_path="ccs_pred=ccs_warning_diag=ccs_subsection-gover-define=ccs_guide-guides=ccs_guide-guides=g-code.page=ccs_guide-guidep-code.page=ccs_guide-guidep-ctr-code.page=g=ccs_guide-guidep-code.page=g=g=ccs_guide-guidep-code.page=ctr-code.page=ctr-codest-code.p=g_guide-guide-guide-guidep-ctr-code.p=g.cpp -code.page=ctr-code.page=ccs
    '已完成建筑:./CANDriver.CPP'
    '
    '生成文件:../EK_TM4C123GXL.c'
    '调用:ARM 编译器'
    "c:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl /ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -off --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b --include_path="ccs_pred=ccs_define=ccs_define=ccs_define=ccs_define=cpr-code.g=ccs_define=ccs_define=cpr-code.g=ctrab-code.g=ctrab-code.g=ccs_codest-code.g=ctrab_code.g=ctrab_code.g=ctrab_code.g=ctrab_code.g=ctrab_code.g=ctrab_code.g=ctrab=ctrag=ctrab_codest_code.g=ccs_subs=ccs_codest-code.g=ctrab_code.g=ctrab_code.g=ccs_codest-code.g=ctr
    '完成的建筑:../EK_TM4C123GXL.c'
    '
    '生成文件:./Zelltester.cppp'
    '调用:ARM 编译器'
    "c:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl /ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -off --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b --include_path="ccs_subsection=ccs_previde=ccs_subs=gover-define=ccs_codestination=-code.combpr-code.combpric_decure-subs=g=-code.combuls=g=ccs_codestintrab_decure-code.compr-code.comb=g=g=g=-codestintrab-code.com-codestintrab_decure-subs=g=-code.combag=g=-code.compr-codestintrab-code.com.cpp -code.com-codestintrab-code.com.cpp -code.com.cpp -code.com.cpp -code.com.cpp -codestin
    '完成的建筑:./Zelltester.cppp'
    '
    '生成文件:./rtos.cpp'
    '调用:ARM 编译器'
    "c:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl /ti/tirex-content/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/posix "-mv7M4 -code_state=16 --float_support=FPv4SPD16 -me -off --opt_for_speed=0 --include_path="C:/Users/rico/workspace_v6_2/Zelltester /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include --include_path="C:/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b --include_path="ccs_define=ccs_subsection=-define=ccs_subsection-code.combpr-code.compric=g=ccs_guide-page=-code.compr-code.page=ccs_guide-guide-prob_guide-page=ccs_guide-from-code.g=-code.p=-codest-codest-codest-ccs_guide-subs=-code.page=g=ccs_guide-subs=g.cpp -codest-codest-codest-codest-codest-codest-codest-code.page=ccs_guidep-codest-code.p=ctr-code.page=ccs
    '完成构建:./rtos.cpp'
    '
    '建筑目标:Zelltester.out'
    '调用:ARM 链接器'
    "c:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/bin/armcl "-mv7M4 -code_state=16 --float_support=FPv4SPD16 -me -off --opt_for_speed=0 -g -gcc --define=ccs"--define=part_TM4C123GH6PM --define=ctrad_exjets=z_exam -z_exjetram_example.x=z_example-example_intrad_subs=z_example.ti_example.x=z_example.ti_example.ti_example.x=_en_example.ti_example_b=-core-tor_example.ti_example.ti_example.ti_example.ti_en_example.ti_en_example.ti_en_example.ti_en_example.ti_en_example.ti_en_example.ti_en_example.ti_en_example.ti_en_example.ti_example.ti_en_example.ti_en_/ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b/driverlib/ccs/Debug/driverlib.lib /ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b/usblib/ccs/Debug/usblib.lib /ti/tirex-content/tirtos_tivac_2_16_00_08/products/TivaWare_C_Series-2.1.1.71b/grlib/ccs/Debug/grlib.lib /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/include /ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.4.LTS/lib

    警告#10229-D:输出段".data"是指加载符号"task0fxn"、因此无法压缩;压缩"rle"会被忽略

    未定义的首次引用
    符号 文件中
    ------ --------

    task0fxn C:\Users\RIC\workspace_v6_2\Zelltester\Debug\configPkg\package\ccfg\rtos_pem4f.oem4f
    >>编译失败
    Makefile:146:目标'Zelltester.out'的配方失败

    错误#10234-D:未解析的符号仍然存在
    错误#10010:链接期间遇到错误;未生成"Zelltester.out"
    gmake:***[Zelltester.out]错误1.
    gmake:目标"全部"不会由于错误而重新生成。

    ****构建完成****
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我猜您的任务0fxn 是在 Zelltester.cpp 或 RTOS.cpp 中定义的、两者都编译为 C++文件。 您需要使用 extern C 块使 task0fxn 可见。 转至 products\BIOS_ \docs、然后打开 BIOS 用户指南。 第1.5节将 C++与 SYS/BIOS 结合使用包含更多信息和一些用例示例。