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.

TMS570LC4357: Code Composer 10.1.1 Creating Plugin

Part Number: TMS570LC4357
Other Parts Discussed in Thread: MSP430F169, SEGGER

Hello,

I am trying to create a plugin for my code.

In my plugin I need to make a graph of my variables.

In order to do this I am using Eclipse Committers 4.14 which is adaptable with CCS 10.1.1.

My question is, How can i reach to my variables on TMS570LC4357 from Eclipse Committers IDE.

What should I do? I dont want to use serial communication, because UART codes are slows my code, it is so critical to access my variables direcly on the code composer studio's expression tab.

I am waiting for your response,

Best regards,,

  • Creating an Eclipse plugin that requires target JTAG access can be challenging. If you are looking for a GUI to graph values in target memory, perhaps GUI Composer would be a better option?

    https://dev.ti.com/tirex/explore/node?node=AHRqIjVQoVumrpNUHZ8-ZQ__FUz-xrs__LATEST

    Thanks

    ki

  • Hello Sir,

    I tried your suggestions but in the "TI Cloud Agent" document's supported devices section it says excluding Hercules.

    My board is TMS570LC4357 and it is Hercules. Isn't it a problem sir??

    Also, this approach is not suitable for me. I don't want  to use a cloud system. 

    Are there any suggestions for me?

    Thanks,

    Regards,

  • I tried your suggestions but in the "TI Cloud Agent" document's supported devices section it says excluding Hercules.

    My board is TMS570LC4357 and it is Hercules. Isn't it a problem sir??

    Also, this approach is not suitable for me. I don't want  to use a cloud system. 

    Ah... yes on Hercules your options are more limited. Sorry, I missed your line where you mentioned the device. 

    GUI Composer is still an option, but a less desirable one. You can still create a GUI Composer app that does not use Cloud Agent and generate a standalone package of the GUI that does not need cloud. However, that would require a communication transport that does not use JTAG, like UART, which you expressed that you do NOT want to do.

    hmm... I still don't think creating an Eclipse plugin to communicate to the target via JTAG will work. Custom Eclipse plugins work well if they do not try to access the debugger (or target). I think creating your own custom app that interfaces with DSS may be the best option (see option #3 mentioned in my old post below):

    https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/564569/ccs-how-to-write-plugins-for-ccs-6/2069250#2069250

    Thanks

    ki

  • I searched DSS and it is awesome!

    Just like a thing I want to find, thank you so much!

    But again, in the "C:\ti\ccs1011\ccs\ccs_base\scripting\docs\GettingStarted.html" file I found an API documentation.

    And in the API documentation, I could not find my Target Family. TMS570 is not there.(In the below picture you can see.)

    I think for that I need can ccxml file of my board or something else??

    What should I do in order to use this DSS ?

    Waiting for your response,

    Thank you,

  • Hello,

    And in the API documentation, I could not find my Target Family. TMS570 is not there.(In the below picture you can see.)

    Hercules (including TMS570) is definitely supported by DSS. TMS470/570 have the same support and is sometimes all lumped together as TMS470.

    Basically, if the target is supported by CCS, then it is supported by DSS. Both CCS and DSS use the same debug engine underneath.

    Thanks

    ki

  • Thank you Ki, I am trying to develop an .js program i order to reach and save my variables from memory.

    In the javascript file that i have been working on, I can reach a variable on the main function. I can not reach a variable on another .c files.

    Here is my JS code.

    I have an variable on CCS code as temp, then in the .js file I am declearing it like myglobaldecleration.

    var myglobaldecleration = "temp"
    
    try {
    	var address = debugSession.symbol.getAddress(myglobaldecleration)   
    } catch (ex) {
    	script.traceWrite(" address error");
    	quit();         // call custom quit routine to do some cleanup to gracefully exit the script
    }
    
    
    Here is an console output.
    getAddress: ENTRY sSymbol: temp
    getAddress: Getting symbol package
    getAddress: Looking-up symbol
    SEVERE: Unable to get address for symbol: temp
    How can I reach my variables on the other files?? And then how can I reach the data inside that adress? Should I know the page number of the adress?
    Waiting for your response,,
    Thanks..
  • Note that the variable (on the target) must be in scope when the debugger (via DSS) tries to access it. For example, the "temp" variable on the target must be in scope when the symbol.getAddress call is made. Is that the case?

  • Yes it is the case. But When I tried the access a variable through DSS using symbol.getAddress call, I only reach variables which is in the mainc function.  

    I can not access another variable in which it is in the other c files in my code. I mean the DSS is trying to find that variable in the main function , when it can not find, it thows me the catch section and it gives "address error".

    What should I do?

    Thanks Ki, 

  • It sounds like when the getAddress API is called, the program on the target is in "main" and the other variables are out of scope (not in main or not global variables).

    Is my assumption correct? Is the target in main and the variable you are trying to access is a local variable declared in another function?

  • I have writing an object oriented c code. And I am using FreeRtos. I mean , in the main function I am creating tasks(events). Then I have an another .c project that is responsible for measuring somethings about my tasks. In that .c file I have a global variable which is decleared over the functions. Which is the universally called global variable. Hope I could represent myself.

    I can not reach my global variables  in  .c file which I created - which includes some measurement functions- over DSS.

    Maybe I can reach them like allocating specific memory for that global variable on RAM, then just read that address??

    Any suggestions??

    Thanks,

  • You should be able to access global variables anywhere in your application once the variable has been created. I'm not sure why DSS is unable to get the address for it.

    One thing you can try is to load and run your program in CCS and then see if you can get the address of the global variable from both the Expressions view and also if you run activeDS.symbol.getAddress("temp"); from the Scripting Console.

    And of course you can access the variable contents by passing in the exact address yourself.

  • Ok it works!! I can get the adress of it from Scripting Console. Thank you. How can I read the value of a variable whose address is known through the Scripting Console?

    I dont know what should I write to Scripting console?

    Thank you so much,,

  • How can I read the value of a variable whose address is known through the Scripting Console?

    Both DSS and the Scripting Console both work the same way. They can both access the debug engine using the same APIs. Assuming the same program and debug symbols are loaded in both cases, you should be able to get the address of the global variable the same way. In fact, you can run your DSS script, "as-is", from the Scripting Console. Can you give that a try?

    Thanks

    ki

  • Hello Ki,

    I have reached my global variable finally.. Many thanks!  But I can not see it in a real time. 

    How can I manage this?

    Thanks,,

  • I have reached my global variable finally.. Many thanks!  But I can not see it in a real time. 

    Are you saying that the issue is that you must halt the target to get the address and you wish to make this access while the target is running?

  • I have reached my global variable finally.. Many thanks!  But I can not see it in a real time. 

    Is the issue that the value of the variable is not showing the expected changes when monitored in real time?

    In real time the debugger uses the DAP is used to read memory, rather than the CPU when halted.

    Since the Cortex-R5F in a TMS570LC4357 has a cache, if the variable is in the processor cache the DAP might see a "stale" value. This has been an issue on Cortex-A based devices - see CCS/AM3359: CCS Expression continuous refresh issue which for which a work-around was to change the code to cause a cache write-back for the variables which need to be monitored in real time.

    I can't remember if have performed a similar test with a Cortex-R5F device with the cache enabled.

  • Hİ,

    In my program Cache is already disabled. Because I can not see my variables in the CCS's expression view. The debug server doesn't show me the real time value of my variables. Because in real time coherency is not provided.

    So, in my case Cache is already disabled. It is not the case why I cant see it case of using DSS.

    I am thinking that it is because of the decleared part in javascript code which is;

    				long addressMain = debugSession.symbol.getAddress("main");
    				
    				if (debugSession.memory.readRegister("PC") != addressMain)
    				{
    					int bp = debugSession.breakpoint.add(addressMain);
    					debugSession.target.run();
    				}

    Maybe it is becasue of program counter.?

    Or in that line :

    address = debugSession.symbol.getAddress("temp");
    
    long  myVariable = debugSession.memory.readData(Memory.Page.PROGRAM, address,32);
    System.out.println("My variable is : " + myVariable);

    Thanks,,

  • Actually, what I want to do is what the "continuous refresh button" does in CCS, I want to do the same thing while writing a script.

    Hint: My cache is disabled, so I don't need to make coherency issues which Chester Gillon showed me in the link below.

  • I tried to add a breakpoint then it worked. But since I add software breakpoint it makes my program a little bit slow. Therefore, I am thinking I need use hardware breakpoint, and especially watchpoint.

    In the ti installation directory I am looking the examples and I found an example.

    The name is : " C:\ti\ccs1011\ccs\ccs_base\scripting\examples\DebugServerExamples\msp430f169_watchpoints.js "

    I tried it in my code but it gives me error;

    Since the code is written for the MP430, its hardware configuration is not worked with my launchpad.

    How can I find my board's hardware configurations ?

    Thanks,,

  • Because I can not see my variables in the CCS's expression view.

    Global variables should be visible in the Expressions view after you manually add it. 

    I'm not sure why your variable would not be able to be displayed there.

    You should be able to access the global variable in real-time since the DAP will be used for non-intrusive memory access. This should alos be the case for DSS.

    Can you provide a test case? I just need a simple example that I can run on the target and also a simple example DSS js script. Please have the code as generic as possible. It can be as simple as updating a global variable in a while loop.

  • Because I can not see my variables in the CCS's expression view.

    Can you clarify:

    1. Which debug probe is being used?

    2. Do you get any error reported in the CCS expression view for the variables?

    3. Are the variables static, either a file or function scope?

    For 1) and 2) remember fidning on a different Hercules device that a Segger J-Link wasn't able to work with continuous refresh - see TMDS570LS31HDK: How to watch values of global variables in watch expressions continuously?

    If the variables are static see CCS/CC2640: How to view static variable

  • How can I find my board's hardware configurations ?

    The easiest way to do this is to set your watchpoint as desired via the CCS IDE. Then you can look at the watchpoint properties in the CCS IDE and use it as a reference to create a breakpoint property object in DSS. See the below section in the User's Guide for more details:

    https://software-dl.ti.com/ccs/esd/documents/users_guide/sdto_dss_handbook.html#breakpoints

    Thanks

    ki