TMS320F28379D: How to use F021 Flash API in the example project of empty_sysconfig_337zwt?

Part Number: TMS320F28379D
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Dear All,

I have created a copy of the empty_sysconfig_337zwt project, and I intend to test the F021 Flash API. How can I proceed with this?

However, whenever I include the file "F021_F2837xD_C28x.h", I encounter the following error:

I have uploaded my project below. Could someone please assist me?

test_import_f021.zip

Thank you.

Best regards,

Cody

  • Hello Cody,

    Your project did not import for me, but I was able to replicate the issue by importing an empty project and view what exact set of code is causing the error:

    #if FALSE != 0
    #define false FALSE
    #endif
    #if TRUE != 1
    #define true TRUE
    #endif

    Even with TRUE and FALSE defined, it looks like there is some compiler error here. When I checked with an online C compiler, the error does not show up. I will forward this post to our compiler team to explain the issue further if there is a reason for it.

    #ifndef TRUE
       #define TRUE              1
    #endif
    
    #ifndef FALSE
       #define FALSE             0
    #endif
    
    #if FALSE != 0
    #define false FALSE
    #endif
    
    #if TRUE != 1
    #define true TRUE
    #endif

  • Dear Omer,

    I just tried the C2000Ware_5_00_00_00 with the same method, and no errors occurred. Why is this happening?

    Thank you.

    Best regards,

    Cody

  • Hi! I am not able to reproduce the issue just with the code above (and using it in a function). Is it possible to produce a small test case that fully manifests the issue?  Please follow the directions in the article How to Submit a Compiler Test Case.  If it's an error in the parse or the preprocess, please get as far as you can and send that.

    Can you also indicate what version of the compiler is being used as well as the options being passed to it?

    Thanks!

  • empty_sysconfig_main.pp.txt

    "C:/ti/ccs1230/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --include_path="C:/ti/c2000/C2000Ware_5_02_00_00/libraries/flash_api/f2837xd/include" --include_path="C:/Users/USER/workspace_v12/empty_sysconfig_337zwt_502" --include_path="C:/Users/USER/workspace_v12/empty_sysconfig_337zwt_502/device" --include_path="C:/ti/c2000/C2000Ware_5_02_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/ccs1230/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" --define=DEBUG --define=CPU1 --define=_FLASH --preproc_with_comment --preproc_with_compile --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --include_path="C:/Users/USER/workspace_v12/empty_sysconfig_337zwt_502/CPU1_FLASH/syscfg" --cmd_file="syscfg/board.opt" --cmd_file="syscfg/c2000ware_libraries.opt" "../empty_sysconfig_main.c"

    >> Compilation failure
    subdir_rules.mk:36: recipe for target 'empty_sysconfig_main.obj' failed
    "C:\ti\c2000\C2000Ware_5_02_00_00\libraries\flash_api\f2837xd\include\Types.h", line 129: error #18: expected a ")"
    "C:\ti\c2000\C2000Ware_5_02_00_00\libraries\flash_api\f2837xd\include\Types.h", line 132: error #18: expected a ")"
    "C:\ti\c2000\C2000Ware_5_02_00_00\libraries\flash_api\f2837xd\include\Types.h", line 133: warning #48-D: incompatible redefinition of macro "true" (declared at line 46 of "C:/ti/ccs1230/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include/stdbool.h")
    2 errors detected in the compilation of "../empty_sysconfig_main.c".
    gmake: *** [empty_sysconfig_main.obj] Error 1

  • Hello Allan and Cody,

    The syntax of the Types.h file does not matter, the code below seems to be the exact problem:

    #if FALSE != 0
    #define false FALSE
    #endif
    #if TRUE != 1
    #define true TRUE
    #endif

    For some reason the following main.c will build with C2000Ware 5.00.00, but not 5.02.00. I've tried to look at the contents of C2000Ware itself, but that does not seem to be the source of the problem. The only file I used from C2000Ware in my project is adc.h, but even checking to make sure it was identical with the version in 5.00.00 still caused a compiler error. I've zipped and inserted my project below, it may be related to the project properties, but I'm not sure what setting I would be looking for there.

    3225.project.zip

    I also noticed that the issue went away when I put Types.h (or temp.h in my project), above the other header files. I don't know how exactly that prevented the compiler error, but I thought it was noteworthy.

  • Also of note, I compared the .projectspec files which are used to import the empty project example I used, and these were the only differences (I don't believe these should cause an issue):

  • Thanks for the addiitonal details Omer. I've brought this thread to the attention of the compiler experts for further comment. Thanks

  • Dear all, 

    I found that if we move "F021_F2837xD_C28.h" before "driverlib.h", the project can be built. 

    Do we have any condition for the header file on compiler, but there shouldn’t be any sequence need for the header file.

    May you check based on this observation? 

    Best Regards,

    Eric Chen

  • Eric, 

    I have filed a bug for it . 

    The type cast for TRUE and FALSE lines in hw_types.h cause this issue.  

    If you replace them with the following lines,  the issue is fixed

    #ifndef TRUE

    #define TRUE    1

    #endif

    #ifndef FALSE

    #define FALSE   0

    #endif

    Best Regards

    Siddharth

  • Dear Siddharth,

    I recently developed my project using dual C28 and dual CLA. However, I frequently encounter a lack of relevant references or example code for Sysconfig and Driverlib. In the future, could TI provide more examples for dual C28 and dual CLA, such as the aforementioned example regarding the usage of FlashApi?

    Best regards,

    Cody

  • Dear team,

    To add some comments about what Cody said.

    We have separated document for dual CPU and dual CLA, not having a one to let the user refer from one document to develop. 

    And we don't have much example for dual CPU and dual CLA. 

    It will help a lot for both customer and TI, if we will have more examples and documents about dual CPU and dual CLA. 

    Best Regards,

    Eric Chen

  • I have filed a bug for it . 

    The type cast for TRUE and FALSE lines in hw_types.h cause this issue.

    Dear Siddharth, 

    Thanks for that. 

    May you note this and correct in the next version of C2000ware?

    Best Regards,

    Eric Chen

  • Eric, 

    We will work on it and get it fxed in the next C2000Ware release.

    Best Regards

    Siddharth