Cl2000.exe is the compiler that is closely related to our program compilation . The method of use is:
cl2000 [ compiler options] [files to be compiled] [--run linker [linker options] target file]]
The usage seems complicated, but fortunately CCS has already called it for us (or CCS is a framework, and almost all of its compilation, debugging, linking and other functions need to call some other exe to execute, so you may have experienced upgrading some library files, editor versions, etc., but the interface files do not need to be changed). These sentences will be displayed in the project properties. Of course, if you want to experience it yourself, you can also find it under toolscompilerc2000_6.1.5bin under the ccs installation directory, that is, cl2000.exe, and then run it from the command line). Here is a simple example:
cl2000 -v28 symtab.c file.c seek.asm --run_linker --library=lnk.cmd
--output_file=myprogram.out
In the above example, if the files that need to be compiled, such as several .c or .asm, are not found, CCS will prompt that xxx.c or xxx.asm is not found or is undefined; or you changed the name of the target file, for example, to a.out, but when loading the program into DSP , it still uses b.out before the change. Naturally, unexpected results may occur: such a situation did occur when I helped netizens solve problems before.
After understanding how to call the compiler , we can go a step further and unveil the mystery of the various options in the compiler. From now on, we no longer need to be afraid of the various warnings and errors prompted by the compiler.
Specifically, the compiler options are divided into 20 categories, with more than 100 specific options. Of course, these options are divided into different levels of importance. Some are necessary, such as supporting FPU and other functions; some are not often used, such as automotive industry software reliability checks such as MISRA, which are only used when standardizing software. So let's first look at the most commonly used options, such as processor options, which are meaningful in defining the CPU mode when compiling the program. One thing to add is that the options seen in the help of cl2000 have very long names. In CCS, for the convenience of writing (because the option box is so small), aliases are generally used instead; if there is no alias, the option name is used directly.
Processor options
Aliases
meaning
--silicon_version=28
-v28
Generate target files for DSPs with C28x architecture ; if not selected, the mode is C27x mode, or C2xLP compatible mode (for example, to make C28 CPU support C24 assembly statements, there are many compatibility issues, because the search mode, CPU architecture, etc. have changed to a certain extent, and some instructions are no longer applicable to new devices). Most netizens will hardly use the latter two modes, so we generally select -v28 in our compiler options . For more detailed information, please refer to the DSP CPU Introduction and Assembly Programming Guide.
--large_memory_model
-ml
Generate code in " large memory mode " . If this option is turned on, the compiler will be forced to treat the entire address space as a complete 22- bit wide space (actually divided into 16- bit low address and high address space beyond 16 -bit width), so that the pointer used for addressing is also 22 bits (this pointer is for CPU addressing, not the pointer used in our C program), so that the search space does not have to be limited to 2 to the 16th power, that is, 64K . This mode is suitable for use in C++ programming, so that the compiled code can access storage units in address spaces with a width of more than 16 bits, so there is no 64K word space limit.
So why is it used in C++ programming? Because the current compiler does not support the C++ keyword far ; if you understand C++ keywords, it is easy to understand this pattern using the same idea.
In addition, when FPU is turned on , large memory mode must be turned on, otherwise the compiler will report an error.
When you create a new C2000 project and need to add related library files, if you see that some libraries are rts2800.lib and some are rts2800_ml.lib , you should know which one to use this time. A small suggestion is to save trouble and maintain compatibility. If you have no other concerns, just turn on this option.
--unified_memory
-mt
Generate code in " unified memory mode " . As the name implies, it defines all storage space as a whole, so that the compiler can use RPT and PREAD instructions to handle most of the memory copy memcpy calls and structure allocations during compilation (it also does not need to "worry" about a sudden break in the storage space and being unable to search continuously). For example, the following assembly instructions can be executed more efficiently:
MOVL XAR7, #Array1 ; XAR7 points to array 1
MOVL XAR2, #Array2 ; XAR2 points to array 2
RPT #(N-1) ; Repeat the next instruction N times
||PREAD *XAR2++,*XAR7 ;Array2[i]=Array1[i],i++
We can write such an assembly code manually; if you have a C code for a for loop , take a look at the assembly code generated by the compiler, are they almost exactly the same?
--cla_support[=cla0]
none
--cla_support is a feature available only in the Piccolo series after the C2833x series . It is called a control law accelerator, which means that some codes closely related to the performance of the control system are put into CLA to run independently without taking up CPU time. In this way, the running speed of the entire control software is greatly improved, thus ensuring real-time performance.
--float_support={fpu32|softlib|fpu64}
none
It can only be used when -v28 and -ml are enabled ; it means enabling software processing (such as calling some optimized library functions) and 32- bit or 64 -bit FPU coprocessors for floating-point operations, thereby supporting related assembly instructions.
This sub-option cannot be used at the same time, that is, the usage is:
--float_support=fpu32
Or --float_support=fpu64 etc.
It should be added that the 64 -bit floating-point operation here refers to the data type of long double . In fact, the FPU in DSPs such as 28335 currently only supports 32 -bit FPU operations in hardware . 64- bit floating-point operations must be converted by the CPU and then sent to the FPU for processing. Therefore, if it is not necessary, try not to use operations such as FPU64 .
--vcu_support[=vcu0]
none
VCU is a function available on high-end chips such as F2837xD . It refers to Viterbi and complex unit (VCU II) accelerators , which means that motor failures can be better predicted by performing vibration analysis using viterbi complex unit (VCU II) accelerators. The source of the vibration signal is an acceleration sensor or vibration sensor, etc., and popular MEMS can be used , which can be attached to the motor housing, encoder, etc. If you need to use this function, you need to turn it on in the compiler options.
Previous article:DSP Programming Skills 1: Let’s talk about the compilation process
Next article:DSP Programming Skills 3: Unveiling the Mystery of Compilers - Program Optimization
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- If there is a bug in the third-party code, how can everyone adapt it to the original version after it is fixed?
- Share a general good book Digital Signal Processing C Language Program Collection-DSP Algorithm Encyclopedia C Language Version Original Book
- This article explains what parameters and indicators should be measured when designing a switching power supply.
- ATMEL SAM3N2C chip timing is inaccurate
- TMS320C6000 Image Library (IMGLIB)
- I'm just learning about MEMS. Does anyone know what the problem is with the unicleo GUI not being able to recognize the MEMS expansion board?
- MSP430 system clock ACLK, MCLK, SMCLK
- Controlled by "Playpad" + Siri + shortcut commands + XCC3200 (MQTT)
- msp430f5529 dual output pwm wave
- Why should a DC-DC converter be used as close to the point-of-load (POL) power supply as possible?