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.
Tool/software: Code Composer Studio
Hi there.
I just opened a similar post [I have some behavioral issue while I'm executing CLA C-code] but I belive that for some strange reason my CLA C-code, translated in assembly, doesn't decode relative opcode. The reason for this my affirmation is the strange behavioral of CLA assembly step execution on my simply code when only Task1 is setting to run: I set Cla1Regs.MIER.all = 0x0001 and I have got only one Cla1ForceTask1andWait() function in my test. Despite of configurations, assembly stepping code overruns last MSTOP istruction owned by Cla1Task1() function and MCP cross over Cla1Task2().
Please, is there someone that explain me this weird CLA behavioral. I don't know how I can use that auxiliar CPU and how I can debug this situation. Is there a way to check the pipeline decode [D2] step ? From debug register window I don't be able to change MRx CLA registers: is that normal ?
Thank's a lot for your help.
Hi,
Is your code section "Cla1Prog" in a RAMLSx section that is configured for CLA ownership
MemCfgRegs.LSxMSEL.bit.MSEL_LS? = 1; MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS? = 1;
If portions of your CLA code are in RAM sections that the CLA does not own you will see weird behavior (overrunning the MSTOP is one such example) when single stepping through CLA code.
Diego Bellachioma said:So, How Can I assign RAMLS4_LS5 for Cla1Prog? Why doesn't it works in LS4?
You can assign CLa1Prog to RAMLS4_5, but the portion that allocated LS4 to the CLA is commented out in your code
Diego Bellachioma said:// MemCfgRegs.LSxMSEL.bit.MSEL_LS4 = 1;
MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1;
// MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS4 = 1;
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1;
Uncomment the two lines pertaining to LS4 and it will work.
Diego Bellachioma said:RAMLS4_LS5 : origin = 0x00A000, length = 0x001000
When its defined like this you are actually combining physical RAML4 and RAML5 into one logical RAM block and assigning Cla1Prog to it. However, they are still two separate physical blocks and therefore have to both be configured for CLA ownership. In your setup code you need the following lines
// Cla1Prog placed in LS4 and LS5 MemCfgRegs.LSxMSEL.bit.MSEL_LS4 = 1; MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS4 = 1; MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1; MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1;
Diego Bellachioma said:.text : >> RAMD0|RAMD1|RAMLS4_LS5, PAGE = 0
Cla1Prog and .text cannot be assigned to the same blocks (RAMLS4_LS5), they cannot share the same space. The RAM ownership is configured for either CLA or C28x. If Cla1Prog is assigned to RAMLS4_LS5 then .text must be assigned to some other RAMs
Diego Bellachioma said:why TI 2837xD_RAM_CLA_lnk_cpu1.cmd file is configured in this way:
...
/*RAMLS4 : origin = 0x00A000, length = 0x000800*/
/*RAMLS5 : origin = 0x00A800, length = 0x000800*/
RAMLS4_LS5 : origin = 0x00A000, length = 0x001000
...
.text : >> RAMD0|RAMD1|RAMLS4_LS5, PAGE = 0
...
/* CLA specific sections */
Cla1Prog : > RAMLS4_LS5, PAGE=0
Yeah that is definitely a bug. Ill file a ticket to fix that, .text should not be assigned to LS4_LS5
Diego Bellachioma said:text : >> RAMD0|RAMD1| ?, PAGE = 0 [es. RAMGS0, ecc. since is a following memory block. I just tried and it doesn't work ]
You should be able to assign .text to RAMD0, RAMD1 and RAMGS0 (or any GS RAM on page 0) assuming they are on page 0.
.text :>> RAMD0 | RAMD1 | RAMGS0, PAGE = 0
The .text section will be split in 3, .text.1, .text.2 and .text.3
Diego Bellachioma said:I know that I take advantage from you, but I wish ask you a right linker cmd configuration that extend program space for main code CPU and settings CLA for a good functionally.
You can use this one from C:\ti\c2000\C2000Ware_0_04_00_00\device_support\f2837xd\common\cmd. The CLA program is assigned to RAMLS5, and LS0 and LS1 are CLA data spaces
// The user must define CLA_C in the project linker settings if using the // CLA C compiler // Project Properties -> C2000 Linker -> Advanced Options -> Command File // Preprocessing -> --define #ifdef CLA_C // Define a size for the CLA scratchpad area that will be used // by the CLA compiler for local symbols and temps // Also force references to the special symbols that mark the // scratchpad are. CLA_SCRATCHPAD_SIZE = 0x100; --undef_sym=__cla_scratchpad_end --undef_sym=__cla_scratchpad_start #endif //CLA_C MEMORY { PAGE 0 : /* BEGIN is used for the "boot to SARAM" bootloader mode */ BEGIN : origin = 0x000000, length = 0x000002 RAMM0 : origin = 0x000122, length = 0x0002DE RAMD0 : origin = 0x00B000, length = 0x000800 RAMD1 : origin = 0x00B800, length = 0x000800 RAMLS4 : origin = 0x00A000, length = 0x000800 RAMLS5 : origin = 0x00A800, length = 0x000800 RESET : origin = 0x3FFFC0, length = 0x000002 PAGE 1 : BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */ RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */ RAMLS0 : origin = 0x008000, length = 0x000800 RAMLS1 : origin = 0x008800, length = 0x000800 RAMLS2 : origin = 0x009000, length = 0x000800 RAMLS3 : origin = 0x009800, length = 0x000800 RAMGS0 : origin = 0x00C000, length = 0x001000 RAMGS1 : origin = 0x00D000, length = 0x001000 RAMGS2 : origin = 0x00E000, length = 0x001000 RAMGS3 : origin = 0x00F000, length = 0x001000 RAMGS4 : origin = 0x010000, length = 0x001000 RAMGS5 : origin = 0x011000, length = 0x001000 RAMGS6 : origin = 0x012000, length = 0x001000 RAMGS7 : origin = 0x013000, length = 0x001000 RAMGS8 : origin = 0x014000, length = 0x001000 RAMGS9 : origin = 0x015000, length = 0x001000 RAMGS10 : origin = 0x016000, length = 0x001000 RAMGS11 : origin = 0x017000, length = 0x001000 RAMGS12 : origin = 0x018000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ RAMGS13 : origin = 0x019000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ RAMGS14 : origin = 0x01A000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ RAMGS15 : origin = 0x01B000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */ CANA_MSG_RAM : origin = 0x049000, length = 0x000800 CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 CLA1_MSGRAMLOW : origin = 0x001480, length = 0x000080 CLA1_MSGRAMHIGH : origin = 0x001500, length = 0x000080 } SECTIONS { codestart : > BEGIN, PAGE = 0 ramfuncs : > RAMM0 PAGE = 0 .text : >> RAMD0|RAMD1|RAMLS4, PAGE = 0 .cinit : > RAMM0, PAGE = 0 .pinit : > RAMM0, PAGE = 0 .switch : > RAMM0, PAGE = 0 .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */ .stack : > RAMM1, PAGE = 1 .ebss : > RAMLS2, PAGE = 1 .econst : > RAMLS3, PAGE = 1 .esysmem : > RAMLS3, PAGE = 1 Filter_RegsFile : > RAMGS0, PAGE = 1 /* CLA specific sections */ Cla1Prog : > RAMLS5, PAGE=0 CLADataLS0 : > RAMLS0, PAGE=1 CLADataLS1 : > RAMLS1, PAGE=1 Cla1ToCpuMsgRAM : > CLA1_MSGRAMLOW, PAGE = 1 CpuToCla1MsgRAM : > CLA1_MSGRAMHIGH, PAGE = 1 /* The following section definition are for SDFM examples */ Filter1_RegsFile : > RAMGS1, PAGE = 1, fill=0x1111 Filter2_RegsFile : > RAMGS2, PAGE = 1, fill=0x2222 Filter3_RegsFile : > RAMGS3, PAGE = 1, fill=0x3333 Filter4_RegsFile : > RAMGS4, PAGE = 1, fill=0x4444 #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 .TI.ramfunc : {} > RAMM0, PAGE = 0 #endif #endif #ifdef CLA_C /* CLA C compiler sections */ // // Must be allocated to memory the CLA has write access to // CLAscratch : { *.obj(CLAscratch) . += CLA_SCRATCHPAD_SIZE; *.obj(CLAscratch_end) } > RAMLS1, PAGE = 1 .scratchpad : > RAMLS1, PAGE = 1 .bss_cla : > RAMLS1, PAGE = 1 .const_cla : > RAMLS1, PAGE = 1 #endif //CLA_C } /* //=========================================================================== // End of file. //=========================================================================== */
Diego Bellachioma said:Since, it is my first time that I use this Forum, can you tell me how must conclude this thread ?
Maybe I must press green Verify Answer button ?
Yes, Verify will close out this post.
Im glad you got it working.