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.

关于HAL Code Generater 和CCS4.2.4建立一个工程项目出错的问题(TMS570)

Other Parts Discussed in Thread: HALCOGEN

在TI在线技术社区的活动中花300买了一块 TMS570 MCU Development kit ,但是一直无法自己建立一个完整无错的项目工程。

请问我在使用在HAL Code Generater 和CCS4.2.4的时候,依据TMS570LS2x_Using_NHET_as_GIO_Example.pdf的指南来操作,为什么会出现以下错误。希望帮助解决。

Console:

**** Build of configuration Debug for project mmm ****

D:\EDA\CCSV4\ccsv4\utils\gmake\gmake -k all

'Building file: ../os_croutine.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_croutine.pp"  "../os_croutine.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

2 errors detected in the compilation of "../os_croutine.c".

>> Compilation failure

gmake: *** [os_croutine.obj] Error 1

'Building file: ../os_heap.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_heap.pp"  "../os_heap.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

2 errors detected in the compilation of "../os_heap.c".

>> Compilation failure

gmake: *** [os_heap.obj] Error 1

'Building file: ../os_list.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_list.pp"  "../os_list.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

2 errors detected in the compilation of "../os_list.c".

>> Compilation failure

gmake: *** [os_list.obj] Error 1

'Building file: ../os_port.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_port.pp"  "../os_port.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

2 errors detected in the compilation of "../os_port.c".

>> Compilation failure

gmake: *** [os_port.obj] Error 1

'Building file: ../os_queue.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_queue.pp"  "../os_queue.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

"../os_queue.c", line 1511: error: expected an expression

3 errors detected in the compilation of "../os_queue.c".

>> Compilation failure

gmake: *** [os_queue.obj] Error 1

'Building file: ../os_tasks.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_tasks.pp"  "../os_tasks.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

"..\os_timer.h", line 68: fatal error: could not open source file "*** include variable HDRPORTABLE not defined ***"

2 errors and 1 fatal error detected in the compilation of "../os_tasks.c".

Compilation terminated.

>> Compilation failure

gmake: *** [os_tasks.obj] Error 1

'Building file: ../os_timer.c'

'Invoking: Compiler'

"D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/bin/cl470" -mv7R4 -g --include_path="D:/EDA/CCSV4/ccsv4/tools/compiler/tms470/include" --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --preproc_with_compile --preproc_dependency="os_timer.pp"  "../os_timer.c"

"..\FreeRTOS.h", line 194: error: expected an expression

"..\FreeRTOS.h", line 429: error: expected an expression

"..\os_timer.h", line 68: fatal error: could not open source file "*** include variable HDRPORTABLE not defined ***"

2 errors and 1 fatal error detected in the compilation of "../os_timer.c".

Compilation terminated.

>> Compilation failure

gmake: *** [os_timer.obj] Error 1

gmake: Target `all' not remade because of errors.

Build complete for project mmm

Problems:

  • Hi WDY,

        我尝试了使用您说的工程进行编译,但是效果是只有一些warning,并没有error。

    建议您:

    1. 将CCS升级到V5.x。如果没有意外的话,您购买的套件中的光盘上应该有CCS V5.x的安装文件。

    建议您使用V5以后的版本,可以提供更好的对Hercules系列MCU的支持。

    2. 请您直接下载这个例子的源代码并生成工程尝试。

    这个例子的源代码在wiki中可以找到: http://processors.wiki.ti.com/images/7/7c/Example_Using_NHET_as_GIO_CCSv4_Project.zip

    3. 是不是路径指定的问题呢?

    请您检查一下工程中FreeRTOS.h这个源文件放在哪个路径下。

    如果是在如”..\include“这样的路径中的话,您需要在编译选项中指定这个路径为包含路径,以免编译器找不到头文件。

        请再尝试一下。

  • 我已经把CCS升级到CCS5,但是我使用TMS570LS2x_Using_NHET_as_GIO_Example.pdf

    的方式建立的ABC工程文件,还是有很多错误!

    具体情况见附件,请帮着运行看一下错误原因所在,我之前从没用过这个环境,所以很难自己找到错误错在。

    谢谢

  • Hi WDY,

       看了一下您的工程,前面两个问题分别是由于configGENERATE_RUN_TIME_STATS 和configUSE_TIMERS两个Macro没有给定内容。那么编译时相当于"#if   == 1" ,语法错误。

    所以在定义的地方加入 #define configUSE_TIMERS        0 即可。

    最后一个问题#include "*** include variable HDRPORTABLE not defined ***"

    不是很清楚,wiki例子中的工程根本不包含os_timer.h这个头文件。

    建议您下载最新的HALCoGen V3.03.00尝试,或者直接用Wiki上面的例子。

  • HALCoGen V3.03.00和CCS5建立了一个test2工程文件依然出错,求助!

    工程文件和错误截图见附件:test2.zip

     

    都是#5错误,软件帮助说是这几个头文件没有包含进去,但是我自己加载了一下,还是一样的错误

     

    不知道我加载的位置对吗?

     

  • 问题已经解决:先将问题解决方法写在下面。

    出错的原因是找不到头文件,经过仔细查阅资料找到了自己的头文件的加载方法,比如我的头文件在:C:\myWorkspace\test1\include路径下

    那么就需要自己加载一下这个头文件的目录

    具体方法:

    右击项目管理器的项目名称->Properties打开下面对话框:

    在Include Options下面添加自己的头文件路径如上图所示。

    保存后,重新编译,无误。