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.
Hi -
I'm trying to build the UserExperienceDemo -slac227f - for the MSP-EXP430F5438 using CCSv4.1.2.00027.
I tried importing the project, but that caused some seriously strange problems, so I built the project from scratch. I've imported the HAL directory, the UserExperience directory, and the main.c and the Lowinit.c files. When I compile, I get the following errors. It seems like the includes and defines in the higher-level files are not being seen by the lower-level c files.
Help?
All I can tell is that these variables/constants are NOT part of the normal 5438 processor and not stored in its info memory or TLV structure, so they are not part of the normal 5438 header files. If they are used inside the project, they must have been divided somewhere else.
I just checked the code and they are defined in UserExperience_F5438(A).c . There is, however, no header files tha tmakes these 'variables' available to the other modules. Instead. UserExperience directly includes all otehr C files. If your project tries to compile them separately, these errors are unavoidable.
Personally, I consider it a bad programming style to include one .c file into another. If you include something, it should be either a .h file or something like .inc or so. Everything else only leads to confusion, as one can clearly see here. Normally, header files should be generated for each .c file and each .c file should be an individual compilation unit.
Matt & Jens-Michael,
in the UserExperienceDemo folder, all .c files except UserExperience_F5438.c and flashUtils.c should be excluded from build. See screenshot below for reference. Reason being, as Jens-Michael has also found out, is that these .c files are actually being included by the main code file, UserExperience_F5438.c. Agreeably, it is not the standard to include ".c" files, and as a matter of fact, these .c files were originally ".inc" as they're codes meant to be included. However, with the default CCS editor settings, all these files will show up as text files with no syntax highlighting. Essentially the idea of breaking up literal code text into smaller files was to separate each key feature of the demos (audio, uniball, clock, etc.) in a separate file for easy code view. In retrospect, and from SW dev. perspective, modularize the code functionally would be more portable and easier to follow.
Regards,
Dung
I suggest renaming these files to .h then. This should also trigger the syntax highlighting while not tempting to include them as separate compilation units.
It's still not the best style (separate comilation units with own header files would be better, as .h files shouldn't generate any code), but at least it will prevent greater confusion. And I must admit that I did it too in one of my projects, where different code for handling the UART needs to be inlcuded depending on the UART type (USCI, USART etc.)
And after all, header files are there for being included. Just that these then may be only included once per project.
It would be, however, a smart move to put the variable definition into the included files where they belong. And not into the main .c file.
I've gotten the code working. I needed to do a couple of things:
1. Exclude all of the UserExperienceDemo files except flashUtils.c and UserExperience_F5438.c. I'm not sure why all of the other *.c files would be included in the UserExpeience_F5438.c file but not flashUtils.c.
2. I needed to change one compiler option to use large-data memory model.
Secondly, I also got it to work by doing a simple "Import Existing CCE/CCS Eclipse Project". I had tried this many time before, but once I left this "Copy projects into workspace" box unchecked it finally worked.
I had wanted to leave my downloaded copy alone and not modify it, so I thought it made sense to copy the project over into my own workspace. However, when I would do an import with the box checked, the target project folder would start creating directories within directories (like a house of mirrors - it just kept going as far as you could see). Eventually this directly contained almost 100,000 files, was almost 200MB, and XP could not delete it because the path+filenames were greater than XP allowed!!! In case anyone else gets into this mess, I found an app called "DelinvFile" that took care of delteing these folders for me:
http://www.purgeie.com/delinv/index.htm
Matt,
That last issue with creation of recursive directories is a known bug in Eclipse and occurs when the workspace directory is the same as the project directory. Please take a look at this wiki article http://processors.wiki.ti.com/index.php/Recursive_Directory_Bug_in_Eclipse_Project_Import and the Eclipse bug mentioned here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=279781
**Attention** This is a public forum