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.

TMDSCNCD28379D: Program will not fit into available memory; modifying Linker file

Part Number: TMDSCNCD28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

when trying External mode in MATLAB Simulink for TMDSCNCD28379D for CPU2 (Boot from Flash), I am already running a different application on CPU1 (Boot from Flash), I am getting an error saying "program will not fit into available memory"

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<Linking>
warning: build attribute vendor section TI missing in
"C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages
/tic2000/rtlib/IQmath_fpu32.lib<IQ10div.obj>": compatibility cannot be
determined
warning: build attribute vendor section TI missing in
"C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages
/tic2000/rtlib/IQmath_fpu32.lib<IQmathTables.obj>": compatibility cannot be
determined
"C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/tic2000/src/c28377D.cmd", line 131: error:
program will not fit into available memory. run placement with
alignment/blocking fails for section ".ebss" size 0x8e7 page 1. Available
memory ranges:
RAMLS_DATA size: 0x2000 unused: 0x0 max hole: 0x0
RAMD1 size: 0x800 unused: 0x0 max hole: 0x0
error: errors encountered during linking; "../Inverter_003.out" not built
>> Compilation failure
gmake: *** [../Inverter_003.out] Error 1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The main part says:

RAMLS_DATA size: 0x2000 unused: 0x0 max hole: 0x0
RAMD1 size: 0x800 unused: 0x0 max hole: 0x0

This reply advises going into the Linker file and adding more sections to the heap area.

When I go to the Linker file C:\ProgramData\MATLAB\SupportPackages\R2018a\toolbox\target\supportpackages\tic2000\src\c28377D.cmd

Q1. I do not see .sysmem, only .esysmem. Is this a problem?

.esysmem         : > RAMLS_DATA,    PAGE = 1

Q2. There is only #ifdef CPU1 for CPU1 and not CPU2. Is this a problem?

Q3. I do not see available memory to add as OR ("|") in the linker file, only RAMLS_DATA. Should I modify RAMLS_DATA? Full Linker file is sjown below

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifdef CLA_BLOCK_INCLUDED
// 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_BLOCK_INCLUDED
MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to SARAM" bootloader mode */
BEGIN : origin = 0x000000, length = 0x000002
BEGIN_FLASH : origin = 0x080000, length = 0x000002
#ifdef CPU1
RAMM0 : origin = 0x000122, length = 0x0002DE
#else
RAMM0 : origin = 0x000080, length = 0x000380
#endif
RAMD0 : origin = 0x00B000, length = 0x000800
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I asked a similar question several months ago as I was having the same error ("program will not fit into available memory") and I assumed increasing the heap size from the MATLAB Simulink will solve the problem. It did, temporarily, but now I am still having the same issue.

  • Hi,

    Q1. I do not see .sysmem, only .esysmem. Is this a problem?

    .esysmem         : > RAMLS_DATA,    PAGE = 1

    Looks like you are using COFF format, so .esysmem is equivalent section.

    Q2. There is only #ifdef CPU1 for CPU1 and not CPU2. Is this a problem?

    This should not be any issue.  If not CPU1 block for CPU2.

    I do not see available memory to add as OR ("|") in the linker file, only RAMLS_DATA. Should I modify RAMLS_DATA?

    Do you have CLA_BLOCK_INCLUDED ? If not then you may be able include RAMLS_DATA little bit.

    is this linker file came with Simulink project or you created for your project?

  • Hi Santosh,

    the linker file came with the Simulink Support Package for C2000 installation from the MATLAB website. I do not see F28379D (processor which I am using) so the 'closest' is c28377D.cmd. In the Simulink I have set the linker command file path to that file. Is there a specific linker file for F28379D available to download?

    There is a CLA_BLOCK_INCLUDED, line #136 in my first message showing the full linker file.

    Line #50 and #52 in linker file say

    RAMLS_DATA : origin = 0x009000, length = 0x002000 (#50)

    RAMLS_DATA : origin = 0x008000, length = 0x002000 (#52)

    would a solution be to increase the lenght? Can this be done? To how much?

    For the F28377D (which is similar to the F28379D processor) it says there is "128KB of GSx RAMs (16 blocks of 8KB)". Now sure how to convert length 0x002000 to KB and check if I still have a space left.

    MATLAB Simulink report says

    RAMLS_DATA size: 0x2000 unused: 0x0

    meaning, all 2000 is used.

  • Hi Santosh,

    New update. When I load the application (e.g. Machine Side App) on CPU1 in External mode for testing and parameter tuning and another already tested (e.g. Network Side App) on the CPU2 (not in External mode), I am not getting an error.

    But, I get a different problem. I do not see any change in the application: my ADCs are zero although there is a 1.5 Vdc input (offset for AC signals to accomodate unipolar ADC input) and GPIO toggle signal I have to verify the sample time (10 kHz) is always HIGH.

    I used F28335 before and was able to run a similar code (Network and Machine App on one CPU -- F28335 has only one CPU). F28379D has two CPUs and more memory.

    Would increasing RAM length help and can I add more RAM locations? Am I on the right track?

    When I do OR between all RAMs, I get 0x002200 + 0x000800 + 0x004000 which is 0x007000 bites, compared to 1024 KB of memory F28739D has... am I correctly adding all this?

    .esysmem         : > RAMLS_DATA | RAMD1 | RAMGS_DATA

  • Mike,

    I am not familiar with these App, so we will need help from MathWorks team. I will reach out to MW team to help us here.

  • No, no, Sorry if I added a level of confusion here. They are my bespoke Simulink applications to control network (loaded onto CPU1) and machine (loaded onto CPU2) converter. Each has an ADC section, scaling and filtering, dual-loop control and PWM blocks.

    NWandMCApp.zip

  • I have modified the ADC block slightly and changed the acquisition window and it is ok now. I am slowly re-building the application code bit by bit from scratch, compiling and loading the code as I go, checking for overruns, etc., and so far everything is ok.

    Btw. is there somewhere a Linker file specifically for F28379D with all RAM properly assigned?

  • Mike,

    Sorry for the delay on our side, alot of us were out last week, and I'm following up on Santosh's threads. 

    In terms of a superset .cmd file I'd start here C:\ti\c2000\C2000Ware_4_00_00_00\device_support\f2837xd\common\cmd\2837xD_FLASH_lnk_cpu1.cmd

    Based on the earlier posts, I think the linker error may persist even if you join multiple RAMs with the "|" operator.  This can happen if there is a function that crosses defined boundaries of the defined RAMs, and why the linker will report a size of 0.

    If this is still the case, you will need to manually combine RAMs with longer length(I think you mentioned this earlier).  You could do this to get the contiguous block to be as big as needed for a particular section.

    Let me know if this is on the right track or there's some more digging I need to do.

    Best,

    Matthew