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 Guys,
CCS v 6.2(compiler version = TI v15.12.3.LTS)
TMX320F28075 Control Card
control Suite v 3.4.1
I am trying to use the CLAsin function inside CLa Task 1. I am using CLAMATH LIB v4_01_00 and I have read the user's guide. I have applied the following settings:
1] Linked Resources -> added a variable "CLAMATH_ROOT" and pointed it to the version folder of CLA Math library in controlSUITE
2] c2000 Compiler -> Include Options -> in the "--include_path, -l" box added "${CLAMATH_ROOT}/include"
3] c2000 Linker -> File Search Path -> in the "--search_path, -i" box added "${CLAMATH_ROOT}/lib"#
4] c2000 Linker -> File Search Path -> in the "--library, -l" box added cla1_math_library_fpu32.lib
My Cla Task Code is:
extern float fAngle; extern float fResult; __interrupt void Cla1Task1 ( void ) { #if (CLA_DEBUG==1) __mdebugstop(); #endif
fResult = CLAsin(fAngle); }
In the main file :
#pragma DATA_SECTION(fAngle,"CpuToCla1MsgRAM") float fAngle; #pragma DATA_SECTION(fResult,"Cla1ToCpuMsgRAM") float fResult;
When I build, I get the following warning:
<Linking>
warning #10247-D: creating output section "CLA1mathTables" without a SECTIONS specification
And after running the project, when I set the value of fAngle = 1.571 (90 degree), the fResult = 0 instead of 1.
Please let me know what am I doing wrong?
Hi Prakash,
The reason for the warning is that the linker command file has, by default, CLA_MATH_TABLES_IN_ROM set to 1; this causes the section placement for CLA1mathTables to be hidden. You have two choices
Also, i want you to be aware there is a bug in this library - there is a workaround described here: e2e.ti.com/.../1927051
I plan to fix this issue in the next release, which i hope to get out before the end of next month.
Hi Vishal,
1) Can you tell me how to set that to 0.
2) I am using F28075. In the User guide it is mentioned to add Symbols library only for F2805x and F2837x devices.
I read the other post. I am using the latest version of controlSUITE and all asm files are up to date.
LInes from atan.asm
.def _CLAatan .sect "Cla1Prog:_CLAatan" .align 2 __CLAatan_sp .usect ".scratchpad:Cla1Prog:_CLAatan",4,0,1 _CLAatan: .asmfunc .asg __CLAatan_sp + 0, _atan_tmp .asg __CLAatan_sp + 2, _save_MR3 ; Context Save MMOV32 @_save_MR3, MR3 ; MR0 = X(fVal) is stored in the scratchpad memory MMOV32 @_atan_tmp, MR0
Lines from sin.asm
.def _CLAsin .sect "Cla1Prog:_CLAsin" .align 2 __CLAsin_sp .usect ".scratchpad:Cla1Prog:_CLAsin",2,0,1 _CLAsin: .asmfunc .asg __CLAsin_sp + 0, _save_MR3 ; Context Save MMOV32 @_save_MR3, MR3 ; MR0 = rad(fAngleRad)
Hi Vishal,
I added the symbols library of F2837x and now it works. So now should I include cla0_math_library_datarom_fpu32.lib or cla0_math_library_fpu32.lib ??
And if I don't need the look up tables, how to set CLA_MATH_TABLES_IN_ROM to 0 ??
It will be helpful if you can mention in the user guide that the symbols library should also be included for F28075 and other corresponding devices.
Thank You.
If you open the linker command file, "C:\ti\controlSUITE\libs\math\CLAmath\v4_00_01_00\cmd\F2837xD_CLA_C_lnk.cmd" i assume you are using this one in your project?
At the top you will see the variable, set it to 0 and rebuild your code.
// Set this variable to 1 to use the CLA Math Tables in the CLA Data ROM // If set to 0, make sure the right CLA Math library is used in the project --define=CLA_MATH_TABLES_IN_ROM=0
Once you do this the math tables will be loaded to RAMLS4_5 (if you have defined RAM) or FLASHB (if you have defined FLASH)
#if !(CLA_MATH_TABLES_IN_ROM) CLA1mathTables : > RAMLS4_5, PAGE = 1 #endif //CLA_MATH_TABLES_IN_ROM
You can check the .map file to see if this section is being loaded to either RAM or FLASH
Not necessarily. If you are using 2807x_FLASH_CLA_lnk_cpu1.cmd then you dont have to worry about the variable CLA_MATH_TABLES_IN_ROM. What i described only applies to the linker command file that comes with the CLAMath library.
It looks like 2807x_FLASH_CLA_lnk_cpu1 does not have a sections placement for CLA1mathTables, so again you have two choices,
1. if you want to load the tables into FLASH and then copy to RAM you can copy the definition from the cmd file in the CLA math library
CLA1mathTables : LOAD = FLASHB, RUN = RAMLS4_5, RUN_START(_CLA1mathTablesRunStart), LOAD_START(_CLA1mathTablesLoadStart), LOAD_SIZE(_CLA1mathTablesLoadSize), PAGE = 1
dont forget to memcpy this section from FLASH to one of the RAMLSx
2. if you want to use the tables in ROM, and i think they are in the 2807x ROM, you would typically load the symbols.lib for this device and then use the "datarom" variant of the CLA math library. Since the symbols.lib file for the 2807x is not included you can alternatively define the CLA1mathTables section in the linker command file as follows:
CLA1mathTables :> 0x01001870, PAGE=0, TYPE = NOLOAD
I got that address from the 2807x TRM (SPRUHM9) section 3.22.1.2; what this does is tells the linker that the math tables are located at this address in ROM, and its a NOLOAD section i.e. don't do anything at load time. You can use the "datarom" variant of the CLA math library.
I will put in a ticket to either include the symbols table library for the 2807x or alternatively document what i have described in this post
OK. But then do those functions work without having a sections placement for CLA1mathTables in the cmd file?
I have not done any modifications (the two choices you mentioned earlier) to the cmd file. But still CLAsin function works.
Please let me know how it works. I have attached the cmd file.
Prakash Kumar Thulasi Kumar said:OK. But then do those functions work without having a sections placement for CLA1mathTables in the cmd file?
Hmm, well if you dont place CLA1mathTables in a memory block in the linker command file the linker will issue a warning saying it will place the section wherever space is available - that is the first thing to check - it is probable that the linker placed it in one of the available RAMLSx memories, and you may have also coincidentally allocated that RAMLSx block over to the CLA as data space, which is why the function works.
I would caution against relying on the linker to autoplace CLA sections for you and, instead explicitly place the section in an LSx memory that you intend to be CLA data space.
Prakash,
Small error in my earlier post. The CLA data rom is dual mapped, the address i put up is the c28x side address - you actually have to use the CLA mapping of the space when you define the section in the linker command file, i.e. instead of this
CLA1mathTables :> 0x01001870, PAGE=0, TYPE = NOLOAD
use this
CLA1mathTables :> 0x000F870, PAGE=1, TYPE = DSECT