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/DK-TM4C129X: No optimization, but single-stepping doesn't proceed through the code exactly as written?

Part Number: DK-TM4C129X
Other Parts Discussed in Thread: TMP100

Tool/software: Code Composer Studio

I have optimization off / set to zero, but when I single-step through my code, it skips around in seemingly random order. Is this normal behavior? How do I single-step in the order that the lines are written?

  • Hi Sarah,
    Optimization is usually the main culprit for this. If you have it disabled (and note the setting to "0" is not the same as "off"), then the only other thing I can think of is that the source file that is being used by the debugger for source stepping is not the same one that was used to build the executable. The only way to properly debug this issue is with a test case. Can you provide one? I just need a simple test case which consists of the project + source files + executable.

    Thanks
    ki
  • I2C_playground.zipHi Ki,

    Here is a .zip of the exported project. The .zip does not contain the TivaWare library, which I reference in my include options.

    I suspect settings in the TivaWare library are causing the issue. I see the "skipping" symptom in tmp100.c, which is in the Sensor Library.

    Thanks!

  • Hi Ki,

    I managed to find a workaround. Instead of referencing the TivaWare libraries directly, I copied over the files I needed into my workspace. This doesn't fully resolve the issue, but now single-stepping works as expected.
  • HI Sarah,

    I believe what is happening is that even though your project is built with optimization off, the project for driverlib has optimization enabled. hence you are linking in an optimized library.  The Debug configuration for the driverlib project is built with -o2.

    Sarah Wang said:
    Instead of referencing the TivaWare libraries directly, I copied over the files I needed into my workspace. This doesn't fully resolve the issue, but now single-stepping works as expected.

    This works since those driverlib files are being compiler with no optimizations since it is part of your project. You can continue to work this way or you can rebuild driverlib without optimization.

    Hope this helps

    ki