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.
How to integrate .asm files in the SDK examples?
How to integrate .s and .asm files in MCAL examples when imported to CCS?
How to resolve illegal instruction errors in CCS assembly files?
This FAQ talks about how to compile different assembly file extensions in single project. Compiler errors like "illegal mnemonic specified" and "illegal instruction" are generated even when you give the right assembly syntax. This is because of missing compiler flags in the project. The steps to add these flags is also discussed in this FAQ.
MCU_PLUS_SDK uses .S file extension for Assembly files, where as MCAL uses .asm file extensions for Assembly files.
The following is the difference between these extensions:
.s |
|
.S |
|
.asm |
|
The compile, assemble, and link part of the development flow will look something like this:
Compile .asm files through MCU_PLUS_SDK libraries in CCS:
This should compile the code without errors for the SDK based project.
Compile .s and .S files through MCAL libraries in CCS:
This should compile the code without errors for the MCAL based project.
Compile the assembly files through command line:
While using command line to compile and link files through tiarmclang, the source files/assembly files (.c, .cpp, .s, .S, .asm) are specified. Then the object files in which they will be converted into are specified. Compiler options/flags and Linker options are given in the same command line to link these specified files.
Example of the Syntax is shown below:
While declaring the .asm files in this command, "-x ti-asm" is placed right before the file, and "-x none" flag is placed after all the .asm files. Example Syntax for the compile side is shown below:
Here, the “-x ti-asm” option indicates that the ti-asm-source1.asm file is to be processed by the TI-syntax ARM assembler, and the subsequent “-x none” option resets the input file type to a default state so that the tiarmclang compiler knows to process the c-source2.c input file as a C file.
For more information on other compiler options for Assembly files, refer to section 2.4.3 Invoking the TI-Syntax ARM Assembler from tiarmclang in TI_Arm_Clang_Compiler_Tools_User_Guide.