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.

RTOS/TDA2EVM5777: Cannot increase heap size much as - "program will not fit into available memory"

Part Number: TDA2EVM5777
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello,

I am using TDA2xx based VAYU vision application board and trying to increase heap size as my application is demanding more heap:

(ti.sysbios.heaps.HeapMem: line 221: ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x86b884f0, size=7642640)

As you can see for creation of one instance of a class its asking around 7 MB of RAM.

To fix I am trying to increase heap by changing default max heap in <vision_sdk_path>/links_fw/src/rtos/bios_app_common/tda2xx/ipu1_0/Ipu1_0.cfg

/* create a default heap */
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x300000;

But I cannot go beyond 2 MB. I get error - 

"F:/obj/vision_sdk/tda2xx-evm/ipu1_0/debug/vision_sdk_configuro/linker_mod.cmd", line 295: error:
program will not fit into available memory. run placement with alignment
fails for section ".bss:taskStackSection" size 0x224000 . Available memory
ranges:
IPU1_0_DATA_MEM size: 0xb00000 unused: 0x1901a8 max hole: 0x190194
error: errors encountered during linking;


I read about moving sections in linker_mod.cmd to utilize available memory but couldn't understand how to do it.

I am using vision sdk  3.1 and using only ipu1_0 for my application.

So I have multiple problems here:

It looks like I cannot increase heap because other sections like code memory is taking more memory. I removed all printf from all files as suggested in one of the forum but that didn't help much.

I guess all unused functions are automatically removed though sources are passed to compilation unit, and optimization flag set to O3.

My final debug binary size is also more around 480 MB and I get warning: 

warning: relocation to symbol "__TI_exidx_linkto_scn_start_14216" overflowed;
the 33-bit relocated address 0x7946c194 is too large to encode in the 31-bit
signed PC-Relative field (type = 'R_ARM_PREL31' (42), file = "<internal>",
offset = 0x00000000, section =
".ARM.exidx.ducatiBoot:sysbios.aem4<ducati_Core_asm.obj>")
warning: output file
"F:/vision_sdk/bin/tda2xx-evm/vision_sdk_ipu1_0_debug.xem4" cannot be loaded
and run on a target system

Any pointers on reducing code size and allocating more heap memory? How much maximum heap can be allocated?

Please check attached map file, linker_mod.cmd and cfg file.

3487.attachment.zip

Thanks,

Shailesh

 

  • Additional query:

    Why other cores code and data sections appearing in linker_mod.cmd when my application is not using other cores?

    My application vision sdk config file has below configuration:

    PROC_IPU1_0_INCLUDE=yes
    PROC_IPU1_1_INCLUDE=no
    PROC_IPU2_INCLUDE=no
    PROC_A15_0_INCLUDE=no
    PROC_DSP1_INCLUDE=no
    PROC_DSP2_INCLUDE=no
    PROC_EVE1_INCLUDE=no
    PROC_EVE2_INCLUDE=no
    PROC_EVE3_INCLUDE=no
    PROC_EVE4_INCLUDE=no

    Thanks,

    Shailesh

  • Hi Shailesh,

    can you try to modify vision_sdk/apps/build/tda2xx/mem_segment_definition_bios.xs for your memory allocation requirements.
    Please check also vision_sdk/docs/FeatureSpecificUserGuides/VisionSDK_UserGuide_MemoryMap.pdf for more details.

    Regards,
    Yordan