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/EK-TM4C123GXL: main_PDI_APP.c being referred instead main_single_driver.c

Part Number: EK-TM4C123GXL
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

Hi,

I am trying to debug EK-TM4C123GXL project into Single driver mode (with active eTC_G2_Size_Aurora_Mb EPD). But the main() being call is always of main_PDI_APP.c instead of main_single_driver.c (in this EPD updates two images alternatively)

Please see below screen shots for your reference. And please let me know if you need any other information from me.

When I tried to move the main_PDI_APP.c at other location, hoping that main_single_drive.c will be referred but got below error. 

Thanks,

Sanjeev

  • Sanjeev,

    The symbols in the .out file are indicating that it is main_PDI_APPs.c that was used to build the program. You can right click on a file in Project Explorer in CCS and select to Exclude a file from the build for the active configuration. For example you could both files in your project but a PDI config that excluded the "single" .c file and a Single configuration that excluded the PDI .c file.

    There is more information on build configurations here:
    dev.ti.com/.../

    From what you are describing the main_PDI_APPS.c was part of the build, excluding it and rebuilding the project would cause it to not be included in the build. If you want to attach your project I could take a look at it.

    Regards,
    John
  • John,

    As you mentioned, the file is excluded from the build and rebuilt. But still, on debug, the main() of main_PDI_APP.c is being referred. Please see attached project explorer screenshot below. And let me know if anything I am missing here.

    Thanks,

    Sanjeev

  • The console view looks odd with all the output displayed. Looks like something has gone wrong with a post build step. Makes me wonder if the build is completing. If you do a "Clean Project" prior to the build does the EK-TM4C123GXL.out get regenerated?

    Another way to look at what is going into the program is to open the modules view when in a debug session. On the View menu you can select Modules. This view is reading the symbol information in the .out file. It has a node in the tree for files and you can see what files were used to build the program.

    John
  • John,

    You got it right,  the build is not complete. I did not notice failure message in console, as I saw only the only last message "build finished". It is giving below error. I am trying to resolve this now, but no success yet. Do let me know if you have inputs.

    Thanks,

    Sanjeev

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    **** Clean-only build of configuration eTC_G2_Size_Aurora_Mb for project EK-TM4C123GXL ****

    "C:\\ti\\ccsv7\\utils\\bin\\gmake" -all clean

    C:\ti\ccsv7\utils\bin\gmake: invalid option -- a
    Usage: gmake [options] [target] ...
    Options:
    -b, -m Ignored for compatibility.
    -B, --always-make Unconditionally make all targets.
    ......
    ......
    -q, --question Run no recipe; exit status says if up to date.
    -r, --no-builtin-rules Disable the built-in implicit rules.
    -R, --no-builtin-variables Disable the built-in variable settings.
    -s, --silent, --quiet Don't echo recipes.
    -S, --no-keep-going, --stop
    Turns off -k.
    -t, --touch Touch targets instead of remaking them.
    --trace Print tracing information.
    -v, --version Print the version number of make and exit.
    -w, --print-directory Print the current directory.
    --no-print-directory Turn off -w, even if it was turned on implicitly.
    -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
    Consider FILE to be infinitely new.
    --warn-undefined-variables Warn when an undefined variable is referenced.

    This program built for Windows32
    Report bugs to <bug-make@gnu.org>

    **** Build Finished ****

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  • John,

    I could get rid of the above error, by creating new project and importing source code again. Now the "EK-TM4C123GXL.out" is getting generated after each build. Please see below the build messages and the project explorer details. So I can say that the issue got resolved for me.

    But I am not able to debug the EK-TM4C123GXL project, even setting the breakpoints in main_single_driver.c. Probably there is another thread on this in TI forum. If you know any thread you can point me to that or if you know the reason for above mentioned debug issue then please let me know. I will also try to resolve the this issue.

    One probable reason I see is that the device variant selected (As I didn't find the EK-TM4C123GXL in properties, I selected Tiva C series TM4C1234GH6pm). Below image is for your reference.


    Sanjeev

  • Sanjeev,

    EK-TM4C123GXL is the part number for the LaunchPad board. You have the correct device selected.

    What happens when you click the bug button? It should switch to the debug perspective in CCS, connect to the board, load the program and run to main(). What do you see?

    Regards,
    John
  • John,

    Excuse me for late reply.

    1) I can load, run, debug program in PDI_App mode.  Toggle between same image works fine.

    2) But I am not able to run, debug the program in Single driver mode (Toggle between two images alternatively) and test basic global update function.  On debug, neither control is not going into main() of main_single_driver.c nor images are changing alternatively on my EPD.

    I followed below steps for before trying the program in Single driver mode

    a) Update conf_EPD.h and main_Single_driver.c for EPD1.44 (which I am using). Below is the snapshot for your reference.

    b) No errors in build, except one warning ""../src/main_single_driver.c", line 74: warning #48-D: incompatible redefinition of macro "USE_EPD_Size". I defined this to activate #if(USE_EPD_Size==sz_eTC_144) section in main_single_drive.c. below snapshot for your reference.

    c) Load .out program to MCU using uniflash. below is the snapshot for your reference.

    regards,

    Sanjeev

  • The warning is happening as you already have USE_EPD_Size defined somewhere else. I am not sure that this is related to the problem you are seeing but likely should be resolved. You should be able to find the other one using Search.

    Why are you loading via UniFlash? CCS will load the program for you when you click on Debug. You can also load a different program in CCS when in a debug session by clicking on the Load Program button.

    What does the "Debug View" in CCS look like after you click on the bug button in CCS? You mentioned that you are not able to Run and Debug. If you can attach a capture of the debug view we can see what state CCS thinks the system is in.

    John
  • John,

    Here are answers to your comments in sequence.

    1) The other USE_EPD_Size is in conf.h. I can get rid of the warning by comment USE_EPD_Size in main_single_driver.c. But the moment I comment that line, the if condition block related code gets grayed out. Please refer below for your reference.

    2) Yes, I knew that CCS loads the program. But when I was facing this debug issue, I thought of to load the .out file through Uniflash. Anyway, now I am not using Uniflash to load the program.Still the issue persist.

    3) Please see below for your reference. And let me know if you need any other information. In debug mode, the step-in step-over buttons are not enabled and also program is not halting at breakpoints set.

    regards,

    Sanjeev

  • Sanjeev,

    CCS is reporting the device as running. Normally it would allow you to click the halt/pause button to stop the program. In this case that button is disabled which makes me think that the device is in a bad state. My assumption is that the program has loaded and attempted to run to main but something is wrong with the application and it does not get there.

    You could try a manual debug launch by doing the following:

    Go to the view menu and select Target Configurations. This will open the target configurations view.
    Find the .ccxml file for your project. Right click on it and select launch selected configuration.
    This will launch a debug session for that configuration.
    Then click on the connect button.
    Go to the Tools menu and select Debugger Options, then Auto Run and Launch Options
    uncheck the box "On a program load or restart" in the Auto Run section.
    Then click on the load program button and select your program.
    I suspect that your device will be in an ok state at this point.
    Now if you try to run to main it will get into a bad state.

    Is that the case?

    John
  • John,

    1) I didn't get what you meant by "device is in bad state"? Is that mean at some point the device won't be able to debug?

    2)  I tried debug steps you mentioned.  Below are few related screenshots.

    ++++++Before click on Connect Target

    +++++++After clicking Connect target

    +++++++++++Debug error, not going to main(). Is that what you meant by device in bad state?

    regards,

    Sanjeev

  • Go to the view menu and select Target Configurations. This will open the target configurations view.

    Find the .ccxml file for your project. Right click on it and select launch selected configuration.

    This will launch a debug session for that configuration.

    Then click on the connect button.

    Go to the Tools menu and select Debugger Options, then Auto Run and Launch Options

    uncheck the box "On a program load or restart" in the Auto Run section.

    Then click on the load program button and select your program.

    I suspect that your device will be in an ok state at this point.

    Now if you try to run to main it will get into a bad state.

    Looking at the screen captures I can see that you did the steps in Green for sure but I can't tell if you did the one in red above prior to running.

    Basically I think that the program you are loading and then running is putting the device in a bad state.  I am not an expert on TM4C development but it looks like CCS is behaving ok.

  • Hi John,

    I have done the steps as you mentioned but still no success. Please let me close this thread, I will keep trying though.

    regards,
    Sanjeev