Other Parts Discussed in Thread: SYSBIOS
After modifying the Object Detection DSP Unit Test's dss.cfg according to https://e2e.ti.com/support/processors-group/processors/f/processors-forum/334867/redefining-malloc-in-rtsc-application I get the following error:
[C674X_0] ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x81a700, size=216
The obvious thing to do is to increase the heap size:
/* Default Heap Creation: Local L2 memory */ var heapMemParams = new HeapMem.Params(); heapMemParams.size = 52*1024; //this doesnt seem to do anything for the error heapMemParams.sectionName = "systemHeap"; Program.global.heap0 = HeapMem.create(heapMemParams); Memory.defaultHeapInstance = Program.global.heap0; /* System stack size (used by ISRs and Swis) */ Program.stack = 0x800; Program.heap = 0x2000; //this causes spinning in memory.c
Unfortunately, heapMemParams.size = 52*1024 doesn't seem to do anything for this error. I still get it, the handle address just changes. But Program.heap = 0x2000; seems to get rid of the error BUT causes it spins in memory.c
In particular, in: /*-----------------------------------------------------------------------*/
/* Scan through free list for packet large enough to contain packet */
/*-----------------------------------------------------------------------*/
while (current && current->packet_size < newsize)
current = current->size_ptr;
The packet_size never seems to increase and it loops here forever.
This problem occurs at the SOC_Init stage. So I can't even get to the main task because it goes SOC_Init -> Memory.c -> Crash or Loop Forever...
Any ideas regarding how to fix this?
Here is my projectspec file:
<?xml version="1.0" encoding="UTF-8"?> <projectSpec> <project name="dss-objdetdsp" deviceFamily="C674x" isTargetManual="false" device="IWR6843" endianness="little" cgtVersion="8.3.3" connection="common/targetdb/connections/TIXDS2XXUSB_Connection.xml" toolChain="TI" linkerCommandFile="xwr68xx_dss_objectdetection_test_linker.cmd" description="ObjDetDSP - DSS" launchWizard="false" configurations="Debug" compilerBuildOptions=" -c -O0 -eo=.oe674 -mv6740 --abi=eabi --reread_libs -g --define=SUBSYS_DSS --define=SOC_XWR68XX --define=NO_ANTENNA_CORRECTION --display_error_number --diag_warning=225 --diag_wrap=off -z --warn_sections --ram_model --diag_error=10015 --disable_push_pop --define=MMWAVE_L3RAM_NUM_BANK=6 --define=MMWAVE_SHMEM_BANK_SIZE=0x20000 -DAPP_RESOURCE_FILE='<'ti/datapath/dpc/objectdetection/objdetdsp/test/mmw_res.h'>' -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/mmwave_sdk_03_06_00_00-LTS/packages -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/xdctools_3_62_01_16_core/packages -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/bios_6_73_01_01/packages -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/dsplib_c64Px_3_4_0_0/packages -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/mathlib_c674x_3_1_2_1/packages " linkerBuildOptions=" -mv6740 --abi=eabi --reread_libs -g --display_error_number --diag_warning=225 --diag_wrap=off -z --warn_sections --ram_model --disable_push_pop --define=MMWAVE_L3RAM_NUM_BANK=6 --define=MMWAVE_SHMEM_BANK_SIZE=0x20000 -i${MMWAVE_SDK_INSTALL_PATH}/ti/drivers/osal/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/drivers/soc/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/drivers/edma/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/utils/testlogger/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/datapath/dpedma/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/alg/mmwavelib/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/drivers/mailbox/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/control/dpm/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/utils/mathutils/lib -I${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/datapath/dpu/rangeproc/lib -i${MMWAVE_SDK_INSTALL_PATH}/ti/datapath/dpc/dpu/dopplerproc/lib -I${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/datapath/dpc/dpu/aoaproc/lib -I${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/datapath/dpc/dpu/cfarcaproc/lib -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/dsplib_c64Px_3_4_0_0/packages/ti/dsplib/lib -i${MMWAVE_SDK_TOOLS_INSTALL_PATH}/mathlib_c674x_3_1_2_1/packages/ti/mathlib/lib -llibosal_xwr68xx.ae674 -llibsoc_xwr68xx.ae674 -llibedma_xwr68xx.ae674 -llibtestlogger_xwr68xx.ae674 -llibmailbox_xwr68xx.ae674 -llibmmwavealg_xwr68xx.ae674 -llibdpm_xwr68xx.ae674 -llibmathutils.ae674 -llibrangeproc_dsp_xwr68xx.ae674 -llibdopplerproc_dsp_xwr68xx.ae674 -llibaoaproc_dsp_xwr68xx.ae674 -llibcfarcaproc_dsp_xwr68xx.ae674 -llibdpedma_hwa_xwr68xx.ae674 -llibmmwavealg_xwr68xx.ae674 -lrts6740_elf.lib -ldsplib.ae64P -lmathlib.ae674 --map_file=${MMWAVE_SDK_INSTALL_PATH}/ti/datapath/dpc/objectdetection/objdetdsp/test/xwr68xx_objectdetection_test_dss.map "> <!-- Project properties --> <property name="type" value="rtsc"/> <property name="products" value="com.ti.rtsc.SYSBIOS:6.73.01.01;com.ti.MMWAVE_SDK:03.06.00.00-LTS;"/> <property name="xdcToolsVersion" value="3.62.01.16_core"/> <property name="target" value="ti.targets.elf.C674"/> <property name="platform" value="ti.platforms.c6x:IWR68XX:false:600"/> <property name="endianness" value="little"/> <property name="output_format" value="elf"/> <property name="buildProfile" value="debug"/> <property name="configuroOptions" value="--compileOptions "--enum_type=int " "/> <!-- Project files --> <file path="${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/datapath/dpc/objectdetection/common/gen_frame_data.c" openOnCreation="false" excludeFromBuild="false" action="link"/> <file path="${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/board/antenna_geometry.c" openOnCreation="false" excludeFromBuild="false" action="link"/> <file path="${PARENT-1-WORKSPACE_LOC}/sdk/ti/datapath/dpc/objectdetection/objdetdsp/src/objectdetection.c" openOnCreation="false" excludeFromBuild="false" action="link"/> <file path="${PARENT-1-WORKSPACE_LOC}/sdk/ti/datapath/dpc/objectdetection/objdetdsp/test/main.c" openOnCreation="false" excludeFromBuild="false" action="link"/> <file path="${PARENT-1-WORKSPACE_LOC}/sdk/ti/datapath/dpc/objectdetection/objdetdsp/test/dss.cfg" openOnCreation="false" excludeFromBuild="false" action="link"/> <file path="${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/platform/xwr68xx/c674x_linker.cmd" openOnCreation="false" excludeFromBuild="false" action="copy"/> <file path="${COM_TI_MMWAVE_SDK_INSTALL_DIR}/packages/ti/datapath/dpc/objectdetection/objdetdsp/test/xwr68xx_dss_objectdetection_test_linker.cmd" openOnCreation="false" excludeFromBuild="false" action="link"/> </project> </projectSpec>
/* * Copyright 2011 by Texas Instruments Incorporated. * * All rights reserved. Property of Texas Instruments Incorporated. * Restricted rights to use, duplicate or disclose this code are * granted through contract. * */ environment['xdc.cfg.check.fatal'] = 'false'; /******************************************************************** ************************** BIOS Modules **************************** ********************************************************************/ var Defaults = xdc.useModule('xdc.runtime.Defaults'); var Diags = xdc.useModule('xdc.runtime.Diags'); var Error = xdc.useModule('xdc.runtime.Error'); var Log = xdc.useModule('xdc.runtime.Log'); var Main = xdc.useModule('xdc.runtime.Main'); var System = xdc.useModule('xdc.runtime.System'); var Text = xdc.useModule('xdc.runtime.Text'); var Memory = xdc.useModule('xdc.runtime.Memory'); var SysStd = xdc.useModule('xdc.runtime.SysStd'); var BIOS = xdc.useModule('ti.sysbios.BIOS'); var MemAlloc = xdc.useModule('ti.sysbios.rts.MemAlloc'); MemAlloc.generateFunctions = false; var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf'); var Task = xdc.useModule('ti.sysbios.knl.Task'); var Idle = xdc.useModule('ti.sysbios.knl.Idle'); var SEM = xdc.useModule('ti.sysbios.knl.Semaphore'); var Event = xdc.useModule('ti.sysbios.knl.Event'); var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi'); var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner'); var Load = xdc.useModule('ti.sysbios.utils.Load'); /* Default Heap Creation: Local L2 memory */ var heapMemParams = new HeapMem.Params(); heapMemParams.size = 52*1024; heapMemParams.sectionName = "systemHeap"; Program.global.heap0 = HeapMem.create(heapMemParams); Memory.defaultHeapInstance = Program.global.heap0; /* * Enable Event Groups here and registering of ISR for specific GEM INTC is done * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs */ EventCombiner.eventGroupHwiNum[0] = 7; EventCombiner.eventGroupHwiNum[1] = 8; EventCombiner.eventGroupHwiNum[2] = 9; EventCombiner.eventGroupHwiNum[3] = 10; /* * turn the if to zero if you dont want any messages on CCS console say because of * slow printing. They can be viewed in CCS ROV viewer in SysMin module */ if (1) System.SupportProxy = SysStd; else { var SysMin = xdc.useModule('xdc.runtime.SysMin'); SysMin.bufSize = 4096; System.SupportProxy = SysMin; } /* Enable BIOS Task Scheduler */ BIOS.taskEnabled = true; /* System stack size (used by ISRs and Swis) */ Program.stack = 0x800; Program.heap = 0x2000; Task.idleTaskStackSize = 0x400; /* * Build a custom BIOS library. The custom library will be smaller than the * pre-built "instrumented" (default) and "non-instrumented" libraries. * * The BIOS.logsEnabled parameter specifies whether the Logging is enabled * within BIOS for this custom build. These logs are used by the RTA and * UIA analysis tools. * * The BIOS.assertsEnabled parameter specifies whether BIOS code will * include Assert() checks. Setting this parameter to 'false' will generate * smaller and faster code, but having asserts enabled is recommended for * early development as the Assert() checks will catch lots of programming * errors (invalid parameters, etc.) */ BIOS.libType = BIOS.LibType_Custom; BIOS.logsEnabled = false; BIOS.assertsEnabled = true; /* Make sure libraries are built with 32-bit enum types to be compatible with DSP enum types*/ BIOS.includeXdcRuntime = true; BIOS.customCCOpts += " --enum_type=int "; BIOS.heapSize = 0x8000;