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.

Context highlighting and breakpoint issues



I have 2 projects that I am modifying and downloading to target and running. One project has context highlighting and allows me to set a breakpoint. The other does not. But they both can download to the TI target and run correctly. What am I doing wrong in Code Composer Studio ? A Project setting somewhere?

Also they individually will have an [Active - Debug] indication beside them in the Project Explorer when selected.

Thanks,

-Phil B

  • Hi,

    What CCS version and what device are you using? I think that the settings about syntax highlight are common to the whole workspace, not to individual projects. Any of the projects was imported to the workspace? Do they use linked resources? Maybe the workspace configuration is getting corrupted. The [Active - Debug] means that you're using the Debug Build Configuration, not the Release Build Configuration.

    Regards

    J

  • Thanks for the response, J.

    I am using Code Composer Studio Version 5.5 and connected to a Tiva DK-TM4C123G. Ok I have looked closer and there is actually just a single file that is giving me this problem. I have a clone of one of the Tiva demo projects. I cloned the project uart_echo to make some mods. In that clone only the file uart_echo.c has the problem.

    Again, the project builds downloads and runs. After download I can step thru the program but dont appear to be able to view registers or set breakpoints.

    The code is badly hacked up in the isr but it does build and run. File enclosed.

    Also debugger complains about an asm file not containing frame info.

    Thanks again,

    -Phil

    //*****************************************************************************
    //
    // uart_echo.c - Example for reading data from and writing data to the UART in
    //               an interrupt driven fashion.
    //
    // Copyright (c) 2011-2013 Texas Instruments Incorporated.  All rights reserved.
    // Software License Agreement
    // 
    // Texas Instruments (TI) is supplying this software for use solely and
    // exclusively on TI's microcontroller products. The software is owned by
    // TI and/or its suppliers, and is protected under applicable copyright
    // laws. You may not combine this software with "viral" open-source
    // software in order to form a larger program.
    // 
    // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
    // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
    // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    // DAMAGES, FOR ANY REASON WHATSOEVER.
    // 
    // This is part of revision 1.1 of the DK-TM4C123G Firmware Package.
    //
    //*****************************************************************************
    
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    //#include "inc/hw_types.h"
    #include "driverlib/debug.h"
    #include "driverlib/fpu.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "driverlib/rom.h"
    #include "grlib/grlib.h"
    #include "drivers/cfal96x64x16.h"
    
    //*****************************************************************************
    //
    //! \addtogroup example_list
    //! <h1>UART Echo (uart_echo)</h1>
    //!
    //! This example application utilizes the UART to echo text.  The first UART
    //! (connected to the USB debug virtual serial port on the evaluation board)
    //! will be configured in 115,200 baud, 8-n-1 mode.  All characters received on
    //! the UART are transmitted back to the UART.
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    // The error routine that is called if the driver library encounters an error.
    //
    //*****************************************************************************
    volatile uint32_t g_ui32UARTTxCount = 0;
    volatile uint32_t g_ui32UARTRxCount = 0;
    #ifdef DEBUG
    void
    __error__(char *pcFilename, uint32_t ui32Line)
    {
    }
    #endif
    #define MAX_RX_BUFF_SIZE 10
    char g_ui32RxBuff[MAX_RX_BUFF_SIZE];
    //*****************************************************************************
    //
    // The UART interrupt handler.
    //
    //*****************************************************************************
    uint32_t ui32Count = 0x30;
    void
    UARTIntHandler(void)
    {
        uint32_t ui32Status;
    
        //
        // Get the interrrupt status.
        //
        ui32Status = ROM_UARTIntStatus(UART0_BASE, true);
    
        //
        // Clear the asserted interrupts.
        //
        ROM_UARTIntClear(UART0_BASE, ui32Status);
    
        //
        // Loop while there are characters in the receive FIFO.
        //
        g_ui32UARTRxCount = 0;
        while(ROM_UARTCharsAvail(UART0_BASE))
        {
            //
            // Read the next character from the UART and write it back to the UART.
            //
    g_ui32RxBuff[g_ui32UARTRxCount] = ROM_UARTCharGetNonBlocking(UART0_BASE);
        	ui32Count++;
        	
    //    	if (g_ui32UARTRxCount == 0)
    //        ROM_UARTCharPutNonBlocking(UART0_BASE, 0x41);
    //    	else if (g_ui32UARTRxCount == 1)
    //        ROM_UARTCharPutNonBlocking(UART0_BASE, 0x43);
    //    	else if (g_ui32UARTRxCount == 2)
    //        ROM_UARTCharPutNonBlocking(UART0_BASE, 0x4B);
    //    	else if (g_ui32UARTRxCount == 3)
    //        ROM_UARTCharPutNonBlocking(UART0_BASE, 0x0a);
        g_ui32UARTRxCount++;
            
    //        ROM_UARTCharPutNonBlocking(UART0_BASE,
    //                                   ROM_UARTCharGetNonBlocking(UART0_BASE));
    ////        ROM_UARTCharPutNonBlocking(UART0_BASE,
    ////                                   ui32Count);
    ////    	ui32Count++;
    //        GrStringDrawCentered(&sContext, "to UART0.", -1,
    //                             GrContextDpyWidthGet(&sContext) / 2, 40, false);
    
    //        usnprintf(pcBuffer, 16, "%d ", ui32Count);
    //        GrStringDraw(&g_sContext, pcBuffer, -1, 40, 12, true);
    ////        uint32_t ui32Count2 = 0x35;
    ////        ROM_UARTCharPutNonBlocking(UART0_BASE,
    ////                                   ui32Count2);
        }
    //        ROM_UARTCharPutNonBlocking(UART0_BASE, 0x43);
    
        ui32Count++;
    }
    
    //*****************************************************************************
    //
    // Send a string to the UART.
    //
    //*****************************************************************************
    void
    UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count)
    {
        //
        // Loop while there are more characters to send.
        //
        while(ui32Count--)
        {
            //
            // Write the next character to the UART.
            //
            ROM_UARTCharPutNonBlocking(UART0_BASE, *pui8Buffer++);
        }
    }
    
    //*****************************************************************************
    //
    // This example demonstrates how to send a string of data to the UART.
    //
    //*****************************************************************************
    int
    main(void)
    {
        tRectangle sRect;
        tContext sContext;
    
        //
        // Enable lazy stacking for interrupt handlers.  This allows floating-point
        // instructions to be used within interrupt handlers, but at the expense of
        // extra stack usage.
        //
        ROM_FPULazyStackingEnable();
    
        //
        // Set the clocking to run directly from the crystal.
        //
        ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                           SYSCTL_XTAL_16MHZ);
    
        //
        // Initialize the display driver.
        //
        CFAL96x64x16Init();
    
        //
        // Initialize the graphics context.
        //
        GrContextInit(&sContext, &g_sCFAL96x64x16);
    
        //
        // Fill the top part of the screen with blue to create the banner.
        //
        sRect.i16XMin = 0;
        sRect.i16YMin = 0;
        sRect.i16XMax = GrContextDpyWidthGet(&sContext) - 1;
        sRect.i16YMax = 9;
        GrContextForegroundSet(&sContext, ClrDarkBlue);
        GrRectFill(&sContext, &sRect);
    
        //
        // Change foreground for white text.
        //
        GrContextForegroundSet(&sContext, ClrWhite);
    
        //
        // Put the application name in the middle of the banner.
        //
        GrContextFontSet(&sContext, g_psFontFixed6x8);
        GrStringDrawCentered(&sContext, "uart-echo", -1,
                             GrContextDpyWidthGet(&sContext) / 2, 4, 0);
    
        //
        // Initialize the display and write some instructions.
        //
        GrStringDrawCentered(&sContext, "Connect a", -1,
                             GrContextDpyWidthGet(&sContext) / 2, 20, false);
        GrStringDrawCentered(&sContext, "terminal", -1,
                             GrContextDpyWidthGet(&sContext) / 2, 30, false);
        GrStringDrawCentered(&sContext, "to UART0.", -1,
                             GrContextDpyWidthGet(&sContext) / 2, 40, false);
        GrStringDrawCentered(&sContext, "115000,N,8,1", -1,
                             GrContextDpyWidthGet(&sContext) / 2, 50, false);
    
        //
        // Enable the peripherals used by this example.
        //
        ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
        ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    
        //
        // Enable processor interrupts.
        //
        ROM_IntMasterEnable();
    
        //
        // Set GPIO A0 and A1 as UART pins.
        //
        ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
        //
        // Configure the UART for 115,200, 8-N-1 operation.
        //
        ROM_UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 115200,
                                (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                                 UART_CONFIG_PAR_NONE));
    
        //
        // Enable the UART interrupt.
        //
        ROM_IntEnable(INT_UART0);
        ROM_UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
    
        //
        // Prompt for text to be entered.
        //
        UARTSend((uint8_t *)"Enter text: ", 12);
    
        //
        // Loop forever echoing data through the UART.
        //
        while(1)
        {
        }
    }
    

  • Phil B said:
    Ok I have looked closer and there is actually just a single file that is giving me this problem. I have a clone of one of the Tiva demo projects. I cloned the project uart_echo to make some mods. In that clone only the file uart_echo.c has the problem.

    Are you referring to things like "Open Declaration"? If so, check if the Indexer is enabled for this project. If you go into Project Properties, click on Show Advanced Settlings at the bottom, go to C/C++ General->Indexer, you can verify there if the Indexer is enabled. By default, all projects in a workspace will use the workspace settings (which you can get to from Window->Preferences), but it is also possible to set it at the project level.

    Another alternative is to open a new clean workspace and import the project into it, and check if the behavior still remains.

  • I'm not sure what "Open Declaration" is but Indexer is enabled. I have basically done what you have suggested and started a parallel project and moved on. I'm still not sure what is wrong with the original file (and as such I may cause the same behavior again) but I've worked around it. Thanks for your help.