µVISION: INCLUDING C SRC FILES IN A PROJECT
Information in this article applies to:
- C166 Version 4 and Later
- C51 Version 6 and Later
- C251 Version 3 and Later
QUESTION
I have several C files that must be compiled with the SRC
directive. How do I include these files and their .SRC files in a project in µVision?
ANSWER
The following list of steps shows you how to add a C file to your project, compile it with the SRC directive, assemble the .SRC file, and include it in the program linkage:
- Add the C file to your project. If you are adding a .C66 or a .C51 file (as is necessary for some Real-Time Kernels), you must specify that the file is a C Source File.
- Right-click on the file in the project window and select Options for File... This displays the options dialog box.
- From the Properties tab, make sure that Generate Assembler SRC File and Assemble SRC File are both checked. Note that by default these checkboxes are greyed out but checked. There must be a black check on a white background to be checked.
- Build your project as normal and µVision compiles the C file with the SRC directive specified on the command line. An .SRC file is generated and µVision assembles that file and includes it in your program's linkage.
Alternatively, you may add a file group to your project, add the C files to the group, and set the Generate Assembler SRC File and Assemble SRC File options once for the whole group.
MORE INFORMATION
- Refer to ASM in the Cx51 User's Guide.
- Refer to SRC in the Cx51 User's Guide.
SEE ALSO
FORUM THREADS
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Monday, May 05, 2008