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: GEL_file_dir() macro does not work anymore in CCS6

Tool/software: Code Composer Studio

Hello all

I had a working GEL script in CCS5.4 that uses the GEL_file_dir macro to load sections in the following way:

#define SYMBOL_FILE_PATH "$(GEL_file_dir)\\..\\Development\\Development.out"

Into the OnHalt() function I called:

GEL_SymbolHideSection(SYMBOL_FILE_PATH, SECTION_NAME_1);

After migrating to CCS6.1.1, the GEL script reports the following error:

"GEL: Error while executing OnHalt(): D:\CCSWOR~1\MyProject\..\Development\Development.out is not a loaded symbol file.
    at GEL_SymbolHideSection("$(GEL_file_dir)\..\Development\Development.out", ".asmFunctions") [runtime_relocation.gel:49]
    at OnHalt()"

The path in the error message is the correct one. When I set the path as absolute path, then it works as expected.

Any idea?

Thanks

Aedu

Edit: Just find out that the line

GEL_TextOut("$(GEL_file_dir); 

does not produce the same output in CCS5.4 and  CCS6.

CCS5.4 writes the correct path to the console, while CCS6 trims long folder names (e.g. "CCSWORKSPACE" becomes to "CCSWOR~1" ) . Does this cause my problems?

  • Hello,

    Aedu said:

    Edit: Just find out that the line

    GEL_TextOut("$(GEL_file_dir); 

    does not produce the same output in CCS5.4 and  CCS6.

    CCS5.4 writes the correct path to the console, while CCS6 trims long folder names (e.g. "CCSWORKSPACE" becomes to "CCSWOR~1" ) . Does this cause my problems?


    In my environment, both CCSv5 and v6 uses the long name. Are using CCSv5 and v6 on the same PC?


    Thanks

    ki

  • Ki-Soo Lee said:

    In my environment, both CCSv5 and v6 uses the long name. Are using CCSv5 and v6 on the same PC?

    Hi Ki

    Yes, its on the same machine (Windows 7). I've tested it even with the same source code and project. First I used CCS5.4, then I've updated the project file to CCS6.

    Any idea?

    Thanks
    Aedu

  • Not sure what the root cause is. There was not any changes made to that macro between CCSv5 and v6. I can't reproduce the issue as mentioned.

    Your gel file is located in: D:\CCSWORKSPACE\MyProject ?
  • Hi Ki

    I made some progress. This is my OnHalt function in the GEL file:

    #define SYMBOL_FILE_PATH "D:\\svn\\product\\project\\workspaces\\ASC_memalloc\\CCSWorkspace\\Development\\Development.out"  // This works
    //#define SYMBOL_FILE_PATH "$(GEL_file_dir)\\..\\Development\\Development.out" // this doesn't work

    #define SECTION_NAME_1 ".FunctionsA"
    #define SECTION_NAME_2 ".FunctionsB"

    #define DATA_START 0
    unsigned int AreSymbolsLoaded = 0;
    unsigned int SuppressLoading = 1;

    OnHalt()

    {
      if(SuppressLoading == 0)
      {
        if ((AreSymbolsLoaded == 1) && Restarted == 0)
        {
          AreSymbolsLoaded = 0;
          GEL_TextOut("Device was reset \n");
        }
          
        if (AreSymbolsLoaded == 0)
        {
          if (ActualOverlayId == 0)
          {
            GEL_TextOut("No function loaded into overlay, because ActualOverlayId was not yet set. \n");
          }
          else if (ActualOverlayId == 1)
          {
            GEL_SymbolHideSection(SYMBOL_FILE_PATH, SECTION_NAME_1);// it works with relative paths if this line is removed
            GEL_SymbolHideSection(SYMBOL_FILE_PATH, SECTION_NAME_2);// it works with relative paths if this line is removed
            GEL_SymbolShowSection(SYMBOL_FILE_PATH, SECTION_NAME_1, OverlayStartAddress, DATA_START);
            GEL_TextOut("Functions 1 loaded into overlay. Run address is : %x \n",,,,, OverlayStartAddress);
            AreSymbolsLoaded = 1;
            Restarted = 1;
          }
          else if (ActualOverlayId == 2)
          {
            GEL_SymbolHideSection(SYMBOL_FILE_PATH, SECTION_NAME_1);// it works with relative paths if this line is removed
            GEL_SymbolHideSection(SYMBOL_FILE_PATH, SECTION_NAME_2);// it works with relative paths if this line is removed
            GEL_SymbolShowSection(SYMBOL_FILE_PATH, SECTION_NAME_2, OverlayStartAddress, DATA_START);
            GEL_TextOut("Functions 2 loaded into overlay. Run address is : %x \n",,,,, OverlayStartAddress);
            AreSymbolsLoaded = 1;
            Restarted = 1;
          }
          else
          {
            GEL_TextOut("Invalid overlay id \n");
          }
        }
        else
        {
            GEL_TextOut("OnHalt called, functions already loaded \n");
        }
      }
    }

    With the hardcoded SYMBOL_FILE_PATH, it works as expected. With the relative path I get the following GEL error on OnHAlt():

    "GEL: Error while executing OnHalt(): D:\svn\project\product\WORKSP~1\ASC_ME~1\CCSWOR~1..\Development\Development.out is not a loaded symbol file.
        at GEL_SymbolHideSection("$(GEL_file_dir)\..\Development\Development.out", ".asmFunctions") [runtime_relocation.gel:49]
        at OnHalt()"

    If I remove the GEL_SymbolHideSection() calls, then the GEL_SymbolShowSection() works with relative path. Actually the Hide calls are not really necessary, I have added them to be sure that nothing is loaded. In CCS5.4 it was working.

    Conclusion:
    It seems that GEL_SymbolHideSection() in CCS6 has a problem if the function is called before any section is loaded and the symbol file is a relative path. Once a section is loaded, then GEL_SymbolHideSection() works with relative paths (just tested a Show/Hide/Show sequence).

    Would be great if you could verify this behaviour.

    Regards Aedu