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.

CC1312R: Application stops after HeapMem_create when macTask is added

Part Number: CC1312R
Other Parts Discussed in Thread: SYSCONFIG, SYSBIOS

Hi,

I am working on my previously written application which is updated to SimpleLink SDK 6.20.00.29, RTOS7 and using TI Clang v2.1.0.LTS compiler. Application with several tasks runs well. But I am having a problem with adding macTask and Collector_process task from collector_CC1312R1_LAUNCHXL_tirtos7_clang example project to my application. 

Work done:

  • macTask initilization done from "main()" right after Board support initialization and before initializing any other task. macTask has highest priority of all tasks.
  • Updated Sysconfig with TI15.4 stack configuration.
  • HEAPS configuration now has additional HeapCallback implementation with osalHeap* callbacks from example. 

Here is TI-RTOS and TI 15.4 stack configuration from SysConfig:

const BIOS = scripting.addModule("/ti/sysbios/BIOS");
const Boot = scripting.addModule("/ti/sysbios/family/arm/cc26xx/Boot");
const Hwi = scripting.addModule("/ti/sysbios/family/arm/m3/Hwi");
const HeapBuf = scripting.addModule("/ti/sysbios/heaps/HeapBuf");
const HeapCallback = scripting.addModule("/ti/sysbios/heaps/HeapCallback");
const HeapMem = scripting.addModule("/ti/sysbios/heaps/HeapMem");
const HeapMultiBuf = scripting.addModule("/ti/sysbios/heaps/HeapMultiBuf");
const Clock = scripting.addModule("/ti/sysbios/knl/Clock");
const Event = scripting.addModule("/ti/sysbios/knl/Event");
const Idle = scripting.addModule("/ti/sysbios/knl/Idle");
const Idle1 = Idle.addInstance();
const Mailbox = scripting.addModule("/ti/sysbios/knl/Mailbox");
const Semaphore = scripting.addModule("/ti/sysbios/knl/Semaphore");
const Swi = scripting.addModule("/ti/sysbios/knl/Swi");
const Task = scripting.addModule("/ti/sysbios/knl/Task");
const Error = scripting.addModule("/ti/sysbios/runtime/Error");
const Memory = scripting.addModule("/ti/sysbios/runtime/Memory");
const Startup = scripting.addModule("/ti/sysbios/runtime/Startup");
const SysCallback = scripting.addModule("/ti/sysbios/runtime/SysCallback");
const System = scripting.addModule("/ti/sysbios/runtime/System");
const ti154stack = scripting.addModule("/ti/ti154stack/ti154stack");

BIOS.assertsEnabled = false;
BIOS.heapSize = 0x00000000;
BIOS.heapBaseAddr = "heapStart";
BIOS.heapEndAddr = "heapEnd";
BIOS.rtsGateType = "BIOS_GateMutexPri";
BIOS.heapType = "HeapCallback";

Hwi.enableException = false;
Hwi.nvicCCR = [];

HeapCallback.allocInstFxn = "osalHeapAllocFxn";
HeapCallback.initFxn = "osalHeapInitFxn";
HeapCallback.freeInstFxn = "osalHeapFreeFxn";
HeapCallback.getStatsInstFxn = "osalHeapGetStatsFxn";
HeapCallback.isBlockingInstFxn = "osalHeapIsBlockingFxn";

HeapMem.modGateType = "GateMutexPri";

Clock.tickPeriod = 10;
Clock.swiPriority = 4;

Idle1.$name = "powerIdle";
Idle1.idleFxn = "Power_idleFunc";

Semaphore.supportsPriority = false;

Swi.numPriorities = 6;

Task.checkStackFlag = false;
Task.numPriorities = 6;
Task.defaultStackSize = 512;

Error.policy = "Error_SPIN";

Startup.startupEnabled = false;

System.abortFxn = "System_abortSpin";
System.exitFxn = "System_exitSpin";
System.extendedFormats = "%f%$S";
System.supportModule = "SysCallback";
System.maxAtexitHandlers = 0;

ti154stack.mode = "beacon";
ti154stack.phyRegulation = "etsi";
ti154stack.freqSub1 = "freq863";
ti154stack.phyType = "phy200kbps";
ti154stack.channels = ["13"];
ti154stack.maxDevices = 12;
ti154stack.transmitPower = "14";
ti154stack.macBeaconOrder = 10;
ti154stack.macSuperframeOrder = 3;
ti154stack.aesccmModule.$name = "CONFIG_AESCCM_0";
ti154stack.ti154stackModule.$name = "ti_ti154stack_ti154stack_config_mod0";
ti154stack.ti154stackOpts.$name = "ti_ti154stack_ti154stack_config_opts0";
ti154stack.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";

Problem seems to appear when next task tries to create HeapMem instance. After creation of HeapMem instance (HeapMem_create) yet another task should be initialized and running but it is not happening. When I comment out HeapMem creation all other tasks are initialized and running. I found on SYS/BIOS user's guide this " You cannot create HeapMem instances beyond the default system heap in SysConfig. Other heaps must
be created in runtime C code."  I'm not sure if it causing my problem yet. Would be great if you could suggest some reading or debugging towards my problem. Thanks.