This post was last edited by Jacktang on 2018-8-19 22:20 To build a complete project in CCS, at least the following four files are required: memory allocation cmd file, C language system library rts2xx.lib, c source file containing main function, vector jump table asm assembly file. (1) The cmd command file is used to allocate storage space. (2) rts2xx.lib is the C language system library, which contains all the functions provided by the compiler: ① Initialize the C language environment (the entry address is _c_int0), ② Set up the stack, and ③ Provide a standard C language function library. (3) There is only one c source file containing the main function. After the system library is initialized, the control is handed over to the main() function. (4) The vector jump table file is usually in the form of an assembly file (asm). This file needs to be accurately located at the starting address of the program, and its content is the unconditional jump statement "B" in the assembly statement. The general process of program execution is: the first instruction of the vector table can be set to "B _c_int0", so that after power-on reset, the control is handed over to the system library. After the system library is initialized, the control is handed over to the main() function. 1. The main function of the include header file (.h) Header files are generally used to define functions, parameters, variables and some macro units in the program, and are used in conjunction with library functions. Therefore, when using a library, the corresponding header file description must be used. 2.DSP/BIOS CONFIG FILES These files are automatically generated after you save the BIOS configuration when developing a DSP/BIOS-based program. When you save the BIOS configuration, program.cbd/programcfg.h54/programcfg.s54/programcfg.cmd/programcfg.h/programcfg_c.c (for C5000 example, program is the name of your project) will be generated. These files are allocated in different directories of the project. 3.Source Files Source program, the main code part that implements the specified functions of the DSP system 4.Program.cmd Link file. The OBJ Files (target files) output by the source file through the assembler need to go through the Linker to get the OUT files. In the linking stage, the Linker links rst.lib, csl.lib, DSP/BIOS library and relocates the segments according to the storage area, Section allocation and lib in .cmd 5.The role of Library Filers Rst.lib: C language real-time operation support library, establishes the C operation environment, and is mainly used by _c_int00 to set the stack pointer, initialize global variables, and call main() Csl.lib: chip support library, implements the operation of on-chip peripherals DSPLIB/IMGLIB: signal processing library, uses functions optimized for different DSPs to perform mathematical operations General video/audio LIB: such as 263, 264, jpeg, G.7XX, mp3, wmv. . . Other self-encapsulated LIBs: such as bsl.lib (board source library), operate on the resources on the DSP system board. asm files contain interrupt tables asm files may be used for linear assembly cmd files are resource allocation, you can put the specified code data in the storage area you want to put cmd files are command link files, which specify the allocation of on-chip resources. CMD files must be written by yourself (using a text editor such as WordPad), and this file is very important for DSP programming. Different hardware will have different files. If you use the wrong CMD configuration file, not only will it fail to compile, but it will also fail to download. Other files: .opt project parameter file about the development environment. Such as toolbar position and other information; .aps (AppStudio File), resource auxiliary file, binary format, generally do not care about it. .clw ClassWizard information file, actually the format of INI file, you can study it if you are interested. Sometimes ClassWizard has problems, manually modifying the CLW file can solve it. If this file does not exist, each time you use ClassWizard, it will prompt you whether to rebuild it. .dsp (DeveloperStudio Project): project file, text format, but if you are not familiar with it, do not modify it manually. DSW (DeveloperStudio Workspace) is a workspace file, and its other features are similar to DSP. .plg is a compilation information file, an error and warning information file during compilation (actually an html file), which is generally not very useful. There is an option in Tools->Options to control the generation of this file. .hpj (Help Project) is a project that generates help files, using microsfot Help Compiler can handle it. .mdp (Microsoft DevStudio Project) is an old version of the project file. If you want to open this file, you will be prompted whether to convert it to the new DSP format. .bsc is used to browse project information. If you use Source Brower, you must have this file. If you do not use this function, you can remove Generate Browse Info File in Project Options to speed up the compilation. .map is the image information record file of the executable file. Unless you are very familiar with the underlying system, this file is generally not needed. .pch (Pre-Compiled File) is a pre-compiled file that can speed up the compilation, but the file is very large. .pdb (Program Database) records some data and debugging information related to the program, which may be useful during debugging. .exp is only generated when compiling DLL, and records some information in the DLL file. It is generally useless. .ncb No compile browser file. This file can be deleted when the auto-complete function fails. It will be automatically generated after building. The CMD file must be written by yourself (using a text editor such as WordPad), and this file is very important for DSP programming. The file will be different for different hardware. If the wrong CMD configuration file is used, not only will it fail to compile, but it will also fail to download. Here is a CMD file for your reference. It was written when I was doing my graduation project. MEMORY { PAGE 0: VECS :origin = 0000h , length = 0040h PROG :origin = 00b0h , length = 7F50h PAGE 1: B2: origin = 0060h , length = 0020h B0B1: origin = 0200h , length = 0200h SARAM_IN:origin = 0800h , length = 0800h SARAM_EX:origin = 8000h , length = 8000h } SECTIONS {[/ size] .vectors : { } > VECS PAGE 0 .text : { } > PROG PAGE 0 .cinit : { } > PROG PAGE 0 .switch : { } > PROG PAGE 0 .data : { } > SARAM_IN PAGE 1 .bss : { } > SARAM_IN PAGE 1 .const : { } > SARAM_IN PAGE 1 .stack : { } > SARAM_IN PAGE 1 .sysmem : { } > SARAM_IN PAGE 1 }