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.

TM4C1230E6PM: Trace Analysis

Part Number: TM4C1230E6PM
Other Parts Discussed in Thread: SYSBIOS

Tool/software:

Hi,

I'm trying to run trace analysis (function profiling, CPU load measurements) on a Tiva Ware TM4C1230E6PM using a BlackHawk TMDSEMU200-U Debug Probe.

My Application does not use TI-RTOS, but my understaing is, that this is needed to use the trace analysis functions. Is this correct?

In looking for Documentation I found this System Analyzer User Guide, which describes the process of setting up RTOS and UIA for Code Composer v6.0. Is this the most up-to-date Version?

I recently had Problems with Using this Debugging Probe with CCS v12, which is why I'm now using CCS 11.2. However I find many of the instructions given in the User Guide to not make sense, as I guess the programm structure has changed. I was able to install TI-RTOS from here.

For example:

  • I did not find the "XGCONF" tool, nor any "project’s configuration file (*.cfg)". I assume this has since become the "target configuration" (.ccxml)?
  • I could Import TI-RTOS for TivaC in Project Properties/CCS General/Products, however when I open View/other/Available Products (as described in the User Guide on page 90) nothing gets listed there. Instead it says: "Shows modules on the package path of a RTSC project. The view is currently empty because there is no RTSC Configuration File open.

The Debug probe works for the normal functionality: I can flash code with it and use break points the halt code execution. When I try to use any of the trace functions this message appears:

How do I properly enable UIA instrumentation for my application?

