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/TMS320F28030: Problem with GUI composer

Part Number: TMS320F28030

Tool/software: Code Composer Studio

Hello, 

I want to watch a variable when my code is running on GUI Composer Studio I am able to follow all steps mentioned in https://dev.ti.com/gc/designer/help/Tutorials/xds/index.html.

So can you tell me what I can do to simply view the value of a global variable on fly when running the code instead of watching variables in CCS. Is there a text box or something. I have gone through manual but it not very helpful.

I am currently using a simple code to toggle a global variable value to 0 and 1. But the problem is that whenever I try to bind the value in LED with my global variable there is no list of the variables. When I am trying to bind the value I get only 3 options auto load program, Class Name, ID after selecting my_xds.

So can you help out with these two questions.

Thank you!

Regards

Sagar

  • Sagar,

    When creating the GUI Composer Project and selecting XDS as the transport were you able to specify the program file?

    i.e. were you able to fill out this screen:

    If not you can get back to those settings here:

    Regards,

    John

  • Hey John,

    I am now able to bind the widgets with my variables. I had problem to connecting to my target device after I would upload the .out file.

    So now my question is that after I select export to CCS desktop view I am not able to run it from my ccs Desktop. I have pasted in CCSDesktopInstallRoot/ccsv7/eclipse/dropins-gc .

    So can you tell me how to run the GUI from desktop version.

    Thanks
    Sagar
  • HI Sagar,

    Are you able to preview your app in the online version after you upload the .out file and bind the widgets?

    When you export the app for CCS Desktop, the app will work like any other views inside CCS. i.e it read/write memory base on the selected core in the debug view. So, in you case, are you not seeing this experience when you drop your app into CCS?

    If you don't want to use CCS, you can also export your app as a standalone app. Download the runtime and install your app into the runtime. There should be instruction in the export dialog regarding the runtime and the required instruction to install your app in the standalone mode.

    Regards,
    Patrick

  • Hi Patrick,

    I will try using it as a stand alone app and let you know if I face any difficulties.
    I have one more question regarding the code below. I am simply blinking led widget on and off. (led_state has binding with LED widget).
    I am seeing that it runs only once i.e. whenever I click play it goes on and off once. it does not run infinitely. I am able to see the expected results in watch expressions in CCS but in GUI I am able to see it only once. Could you help me on that?

    code:

    int 16 led_state = 0;
    while (1)
    {
    led_state = 1;
    DELAY_US((500000));
    led_state = 0;
    DELAY_US((500000));
    }


    Thanks
    Regards
    Sagar Shah

  • Can you attach the project that I can use on dev.ti.com/ide to generate the .out file?
  • Let me know If you need anything else!

    Thanks
    Sagar
  • Hi Patrick,

    Any updates on it?

    Thanks
    Sagar
  • Hi Sagar,

    Please take a look at this post 

    Patrick

  • Hey Patrick ,

    Thanks for the reply! I am not able to find TargetConnect() or the GEL file in my code composer project. Can you help me in finding that file /subroutine?

    Thanks
    Sagar
  • If you are running a standalone GUI Composer app then the gel file will be in
    <user folder>\AppData\Local\Texas Instruments\TICloudAgent\loaders\ccs_base\emulation\gel\

    Inside CCS the GEL files are located in: <ccs install dir>\ccsv7\ccs_base\emulation\gel
    From inside CCS it is easiest to find the loaded gel files when in an active debug session. Just go to the tools menu and select "GEL Files"

    Regards,
    John
  • HI John,

    I changed as the GEL files as you have mentioned with PC address in the target config of the GEL file.
    However it is not working. I see that it exists from my while(1) loop and executes the code from beginning of my initialization.

    Is there any other way for it? I want it to be done quickly as my deadline is approaching soon!


    Thanks
    Sagar
  • Sagar,

    In summary what is happening is:
    -GUI Composer programs the device
    -GUI Composer disconnects from the device after finishing programming
    -device will now be running
    -GUI Composer then connects to the device as you have XDS selected as the transport mechanism for reading data from the device
    -this connect is causing a reset
    -after the device resets it is typically setup to run from flash.

    Are you placing your program in flash or ram?

    I setup something to test this out on a F28069M. I program the flash with a fast Blinky program using CCS. I then have GUI Composer setup to show the status of the LED in a slow Blinky program, this program is configured to go in ram. When GUI Composer launches I can see it load my program and I see the LED blinking slowly. I then see GUI Composer disconnect and connect and then I see the LED blinking fast as the device is now running the program from flash.

    Regards,
    John
  • From your attached project I can see that it is placing the program in RAM.  Right click on the linker command file in your project and select exclude from build.  Add the attached linker command file to your project.  I attached 2 as the subject line referenced 28030 but the project attached was using 28035 so select whichever one matches your device.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/81/F28030.cmd

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/81/F28035.cmd

    After doing that rebuild your project and then in GUI Composer make sure to go into the properties and re upload the .out file.

    Regards,

    John

  • Hey John,

    Thanks for making me understand what was happening behind. Yes I was building it in RAM before. So I replaced the linker file and now I have been successful in making GUI composer up and running.
  • If I want to run my CCS project which is configured as flash should I attached the above attached file?
  • Sagar,

    I am not sure what you mean.

    If you have rebuilt the CCS Project with the .cmd I provided then when you launch the debugger in CCS it will write that program to FLASH. Basically both CCS and the Cloud Agent that GUI Composer uses look at the program and know what code needs to be placed in RAM or FLASH based on the addresses and they have the ability to program the FLASH.

    Regards,
    John
  • Hey John,

    In my original code(which I have not shared) in 28035 I am using Delay_US(1000) function. So I have to change .sect ''ramfunc" in DSP2803x_usDelay.asm to ".text" as it was giving my run time error (in code composer studio) as it could not be loaded in flash.
    After doing so my code behaves again the same and your suggestion does not work here. (I am able to watch expression and see value)

    So how should I go about? Is GUI composer so troublesome always?
    Looking for quick advise as I have a couple of days for deadline.

    Thanks you!
  • The problem is that a reset is being initiated by the flash loader dll when it gets loaded.

    If you are using that Delay_US function then we need to make this work out of RAM or you will need to copy the section at runtime from FLASH to RAM.

    There may be an easier solution.
    If I look at the GEL initialization file for F28069

    This file is located here:
    C:\Users\<your user name>\AppData\Local\Texas Instruments\TICloudAgent\loaders\ccs_base\emulation\gel


    The OnReset() function looks like this (the one for F28030 will look the same):
    OnReset(int nErrorCode)
    {
    if (GEL_IsInRealtimeMode()) /* If in real-time-mode */
    {
    }
    else /* Put device in C28x mode */
    {
    C28x_Mode();
    }
    Unlock_CSM();
    Device_Cal();

    // Uncomment for the desired boot-mode on a reset:
    // EMU_BOOT_SARAM(); /* Set EMU Boot Variables - Boot to SARAM */
    // EMU_BOOT_FLASH(); /* Set EMU Boot Variables - Boot to flash */
    }


    If I uncomment this line:
    EMU_BOOT_SARAM(); /* Set EMU Boot Variables - Boot to SARAM */

    Then the application is running from RAM after a reset. By default it seems to run from FLASH after a reset. I am not an expert on C2000 devices.


    Regards,
    John
  • Hey John,

    The Solution you have mentioned I tried to uncomment but it doesn't work. Is there a desktop version there I can run instead of the cloud?

    So is there any other thing you would like me to do so that GUI gets running?

    Thanks
    Sagar
  • Also I would like to add that it works fine without using Delay_US() and when I run it using RAM.

  • sagar shah54 said:
    Also I would like to add that it works fine without using Delay_US() and when I run it using RAM.

    Do mean that if you change the GEL to boot from RAM that it works as long as you are not using Delay_US() or do you mean that even without uncommenting the line it works from RAM as long ad Delay_US() is not used?  If the former that doesn't make sense to me but I will ask a C2000 expert.

    As far as not using the cloud version yes this is possible.  You can export your GUI to either a standalone application to run on the desktop or as a view to use inside CCS.  Exporting as a standalone application would still have the same issue.  If you export it as a view for inside CCS you would use CCS to load the program and then you would open the view, that might avoid the issue for you.

    John

  •  I mean that even without uncommenting the line it works from RAM as long ad Delay_US() is not use. So the problem starts if I use  Delay_US() using FLASH.cmd file. So the solution you have mentioned Does not work. Have tried using GUI composer with 28035 using FLASH file witha DELAY_US() function? 

  • Sagar,

    It will be executing from Flash if you do not have that line commented out. I suspect that you have a copy of the program in flash that does not use Delay_US() and you are seeing that execute and not the program from RAM. I placed different programs in RAM and FLASH that I could visibly distinguish so that I would know which one is actually executing.

    It is possible to copy Delay_US() from FLASH to RAM at runtime as described in this thread:
    e2e.ti.com/.../2099620

    Regards,
    John
  • Hey John,

    I have changed DELAY_US() function to .text so the code runs well on CCS and I can watch the variables. But when I use GUI then again it does not work!

    Have tried using GUI composer with 28035 using FLASH file with DELAY_US() function?
  • Sagar,

    sagar shah54 said:
    I have changed DELAY_US() function to .text so the code runs well on CCS and I can watch the variables

    So you changed:

           .def _DSP28x_usDelay

           .sect "ramfuncs"

    To:

           .def _DSP28x_usDelay

           .sect ".text"

    Where is .text being placed?  I.e. what does the line in the .cmd file look like

       .text            : > RAML0_L3,   PAGE = 0

    or something like?

       .text            : > FLASHA,   PAGE = 0

    If you are placing it in FLASH then you need to copy it to RAM in your application.  You would not want to place it in .text as you only want to copy the relevant code to RAM so keep it in ramfunc.

    There are example projects in C2000Ware that show how to copy the ramfunc section at runtime.  Just take a look at one like Example_F28035_Flash.  You still have the code going into ramfunc, the ramfunc section is placed in FLASH for loading but then at runtime it gets copied to RAM.

    On this device if it is working in CCS don't assume it is going to work in GUI Composer.  Please note that if the program is being placed in RAM CCS will still work fine.  The extra reset that causes the device to start executing from FLASH does not occur when using CCS.  The problem is specific to GUI Composer.

    John

  •  Yes I did change  .def _DSP28x_usDelay

          .sect "ramfuncs"

    To:

          .def _DSP28x_usDelay

          .sect ".text".

    In Cmd File this what it shows in screen clippling-

  • Sagar,

    Just to let you know we are still looking at this. Someone else with a F28035 is going to set this up. I have been using a F28069. Note that I don't believe you want to be changing .sect "ramfuncs" to .sect ".text". If you do that then the memcpy command in the application code is not going to be able to locate it to copy it to RAM at runtime.

    John
  • Okay Thanks. I will wait for the response after using F28035. Thank you!
  • Sagar,

    I was able to modify your code to get it working from Flash on a F28035.

    As John mentioned before, the Delay_US function needs to run from RAM, so it is placed in a separate section that is then copied from Flash to RAM at runtime. This is not done automatically and is something the user needs to do by making a call to memcpy. I would suggest taking a look at the flash_f28035 example and reading through the comments in the source code that show you when and why this section should be copied. 

    I have added the memcpy to your source file along with some other minor updates and attached the updated project below. I was able to bind the variable led_state to a GUI Composer LED widget and view its status. Please give this a try and let us know if this resolves the issues you were seeing.

    Example_2803xGpioToggle_sagar.zip

  • Hey Aarti,

    I tried running your modified code and I am unable to make the led glow in and off. (I had blink led_state variable bind to led).
    I suspect something is happening with RESET maybe.

    So I am still not sure how to make it running after taking those suggestions. Kindly let me know if there is any other solution.

    Thanks.
    Sagar
  • Sagar,

    I verified it works on my F28035 experimenter's kit, so I'm not sure why it is not working for you.

    I am attaching a short video below that shows my GUI Composer project settings. It is set to load the .out file from the project I had attached earlier. There is a LED widget and number box widget, both bound to variable led_state. 

    I am not sure if you are still using some modified GEL files as were suggested earlier by John. If you do, try reverting them back. While running my project I did not make any modification to any GEL files.