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 optimization code

Other Parts Discussed in Thread: TMS320F28016

Hello everyone,

 

I’m using the TMS320F28016 DSP and CCS3.3 compiler. My programme is near to finish, but I have a few loose ends. For example, I would like to save the software version into the .out file . For all this to happen, I have two files:

 

  • Version.h. In this file I have declared  some defines with the important information, and a long vector:

 

#define _DESCRIPCION    "(xxxxxxxx)--------------" 

#define DEVICE_CODE 22          

#define MANUFACT_CODE       0            

#define SW_VERSION  1            

#define SW_REVISION 1            

#define SW_COMPILATION       0            

…           

extern const unsigned char  informacion[96];  

 

  • Version.c. With the initialization for informacion

 

 

So, after the compilation, I hope to find into the .out file a long string with the value of information, but this doesn’t appear in this file. Any idea? Maybe the CCS is optimizing the code and like information is never used after the initialization, the compiler not write the value in the .out file?

 

Thanks in advance.

  • If you're not actually using the const array in your program I don't think the compiler will pull it in to the .out file.  If you just want the string somewhere in your .out file, you can do something like:

    #include "string.h"

    const char informacion[96] = "thisisaverylongstringof......";
    int L;

    main()

    {
    L = strlen(informacion);

    Regards,

    Richard

  • Thank you Richard.

    Now, I can find the string into the .out file, but with a dot character between letters. For example, If I wait the string “hello”, I get the string “h.e.l.l.o.”. Any idea? 

    Thank you in advance.