Code Composer 4 ... MSP430 ... what is a simple way to track the path / history that leads to a break point? ... includes ISR's that were called prior to reaching the break point.
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.
Sounds like you are looking for the call stack. You can see that information from the debug view:
http://software-dl.ti.com/dsps/dsps_public_sw/sdo_ccstudio/workshops/CCSv5/CCSv5_OverviewWorkshop.pdf (see slide 41)
Clyde,
Sorry for dropping the ball on this thread. I also got confused when you were mentioning threads. I was thinking of a forum 'thread'. Unfortunately the tracing type debug functionality is quite limited on MSP430. One option that may work is use function hooks to log the function name or function address that calls the hook. Basically you are doing your own little trace where you are logging every function call. This option will add overhead in terms of both space (hook functions and a circular buffer to store the name/addresses) and performance. Knowing how code size is a big concern on MSP430, this may add too much overhead in the space department. But if you still want to explore this, function hooks are covered in section 2.13 of the Compiler User's Guide:
http://www.ti.com/lit/ug/slau132e/slau132e.pdf
There is also a wiki topic that covers how function hooks are used for profiling. The examples are for C6000 but it gives you an idea of how function hooks can be used. Might be useful to take a peek.
http://processors.wiki.ti.com/index.php/Profiling_on_the_C6000_using_Function_Hooks
Sorry, I can't think of a better option. Hopefully some others in the forum can provide some insight.
Thanks
ki
Clyde,
--entry_hook is a compiler option. You enable function hooks in the build options and specify if you wish to pass the address or function name to the hook function. You can also specify the name of your hook function. In the example below, I am passing in the name of the function that is calling the hook function to the hook function so I can log it. I have specified the name of my hook function as 'logFxnName'.
The next step would be to create a function called logFxnName that has the caller function name as a parameter. Then this function would write the caller function name to a buffer (or where ever you wish).
Did you check out that wiki topic? Even though it is for C6000, many of the concepts regarding function hooks is generic enough that it applies to all devices using function hooks. It shows code examples of hook functions and some cool things you can do in there. It also has an example of the BIOS task switch hook feature to be able to identify via task if you are using BIOS.
http://processors.wiki.ti.com/index.php/Profiling_on_the_C6000_using_Function_Hooks
Note that the screenshot for the build options is outdated.
Thanks
ki
Yeah the insert image thing is confusing. When I select an image, I have to wait until I get the little green 'uploaded' message and then I have to make sure I hit the 'insert' button. Then when I post my image, it will appear.
Clyde -
Clyde Eisenbeis said:
You are getting an linker error saying that it could not find the entry/exit hook functions you specified in the compiler options. Did you actually create the 'LogEntryHooks' and 'LogExitHook' functions and add them to your project?
I also see you that you are passing in anything to your hook functions (2nd and 4th options are blank). If you want to log the function name, you'll have to pass in the name or address of the function (use the drop down menu to select name or address)
This sounds like a lot of work. What are the contents of the functions?
I need to add the name of every function?
Do you have example code?
It seems that Code Composer should be able to log every function called ... similar to the Debug Thread ... without any modifications to the code.
Clyde Eisenbeis said:This sounds like a lot of work. What are the contents of the functions?
It can be anything you want. It is completely up to you. In your case you want it to log the function name to a buffer (or cio thought that may be too heavy)
Clyde Eisenbeis said:I need to add the name of every function?
Do you have example code?
Please check out:
http://www.ti.com/lit/ug/slau132e/slau132e.pdf (section 2.13)
http://processors.wiki.ti.com/index.php/Profiling_on_the_C6000_using_Function_Hooks
The first link details how to pass the function name of the calling function to the hook function. The second link shows an actual code example using the function address. There is also example code of a hook function.
Clyde Eisenbeis said:It seems that Code Composer should be able to log every function called ... similar to the Debug Thread ... without any modifications to the code.
It depends on the device. Some devices support the advanced tracing capabilities provided by CCS. Other devices (like MSP430) do not.
ki