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.

MSP432E401Y: Making copy and modifying a program

Part Number: MSP432E401Y

Dear Sirs,

For msp432 we are trying to make a copy of a program in code composer studio.  We want to perform modifications to the copy program. Its compilation fails. The original main.c compiles without errors.

Can you please help us with creating a copy and working with it?

Thank you in advance

Edmond.

  • Hi Edmond

    To make a copy of a program or project in Code Composer Studio (CCS) without breaking compilation, you must handle how CCS manages source files and project dependencies.
    If your compilation is failing, it is usually because of one of two common mistakes:
    1. Duplicate main() functions: You copied main.c into the same project, causing a "symbol redefined" error because a project can only have one main().
    2. Broken Paths/Links: You copied the entire project, but linked files or include paths are still pointing to the old project location or are broken.
    Here is how to properly do both methods.
    Method 1: Duplicating a File (Inside the Same Project)
    If you just want to test changes in a new file within your existing project, you must exclude the original file from the build so they do not conflict.
    1. Right-click your original main.c and select Copy.
    2. Right-click the project folder and select Paste. Rename it (e.g., main_modified.c).
    3. Crucial Step: Right-click the original main.c, select Exclude from Build.
      • The original file icon will turn gray with a slash through it. CCS will now ignore it during compilation, leaving only your new main_modified.c active.
    Method 2: Duplicating the Entire Project (Recommended)
    If you want a completely separate standalone program, copy the entire project layout.
    1. In the Project Explorer tab, right-click the original project and select Copy.
    2. Right-click an empty space in the Project Explorer and select Paste.
    3. Enter a new name for your copied project when prompted.
    4. Clean the project: Right-click your new project and click Clean Project, then click Build Project.
    Thanks
  • Hello Xiaodong LI

    Thank you for you help. I really appreciate it.

    I tried the second method (duplicating the entire project)

    I get the following error messages

    >> Compilation failure
    subdir_rules.mk:30: recipe for target 'Lab13_Timersmain3ph.obj' failed
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/Bump.c', needed by 'Bump.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/Clock.c', needed by 'Clock.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/CortexM.c', needed by 'CortexM.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/LaunchPad.c', needed by 'LaunchPad.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/Motor.c', needed by 'Motor.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/PWM.c', needed by 'PWM.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/TExaS.c', needed by 'TExaS.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/TimerA1.c', needed by 'TimerA1.obj'.
    gmake: *** No rule to make target 'C:/ti/ccs1031/ccs/eclipse/file/C/tirslk_max_1_00_00 (1)/tirslk_max_1_00_00/inc/blinker.c', needed by 'blinker.obj'.
    "../Lab13_Timersmain3ph.c", line 58: fatal error #1965: cannot open source file "..\inc\bump.h"
    1 catastrophic error detected in the compilation of "../Lab13_Timersmain3ph.c".
    Compilation terminated.
    gmake: *** [Lab13_Timersmain3ph.obj] Error 1

    I really appreciate you help on resolving this problem.

    Edmond.

  • Hi Edmond

    I will check and reply in the next week

    Thanks

  • Hi Edmond

    The error occurs because Code Composer Studio (CCS) is looking for linked source files using an broken absolute path that points inside the Eclipse installation directory instead of your actual workspace. When you duplicated the project, CCS preserved these corrupted, rigid file paths (C:/ti/ccs1031/ccs/eclipse/file/...) which do not exist.
    To fix this, you need to repair the project's include paths and linked files so they point to your real Texas Instruments Robot Systems Learning Kit (TI-RSLK) installation folder.
    Step 1: Fix the Project Include Search Paths
    1. Right-click your new duplicated project in the Project Explorer and select Properties.
    2. Navigate to CCS Build -> ARM Compiler -> Include Options.
    3. Look at the bottom pane ("Add dir to #include search path...").
    4. Look for any path that resembles ../inc or has a warning icon. Select it and click Edit (or delete it and click Add...).
    5. Change it to use the workspace macro or point directly to your actual TI-RSLK inc folder. For example:
      ${PROJECT_ROOT}/../inc
      (or click Browse... and manually select the valid inc folder containing bump.h on your hard drive).
    6. Click Apply and Close
    Step 2: Fix or Re-link the Missing .c Files
    If the .c files in your Project Explorer have a small arrow overlay icon (indicating they are shortcuts/links), they are still pointing to the wrong path.
    1. In the Project Explorer, select the broken linked files (Bump.c, Clock.c, etc.).
    2. Right-click and select Delete (don't worry, this only deletes the broken shortcuts, not your actual source code).
    3. Open your Windows File Explorer and navigate to your actual TI-RSLK directory where the true inc folder lives (e.g., C:/tirslk_max_1_00_00/inc/).
    4. Select the required .c files (Bump.c, Clock.c, CortexM.c, etc.).
    5. Drag and drop them from Windows File Explorer directly onto your project name inside the CCS Project Explorer tab.
    6. When prompted by CCS, choose "Link to files" (and check "Create link locations relative to: PROJECT_ROOT") instead of "Copy files".
    Step 3: Clean and Rebuild
    Thanks!