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.

TMS320F280039C: CLA program does not fit into RAM

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Tool/software:

Hi,

I'm using the CLA to read out two SPI encoders and so far that works fine. Not that I had to include some calibration routines, the code grew more and more and I'm now in the situation to use 4 RAM LS banks in total (3 for the program, 1 for the data), but this seems not to work out, I always get the following compiler error: 

 "program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. load placement with alignment/blocking fails for section "Cla1Prog" size 0x10dc page 0.  Available memory ranges"

Now I don't understand the issue, since I could successfully merge RAMLS1 and RAMLS2 to a bigger bank, but it seems I cannot merge LS1-LS3 to a bank without this issue.

f28003x_flash_lib_is:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
RAMLS012 : origin = 0x008000, length = 0x001800
RAMLS3 : origin = 0x009800, length = 0x000800
RAMLSnP : origin = 0x00A000, length = 0x002000
RAMGSnP : origin = 0x00C000, length = 0x001000
RAMGSC : origin = 0x00D000, length = 0x001000
RAMGSF : origin = 0x00E000, length = 0x001000
RAMGSD : origin = 0x00F000, length = 0x000FF8
...
// CLA Sections
#if defined(__TI_EABI__)
/* CLA specific sections */
Cla1Prog : LOAD = FLASHBANK1_CLA,
RUN = RAMLS012,
LOAD_START(Cla1ProgLoadStart),
RUN_START(Cla1ProgRunStart),
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Init for the CLA:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void MEMCFG_init()
{
//
// Initialize RAMs
//
MemCfg_initSections(MEMCFG_SECT_MSGCPUTOCLA1);
MemCfg_initSections(MEMCFG_SECT_MSGCLA1TOCPU);
while(!MemCfg_getInitStatus(MEMCFG_SECT_MSGCPUTOCLA1));
while(!MemCfg_getInitStatus(MEMCFG_SECT_MSGCLA1TOCPU));
//
// Configure LSRAMs
//
MemCfg_setLSRAMControllerSel(MEMCFG_SECT_LS0, MEMCFG_LSRAMCONTROLLER_CPU_CLA1); //LS0 - LS2 needs to be for CLA --> Change in flash.cmd file
MemCfg_setCLAMemType(MEMCFG_SECT_LS0, MEMCFG_CLA_MEM_PROGRAM);
MemCfg_setLSRAMControllerSel(MEMCFG_SECT_LS1, MEMCFG_LSRAMCONTROLLER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS1, MEMCFG_CLA_MEM_PROGRAM);
MemCfg_setLSRAMControllerSel(MEMCFG_SECT_LS2, MEMCFG_LSRAMCONTROLLER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS2, MEMCFG_CLA_MEM_PROGRAM);
MemCfg_setLSRAMControllerSel(MEMCFG_SECT_LS3, MEMCFG_LSRAMCONTROLLER_CPU_CLA1);
MemCfg_setCLAMemType(MEMCFG_SECT_LS3, MEMCFG_CLA_MEM_DATA);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Any Idea why this does not work? I also activated the compiler option "--gen_func_subsections = on", but without success.

Edit: I found a work around, but I'm not sure what the tradeoff is. When I'm using the following it works:

Works out:

Fullscreen
1
2
Cla1Prog : >> RAMLS012
.const_cla : > RAMLS3
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Does not work:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// CLA specific sections
Cla1Prog : LOAD = FLASHBANK1_CLA,
RUN = RAMLS012,
LOAD_START(_Cla1ProgLoadStart),
RUN_START(_Cla1ProgRunStart),
LOAD_SIZE(_Cla1ProgLoadSize),
ALIGN(8)
.const_cla : LOAD = FLASHBANK1_CLA,
RUN = RAMLS3,
RUN_START(_Cla1ConstRunStart),
LOAD_START(_Cla1ConstLoadStart),
LOAD_SIZE(_Cla1ConstLoadSize),
ALIGN(8)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So, what is the trade off when not using the lfash bank loader? Will this lead to problems somehow?

  • Hi Hans,

    I have a couple clarifying questions:

    1. Are you using a linker cmd file from C2000ware as a starting point? If so, which one and what were the edits did you made to it?
    2. Are you running a flash or RAM build of your program?
    3. If using a flash build, are you making sure to copy your CLA program into LSRAM in your c28x code like below:
    4. Are you using Sysconfig to generate your CLA initialization code and/or linker cmd file?

    Best Regards,

    Delaney

  • Hi Delaney,

    Thanks for your reponse. I could solve the issue now. The problem was, that the FLASHBANK1_CLA section was not big enough.

    Thanks,

    Hans

  • Hi Hans,

    Glad to hear you were able to resolve the issue. I will close this thread then, but feel free to create another one if you have any more questions.

    Best Regards,

    Delaney