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.

The code generated by HAL CODE GENERATOR can not be Compiled exactly by CCS4.2

Other Parts Discussed in Thread: RM48L950, HALCOGEN

Hi,

I want to compile my RM48L950's code which was generated by HAL CODE GENERATOR. but it did not pass with a lot s of error information.

For testing CCS4, I imported the project -----spna106a and compiled it. It works.

 Q1: May I compile the project which was generated by HAL? Is the project  integrated?

Q2: If HAL can generate the integrated project, how should I setup my CCS4 for compiling the project?

Q3: Is there any way  to copy set param of CCS4 from one project to others? 

 

Thanks!

 

Chuan

 

  • Chuan,

    For Q1 and Q2 I will try to get someone from the Safety team to reply.

    For Q3 there is no good way to apply the build options of one project to another project.  A couple ways you can do it is if this is for a new project you can just copy the project, rename the copy, remove the old source files and then add the new ones.  If there is a set of options that you want to apply to all your projects you can put the options into something called a switch or command file and then include that in each of your projects.

    Here is the information cut from the compiler manual.

    --cmd_file=filename Appends the contents of a file to the option set. You can use this option
    to avoid limitations on command line length or C style comments
    imposed by the host operating system. Use a # or ; at the beginning of a
    line in the command file to include comments. You can also include
    comments by delimiting them with /* and */. To specify options, surround
    hyphens with quotation marks. For example, "--"quiet.
    You can use the --cmd_file option multiple times to specify multiple files.
    For instance, the following indicates that file3 should be compiled as
    source and file1 and file2 are --cmd_file files:
    cl470 --cmd_file=file1 --cmd_file=file2 file3

    Regards,

    John

  • Hi,

    Can you share the error logs from the CCS? 

    Did you add the include path in the Project build option? Because all header files are generated in different folder named "include" 

    Regards

    Prathap

  • Hi Jan,

    Thanks for your reply.

    Is there any document for setup the CCS4 ?

    Thanks!

    B.Rs,

     

    Chuan

  • Hi Prathap,

    Thanks for your reply.

    I have added the include path in my Project build option.

    Below is the one of those error: Should I re-setup the CCS4 for the project which is shared by HAL and CCS4?

     

     

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all

    'Building file: ../source/adc.c'

    'Invoking: Compiler'

    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.3/bin/cl470" -mv7R4 -g --embedded_cpp --relaxed_ansi --fp_mode=strict --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.3/include" --include_path="C:/Users/dwang/Desktop/020-023/020-023 testing/include" --diag_warning=225 --gen_aux_user_info --write_diagnostics_file --display_error_number --no_warnings --emit_warnings_as_errors --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --printf_support=full --preproc_with_compile --preproc_dependency="source/adc.pp" --obj_directory="source"  "../source/adc.c"

    error: option --emit_warnings_as_errors conflicts with previous option

       --no_warnings

    gmake: *** [source/adc.obj] Error 1

     

    Thanks,

     

    Chuan

  • Chuan,

    The two options selected are contridicting. Sorry I am away from my CCS PC,

    Can you start with a fresh CCS project chossing you'r device? Only extra thing u have to do is select include folder in include path.

    Regards
    Prathap

  • Hi Prathap,

    Thanks for your reply.

     

    I have created a new project which was shared with HAL and I  chose RM48l950.

    I asked my workmate did same things on is computer too.

    I got error showed below:

    /include/usblib.h", line 1267: error: identifier "tEndpointDescriptor" is undefined

    /include/usblib.h", line 1268: error: identifier "tInterfaceDescriptor" is undefined

    35 errors detected in the compilation of "../source/usbbuffer.c".

    >> Compilation failure

    I found the code in usblib.h (showed below)  did not work(Although I defined "ccs" sign). but I donot know the reason.

    #if defined(ccs) ||             \

        defined(codered) ||         \

        defined(gcc) ||             \

        defined(rvmdk) ||           \

        defined(__ARMCC_VERSION) || \

        defined(sourcerygxx)

    #define PACKED __attribute__ ((packed))

    #elif defined(ewarm) || defined(__IAR_SYSTEMS_ICC__)

    #define PACKED

    #elif (__TMS470__)

    #define PACKED __attribute__ ((packed))

    #else

    #error Unrecognized COMPILER!

    #endif

    when I took away the "PARKED" from below code. The error will be reduced a lots.

    typedef struct  

        uint8_t bmRequestType;

        uint8_t bRequest;

        uint16_t wValue;

        uint16_t wIndex;

        uint16_t wLength;

    }

    PACKED tUSBRequest;

    typedef struct {

        uint8_t bLength;
        uint8_t bDescriptorType;

    }

    PACKED tDescriptorHeader;

    Those code all was generated by HAL. Did I make some mistake for setuping my ccs?

    HAL code gengertor :  version :03.02.02

    CCS:  Version: 4.2.5.00005

     

    Thanks!

    B.Rs,

    Chuan

  • Chuan

    This link should help you on HALCoGen USB related questions.

    http://processors.wiki.ti.com/index.php/HALCoGen_USB_Device_-_driver_%26_CDC_Class

    Regards
    Prathap

  • Hi Prathap,

    Thanks for your reply.

    I got error infomation showed below, when I built the code which was generated by HAL. 4 function signs ( esmGroup1Notification, esmGroup2Notification, gioNotification,i2cNotification)  were declared in sys-esm.h, gio.h and i2c.h. There are not any  function entity in .c files, But the 4 functions were invoked by ISR.

    Would you tell me what was wrong when I generated the code by HAL.

    Thanks!

     

    B.Rs,

     

    Chuan

     

    'Building target: v4020023p.out'

    'Invoking: Linker'

    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.3/bin/cl470" -mv7R4 -g -O3 --opt_for_speed=3 --gcc --diag_warning=225 --gen_aux_user_info --write_diagnostics_file -me --unaligned_access=on --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 -z -m"v4020023p.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.3/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/TMS470 Code Generation Tools 4.9.3/include" --reread_libs --rom_model -o "v4020023p.out"  "./system.obj" "./sys_startup.obj" "./sys_pmu.obj" "./sys_phantom.obj" "./sys_mpu.obj" "./sys_memory.obj" "./sys_main.obj" "./sys_intvecs.obj" "./sys_esm.obj" "./sys_core.obj" "./spi.obj" "./sci.obj" "./rtp.obj" "./rti.obj" "./pinmux.obj" "./nhet.obj" "./mibspi.obj" "./mibadc.obj" "./lin.obj" "./i2c.obj" "./gio.obj" "./dmm.obj" "./dcc.obj" "./dcan.obj" -l"rtsv7R4_T_le_v3D16_eabi.lib" "../sys_link.cmd"

    <Linking>

     

     undefined             first referenced

      symbol                   in file    

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

     esmGroup1Notification ./sys_esm.obj  

     esmGroup2Notification ./sys_esm.obj  

     gioNotification       ./gio.obj      

     i2cNotification       ./i2c.obj      

     

    error: unresolved symbols remain

    error: errors encountered during linking; "v4020023p.out" not built

     

    >> Compilation failure

    gmake: *** [v4020023p.out] Error 1

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

    Build complete for project v4020023

     

     

  • Hi Prathap,

    I have passed project compile and link by adding empty function entity in .c files.

    But I think that should not be good way. Is there any way to auto generate the function entity in .c files or take away the invoting in ISR?

    Thanks!

    B.Rs,

     

    Chuan

  • Hi Prathap,

    The problem have been solved.

    I made mistake when I create the share  project for CCS and HAL.

    Any way, Thanks fro your help.

     

    B.Rs,

     

    Chuan