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.

Using GEL file to assign value to specific memory location CCS5.4

Hi,

 

I am using a GEL file to set a specific memory location value.  This is done in the "OnTargetConnect" function of the GEL file, and was used successfully in CCS3.3.  I have CCS5.4 set to download the GEL file when I am debugging.  After my debug configuration lanuches successfully, I can open the GEL file menu, and it says the file was loaded successfully. I also turned on trace and can see that it enters and exits the OnTargetConnect function.  However, the memory location is not set to the value that it should be (I can check in the memory browser, and also set a breakpoint and check in the code). 

Here is the line of code from the GEL file that I am using:

*(unsigned long*)0x80040000 = 0x31415926;

 

Do I need a different format in CCS5? 

 

Thanks,

David

  • Hi David,

    Nothing really changed with regards to GEL startup functions and the OnTargetConnect() call between CCSv3 and v5. It pretty much works the same. It must be something else. Can you manually edit that memory location (via memory view)? It may be that GEL is having problems accessing that memory location in v5. If that works, could you try re-running the OnTargetConnect() call? You can do this from the scripting console:

    js:> activeDS.expression.evaluate("OnTargetConnect()");

    thanks

    ki

  • Hi ki,

     

    I can manually edit the memory location from the memory viewer.  Also, if I re-run the OnTargetConnect call as you suggest, it does the change the memory location as I would expect. When I viewed the memory location prior to re-running the call, it was after the OnTargetConnect function should have been run the first time (target connected, program loaded and waiting at main) (the memory location was not what I expected).

     

    It looks like my linker file may not be being used as I expected, so if the memory location is not being reserved it could be used for something else, which may over write it.  I will investigate my linker file more.

    Thanks,
    David

  • For whatever reason, the OnTargetConnect() call is not getting properly executed that first time. What else is in the OnTargetConnect() call? Can you show me the contents of the whole function?

    Thanks

    ki

  • Here is the whole function:

    OnTargetConnect()

    {

    HPI_GPIO();

    PLL_Init();

    // *(int *)GPIODAT1 = 0xFF0FBF87; /*  Drive PROG line(GPIO bit 14)low on Xilinx to program PROM */

    *(unsigned long*)0x80040000 = 0x31415926; 

    }

     

    One thing I just noticed with the linker command file, is that the file that it should be using is grayed out and had "Exclude resource from build" checked.  I have unchecked this and am rebuilding to see if this is related.

     

    **Edit - this seems to have been the issue.  The linker command file wasn't being used, so the memory wasn't being reserved.  I will double check to make sure it does not have multiple files specified.  Thanks.

     

    David