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.

TMS320F280025C: Universal Motor Control Lab: Problem with CCS project going to original folder and ignoring local changes

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE

I created a custom project based on the Universal Motor Control Lab.

I copied files from the Universal Motor Control Lab into the custom project, so that I can make modifications there.  These are local copies of the files within the custom project, and are no longer links to the original files in the original project at C:\ti\c2000\C2000Ware_MotorControl_SDK_4_02_00_00\solutions\universal_motorcontrol_lab

I have updated the custom project INCLUDES search paths to local paths within the custom project (and no longer pointing to the original project)

As an example of what I'm seeing, I modified MOTOR_Vars_t in the custom project to add a couple of data fields.   The project builds without error, and I do not see compiler errors when accessing these data fields.  


However, when running the custom project, <something> is still referring to the original MOTOR_Vars_t structure, so that data access is becoming offset.  For example, if the original struct might have been:

typedef struct{

oldmember1,

oldmember2

} EXAMPLE_STRUCT_t

And the new struct might be

typedef struct{

oldmember1,

newmember,

oldmember2

} EXAMPLE_STRUCT_t

If I try to access newmember in, the compiler does not complain.  But at runtime, if I try to access newmember, the data read is oldmember2.

This is what is happening with MOTOR_Vars_t from the universal motor control project.  Runtime does not use the updated MOTOR_Vars_t struct from the custom project.

As a test, I deleted the .settings folder in the custom project.  On opening the project, CCS created a new .settings directory, and populated it with settings from the original project.  So there is still some link from the custom project to the original project.

My overall goal is that the custom project should use the custom/local MOTOR_Vars_t for runtime, and NOT use the MOTOR_Vars_t from the original project.  Any suggestions on how I can break this link and get the custom project working correctly?

Thanks!

Thanks!

  • As an update...

    For the issue above, *after* attempting to remove all references to the original universal motor control lab project, I created a new folder in the copied / custom project.  I added a C file to this new folder, and it is within this file that I see the issue described in the original post, where the original struct was referenced instead of the local/updated definition.

    As a test, I copied one of the impacted functions into motor1_drive.c  This is the motor1_drive.c in the custom/copied project, not the original project in the SDK. 

    In this case, the code worked as expected!   So it seems to be an issue with the new folder or new file picking up the original MOTOR_Vars_t from the SDK instead of the new/local/custom copy.

    To summarize again:

    1. Copy Universal Motor Control project from SDK solutions directory to new project.  

    2. Remove links to the original project in the SDK.  Create local copies of all .c and .h files.  Update macros and settings to point to the local copies of the project.

    3. Update MOTOR_Vars_t in the new/copied project.

    4. Create a new folder and new .c file in the copied project

    5. Access to the updated MOTOR_Vars_t in the new project from the new .c file does not work.  It instead accesses the original MOTOR_Vars_t definition from the SDK project.

    6. Access to the updated MOTOR_Vars_t from motor1_drive.c in the new project does work.  

    I have a work-around, at least, if I just use motor1_drive.c.   


    Still, it would be nice to understand what is happening with creating new folders and files.

    Thanks!

  • Hi Mark,

    We had recognized this issue of linking versus copying files when creating a new / custom project. I believe we addressed this in the MCSDK v4_02 release even, where the 'universal_motorcontrol_lab.projectspec' file now copies all files instead of linking, like below.

    	<file action="copy" path="PROJ_ROOT/common/source/motor1_drive.c" targetDirectory="src_control" />
    	<file action="copy" path="PROJ_ROOT/common/include/motor1_drive.h" targetDirectory="src_control" />

    Does your .projectspec file show copying like this? Or are you still experiencing an issue despite using the updated (copy) projectspec file?

    Best,

    Kevin