Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

AM3358: Why doesTask_create return NULL?

$
0
0

Part Number: AM3358

Here is my main

Intmain()

{

System_printf("enter main()\n");

Error_Block eb;

Error_init(&eb);

Board_initCfg boardCfg = BOARD_INIT_PINMUX_CONFIG |

BOARD_INIT_MODULE_CLOCK |

BOARD_INIT_UART_STDIO;

Board_STATUS boardStatus = Board_init(boardCfg);

if (boardStatus != BOARD_SOK)

{

return (0);

}

/* Initialize the task params */

Task_Params taskParams;

Task_Params_init(&taskParams);

taskParams.stackSize = 4*1024;

/* Set the task priority higher than the default priority (1) */

taskParams.priority = 2;

Task_Handle task = Task_create(taskFxn, &taskParams, &eb);

if (task == NULL) {

System_printf("Task_create() failed!\n");

BIOS_exit(0);

}

start_app(); /* does not return */

return(0);

}

here my app.cfg

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 LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

var Main = xdc.useModule('xdc.runtime.Main');

var Memory = xdc.useModule('xdc.runtime.Memory')

var SysMin = xdc.useModule('xdc.runtime.SysMin');

var System = xdc.useModule('xdc.runtime.System');

var Text = xdc.useModule('xdc.runtime.Text');

var GIO = xdc.useModule('ti.sysbios.io.GIO');

var Clock = xdc.useModule('ti.sysbios.knl.Clock');

var Swi = xdc.useModule('ti.sysbios.knl.Swi');

var Task = xdc.useModule('ti.sysbios.knl.Task');

var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');

var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');

var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

var Timer = xdc.useModule('ti.sysbios.hal.Timer');

var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

var Edma = xdc.loadPackage ("ti.sdo.edma3.drv.sample");

var drv = xdc.loadPackage ("ti.sdo.edma3.drv");

var rm = xdc.loadPackage ("ti.sdo.edma3.rm");

/* ================ BIOS configuration ================ */

var BIOS = xdc.useModule('ti.sysbios.BIOS');

/*

* The BIOS module will create the default heap for the system.

* Specify the size of this default heap.

*/

BIOS.heapSize = 0x1000;

/*

* Build a custom SYS/BIOS library from sources.

*/

BIOS.libType = BIOS.LibType_Custom;

BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");

BIOS.assertsEnabled = false;

BIOS.logsEnabled = false;

BIOS.swiEnabled = false;

/*

* The BIOS module will create the default heap for the system.

* Specify the size of this default heap.

*/

BIOS.heapSize = 0x8000;

Swi.common$.namedInstance = true;

Program.sectionsExclude = ".*";

Clock.tickPeriod = 1000;

Hwi.dispatcherSwiSupport = true;

Hwi.dispatcherTaskSupport = true;

Hwi.dispatcherAutoNestingSupport = true;

Task.enableIdleTask = false;

Task.initStackFlag = false;

Task.checkStackFlag = false;

/* ================ Driver configuration ================ */

/* Load the Osal package */

var osType = "tirtos";

var Osal = xdc.loadPackage('ti.osal');

Osal.Settings.osType = osType;

/*use CSL package*/

var socType = "am335x";

var Csl = xdc.loadPackage('ti.csl');

Csl.Settings.deviceType = socType;

/* Load the board package */

var Board = xdc.loadPackage('ti.board');

Board.Settings.boardName = "bbbAM335x";

/* Load the driver packages, starting with mcasp */

var McASP = xdc.loadPackage('ti.drv.mcasp');

McASP.Settings.socType = socType;

/* Load the spi package */

var Spi = xdc.loadPackage('ti.drv.spi');

Spi.Settings.socType = socType;

/* Load the I2C package */

var I2C = xdc.loadPackage('ti.drv.i2c');

I2C.Settings.socType = socType;

/* Load the uart package */

var Uart = xdc.loadPackage('ti.drv.uart');

Uart.Settings.socType = socType;

/* Load Profiling package */

var Utils = xdc.loadPackage('ti.utils.profiling');

/* Load the gpio package */

var Gpio = xdc.loadPackage('ti.drv.gpio');

Gpio.Settings.socType = socType;

Gpio.Settings.enableProfiling = true;

/* ================ Cache and MMU configuration ================ */

var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');

Cache.enableCache = true;

var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');

Mmu.enableMMU = true;

/* Force peripheral section to be NON cacheable strongly-ordered memory */

var peripheralAttrs = {

type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor

tex: 0,

bufferable : false, // bufferable

cacheable : false, // cacheable

shareable : false, // shareable

noexecute : true, // not executable

};

/* Define the base address of the 1 Meg page the peripheral resides in. */

var peripheralBaseAddr = 0x44e00400;;

/* Configure the corresponding MMU page descriptor accordingly */

Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

peripheralBaseAddr,

peripheralAttrs);

 

/* Define the base address of the 1 Meg page the peripheral resides in. */

var peripheralBaseAddr = 0x481a6000;

/* Configure the corresponding MMU page descriptor accordingly */

Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

peripheralBaseAddr,

peripheralAttrs);

/*

* Uncomment this line to globally disable Asserts.

* All modules inherit the default from the 'Defaults' module. You

* can override these defaults on a per-module basis using Module.common$.

* Disabling Asserts will save code space and improve runtime performance.

*/

/*Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; */

/*

* Uncomment this line to keep module names from being loaded on the target.

* The module name strings are placed in the .const section. Setting this

* parameter to false will save space in the .const section. Error and

* Assert messages will contain an "unknown module" prefix instead

* of the actual module name.

Defaults.common$.namedModule = false;

*/

/*

* Minimize exit handler array in System. The System module includes

* an array of functions that are registered with System_atexit() to be

* called by System_exit().

*/

System.maxAtexitHandlers = 4;

/*

* Uncomment this line to disable the Error print function.

* We lose error information when this is disabled since the errors are

* not printed. Disabling the raiseHook will save some code space if

* your app is not using System_printf() since the Error_print() function

* calls System_printf().

Error.raiseHook = null;

*/

/*

* Uncomment this line to keep Error, Assert, and Log strings from being

* loaded on the target. These strings are placed in the .const section.

* Setting this parameter to false will save space in the .const section.

* Error, Assert and Log message will print raw ids and args instead of

* a formatted message.

Text.isLoaded = false;

*/

/*

* Uncomment this line to disable the output of characters by SysMin

* when the program exits. SysMin writes characters to a circular buffer.

* This buffer can be viewed using the SysMin Output view in ROV.

SysMin.flushAtExit = false;

*/

/* System stack size (used by ISRs and Swis) */

Program.stack = 0x4000;

/* Circular buffer size for System_printf() */

SysMin.bufSize = 0x200;

/*

* Create and install logger for the whole system

*/

var loggerBufParams = new LoggerBuf.Params();

loggerBufParams.numEntries = 16;

var logger0 = LoggerBuf.create(loggerBufParams);

Defaults.common$.logger = logger0;

Main.common$.diags_INFO = Diags.ALWAYS_ON;

System.SupportProxy = SysMin;

var timer0Params = new Timer.Params();

timer0Params.instance.name = "timer0";

Program.global.timer0 = Timer.create(null, null, timer0Params);

 Thank you for your help.


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>