Thanks for any help in advance!

  • Hi,

    The Debug probe works for the normal functionality: I can flash code with it and use break points the halt code execution. When I try to use any of the trace functions this message appears:

    How do I properly enable UIA instrumentation for my application?

      Sorry, I'm not an expert in these tools. Personally, I have not used System Analyzer/UIA for TI-RTOS projects but ROV occasionally. I think this post by Todd has good information on how to use System Analyzer for debugging TI-RTOS projects with example projects.

    https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/953527/faq-ccs-how-can-i-use-system-analyzer-rtos-analyzer-to-debug-a-ti-rtos-sys-bios-application

    My Application does not use TI-RTOS, but my understaing is, that this is needed to use the trace analysis functions. Is this correct?

    I believe so. 

    • I did not find the "XGCONF" tool, nor any "project’s configuration file (*.cfg)". I assume this has since become the "target configuration" (.ccxml)?
    • I could Import TI-RTOS for TivaC in Project Properties/CCS General/Products, however when I open View/other/Available Products (as described in the User Guide on page 90) nothing gets listed there. Instead it says: "Shows modules on the package path of a RTSC project. The view is currently empty because there is no RTSC Configuration File open.

    Suppose you have already imported a TI-RTOS project for TM4C123 from Resource Explorer then you will find the .cfg in the project directory. See below. 

    If you right-click the .cfg file you will see a menu where you can choose Open With->XCONF to open the .cfg file in GUI mode. 

    You will then see the below page brought up. 

    I want to also give you a heads-up. I will be OOO for a week and if you have any follow-up questions, my response will be very much delayed. Sorry for any inconvenience. 

  • Hi Charles,

    Thanks for your reply.

    I tried setting up an emtpy RTOS project to test things out. I found that simply adding any file with .cfg extension to the project turns it into a RTOS project and the things mentioned in the user Guide appear.

    I then had problems with building the example until I installed and used these exact versions of TI-RTOS[2.16.1.14] and XDCtools [3.32.0.06].

    Now running my code gives me the error "#10099-Dprogram will not fit into available memory.  run placement with alignment fails for section ".vtable" size 0x26c , overlaps with ".vecs", size 0x360 (page 0)    tm4c1230e6pm.cmd"

    I found this also described here on the Forum, where it is said, that this comes from having Interrupts from TivaWare and Interrupts from Sys/BIOS enabled.

    How can I resolve this conflict for my problem? I need the TivaWare Interrupts, because they are integral to my application, but I still want to use the advanced trace analysis functionalities. Can I disable Sys/BIOS interrupts and still do code profiling etc?

  • I then had problems with building the example until I installed and used these exact versions of TI-RTOS[2.16.1.14] and XDCtools [3.32.0.06].

    Yes, please use these versions only.

    Now running my code gives me the error "#10099-Dprogram will not fit into available memory.  run placement with alignment fails for section ".vtable" size 0x26c , overlaps with ".vecs", size 0x360 (page 0)    tm4c1230e6pm.cmd"

    Which example did you import? 

    I found this also described here on the Forum, where it is said, that this comes from having Interrupts from TivaWare and Interrupts from Sys/BIOS enabled.

    No, you should never mix interrupt using TivaWare and interrupts using TI-RTOS. Doing so will destroy the vector table that is created by TI-RTOS. You should only use TI-RTOS's Hwi module to handle interrupts.

    Sorry, I'm currently on vacation and my response will be very much delayed.

  • Hi Charles,

    Thanks for your reply. I hope you have a nice vacation and only read this when you are back!

    I used the helloworld example from the TI-RTOS examples. This one did run fine.

    My own application uses TivaWare Interrupts. Disabling them for debugging does not make sense.

    In summary: It is not possible to use trace features with TivaWare applications that use TivaWare Interrupts, is that correct?

  • Hi Dominic,

      Please refer to this post answered by Todd as why you can't mix TivaWare generated interrupts with TI-RTOS managed interrupts. Whatever interrupts you are currently using in TivaWare, you can let the TI-RTOS Hwi handle it so that the interrupt vector table is not messed up. 

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/849627/faq-can-i-update-the-vector-table-with-intregister-when-using-ti-rtos?tisearch=e2e-sitesearch&keymatch=ti-rtos%20vector%20table#

    This post will be useful if you want to use zero-latency interrupt in TI-RTOS. 

    /cfs-file/__key/communityserver-discussions-components-files/908/8358.C28_5F00_zero_5F00_latency.pdf

  • Hi Charles,

    Thanks for your reply. I understand that the two are not compatible.

    Whatever interrupts you are currently using in TivaWare, you can let the TI-RTOS Hwi handle it so that the interrupt vector table is not messed up. 

    How can I do that? Can you make a concrete example (e.g. with a program using ADCIntRegister and GPIOIntRegister)?

  • Hi Dominic,

      Please take a look at the below example. Here, Hwi module is used managed the Timer2A interrupt with the vector 39. If you have a ADC0 Sequence 0 interrupt, you would use vector number 30 and plug your ISR function. 

    //----------------------------------------
    // BIOS header files
    //----------------------------------------
    #include <xdc/std.h> //mandatory - have to include first, for BIOS types
    #include <ti/sysbios/BIOS.h> //mandatory - if you call APIs like BIOS_start()
    #include <xdc/runtime/Log.h> //needed for any Log_info() call
    #include <xdc/cfg/global.h> //header file for statically defined objects/handles
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Error.h>
    #include <ti/sysbios/hal/Hwi.h>


    //------------------------------------------
    // TivaWare Header Files
    //------------------------------------------
    #include <stdint.h>
    #include <stdbool.h>

    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"
    #include "inc/hw_ints.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/timer.h"


    //----------------------------------------
    // Prototypes
    //----------------------------------------
    void hardware_init(void);
    void ledToggle(void);


    //---------------------------------------
    // Globals
    //---------------------------------------
    volatile int16_t i16ToggleCount = 0;


    //---------------------------------------------------------------------------
    // main()
    //---------------------------------------------------------------------------
    void main(void)
    {

    hardware_init(); // init hardware via Xware

    Hwi_Params hwiParams;
    Hwi_Handle myHwi;
    Error_Block eb;
    /* Initialize error block and hwiParams to default values */
    Error_init(&eb);
    Hwi_Params_init(&hwiParams);
    hwiParams.enableInt = FALSE;
    myHwi = Hwi_create(39, (Hwi_FuncPtr)ledToggle, &hwiParams, &eb);
    if (myHwi == NULL) {
    System_abort("Hwi create failed");
    }
    Hwi_enableInterrupt(39);


    BIOS_start();

    }


    //---------------------------------------------------------------------------
    // hardware_init()
    //
    // inits GPIO pins for toggling the LED
    //---------------------------------------------------------------------------
    void hardware_init(void)
    {
    uint32_t ui32Period;

    //Set CPU Clock to 40MHz. 400MHz PLL/2 = 200 DIV 5 = 40MHz
    SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

    // ADD Tiva-C GPIO setup - enables port, sets pins 1-3 (RGB) pins for output
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);

    // Turn on the LED
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 4);

    // Timer 2 setup code
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2); // enable Timer 2 periph clks
    TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC); // cfg Timer 2 mode - periodic

    ui32Period = (SysCtlClockGet() /2); // period = CPU clk div 2 (500ms)
    TimerLoadSet(TIMER2_BASE, TIMER_A, ui32Period); // set Timer 2 period

    TimerIntEnable(TIMER2_BASE, TIMER_TIMA_TIMEOUT); // enables Timer 2 to interrupt CPU

    TimerEnable(TIMER2_BASE, TIMER_A); // enable Timer 2

    }


    //---------------------------------------------------------------------------
    // ledToggle()
    //
    // toggles LED on Tiva-C LaunchPad
    //---------------------------------------------------------------------------
    void ledToggle(void)
    {
    TimerIntClear(TIMER2_BASE, TIMER_TIMA_TIMEOUT); // must clear timer flag FROM timer

    // LED values - 2=RED, 4=BLUE, 8=GREEN
    if(GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_2))
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);
    }
    else
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 4);
    }

    i16ToggleCount += 1; // keep track of #toggles

    Log_info1("LED TOGGLED [%u] TIMES",i16ToggleCount); // send toggle count to UIA

    }