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.

AM3352: TI-RTOS ((SYS / BIOS 6.76.3.01)) UART-driver 115200bps full-duplex communication Part2

Part Number: AM3352
Other Parts Discussed in Thread: SYSBIOS

I'm using TI-RTOS ((SYS / BIOS 6.76.3.01)) on AM3352. Can anyone tell me what are the things that inhibit task behavior and how to set them in XGCFG?
I'm having the following issue and can't seem to resolve it.

Received and processed 1 or 2 packets of about 10 characters every 4ms with 115200bps UART communication. From the state that this is operating normally, we added new processing.

If you run a task that uses I2C, the operation of a task that uses the UART driver will be suppressed, and data may be lost.
Priority is given to tasks using the UART driver.

If you change it so that it does not call the task using I2C in this state, it will work without problems.

Can anyone tell me what are the things that inhibit task behavior and how to set them in XGCFG?

Attach the current CFG file 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 BIOS = xdc.useModule('ti.sysbios.BIOS');
var SysStd = xdc.useModule('xdc.runtime.SysStd');
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 Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

var HeapMem = xdc.useModule ("ti.sysbios.heaps.HeapMem");
var ti_sysbios_hal_Cache = xdc.useModule('ti.sysbios.hal.Cache');
var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
var ti_sysbios_family_arm_a8_intcps_Hwi = xdc.useModule('ti.sysbios.family.arm.a8.intcps.Hwi');
var Event = xdc.useModule('ti.sysbios.knl.Event');
var ti_sysbios_timers_dmtimer_Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
var Timer = xdc.useModule('ti.sysbios.hal.Timer');

/*
* 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;
*/

/*
* The BIOS module will create the default heap for the system.
* Specify the size of this default heap.
*/
/* BIOS.heapSize and Memory.defaultHeapInstance have both been set. BIOS.heapSize ignored. Using Memory.defaultHeapInstance. */
/* とでたので、以下の設定を抜いた */
/*BIOS.heapSize = 0x2000;*/

/*
* Build a custom SYS/BIOS library from sources.
*/
BIOS.libType = BIOS.LibType_Debug;

/* System stack size (used by ISRs and Swis) */
Program.stack = 0x2000;

/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x200;

System.SupportProxy = SysMin;

Swi.common$.namedInstance = true;
Program.sectionsExclude = ".*";

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

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");

/* Load the Osal package */
var osType = "tirtos";
var socType = "am335x";
var Osal = xdc.useModule('ti.osal.Settings');
Osal.osType = osType;
Osal.socType = socType;

/*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 = "evmAM335x";

/* Load the gpmc package */
var Gpmc = xdc.loadPackage('ti.drv.gpmc');
Gpmc.Settings.socType = socType;

/* Load the spi package */
var SpiPackage = xdc.loadPackage('ti.drv.spi');
SpiPackage.Settings.socType = socType;

/* Load the GPIO package */
var GPIO = xdc.loadPackage('ti.drv.gpio');
GPIO.Settings.socType=socType;

/* Load the uart package */
var Uart = xdc.loadPackage('ti.drv.uart');
Uart.Settings.socType = socType;

/* Load the i2c package */
var I2C = xdc.loadPackage('ti.drv.i2c');
I2C.Settings.socType = socType;

/* Load the driver packages, starting with mcasp */
var McASP = xdc.loadPackage('ti.drv.mcasp');
McASP.Settings.socType = socType;

/*
* The BIOS module will create the default heap for the system.
* Specify the size of this default heap.
*/
BIOS.cpuFreq.lo = 250000000;
Hwi.dispatcherTaskSupport = true;
Hwi.dispatcherAutoNestingSupport = true;
Hwi.initStackFlag = true;
Hwi.checkStackFlag = true;

/* Enable the cache */
//var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');
//Cache.enableCache = true;
// Cache.configureL2Sram = false;//DDR build
/* Enable the MMU (Required for L1/L2 caching) */

/***********************************************
* MMU Configuration *
***********************************************/
var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
Mmu.enableMMU = false;

/******************************************************************************
*
* SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
*
* ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
* ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
* ordered and non-cacheable)
* ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
* RW allocate)
******************************************************************************
*/


// descriptor attribute structure
/* Force peripheral section to be NON cacheable strongly-ordered memory */
var attrs0 = {
type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
tex: 0,
bufferable : false, // bufferable
cacheable : false, // cacheable
shareable : false, // shareable
noexecute : true, // not executable
};
Mmu.setFirstLevelDescMeta(0x4ae00000, 0x4ae00000, attrs0);

/* CM_, PRM_ registers */
Mmu.setFirstLevelDescMeta(0x44E00000, 0x44E00000, attrs0);

/* edma */

for (var i=0x49000000; i < 0x49100000; i = i + 0x00200000) {
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(i, i, attrs0);
}

for (var i=0x49800000; i < 0x49B00000; i = i + 0x00200000) {
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(i, i, attrs0);
}

/* I2C0 */
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(0x44e0b000, 0x44e0b000, attrs0);

/* I2C1 */
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(0x4802A000, 0x4802A000, attrs0);
/* I2C2 */
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(0x4819c000, 0x4819c000, attrs0);

/* mcasp-0 CFG*/
for (var i=0x48038000; i < 0x4803B000; i = i + 0x00200000) {
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(i, i, attrs0);
}

/* mcasp-0 DATA */
for (var i=0x46000000; i < 0x46400000; i = i + 0x00200000) {
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(i, i, attrs0);
}
/*
// descriptor attribute structure
var attrs1 = new Mmu.DescriptorAttrs();

var attrs1 = {
type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
tex: 0,
bufferable : false, // bufferable
cacheable : false, // cacheable
shareable : false, // shareable
noexecute : true, // not executable
};


// Set the descriptor for each entry in the address range
for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
// Each 'BLOCK' descriptor entry spans a 2MB address range
Mmu.setFirstLevelDescMeta(i, i, attrs1);
}
*/

/*
* Program.argSize sets the size of the .args section.
* The examples don't use command line args so argSize is set to 0.
*/
Program.argSize = 0x0;

/* System stack size (used by ISRs and Swis) */
Program.stack = 327680;

/*
* 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;

/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x200;
System.SupportProxy = SysMin;

/*
* 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;

if (Program.build.target.$name.match(/gnu/)) {
if (Program.build.target.$name.match(/A8F/) ||
Program.build.target.$name.match(/A9F/) ||
Program.build.target.$name.match(/A15F/)) {
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}
}


/* allocate a config-params object */
var HeapParam = new HeapMem.Params;

/* optionally assign per-instance configs */
HeapParam.size = 200000;
//HeapParam.sectionName = "L2SRAM"

/* create an instance-object */
Program.global.myHeap = HeapMem.create(HeapParam);

//Program.sectMap[".text"] = "L2SRAM";
// chnaging default tick of timer to 100us from default 1000us
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
Clock.tickPeriod = 2090;

var Load = xdc.useModule('ti.sysbios.utils.Load');
// Load.common$.logger = loggerBuf0;
var Diags = xdc.useModule('xdc.runtime.Diags');
Load.common$.diags_USER4 = Diags.ALWAYS_ON;
BIOS.customCCOpts = "-Wunused -Wunknown-pragmas -ffunction-sections -fdata-sections -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mabi=aapcs -g -Dfar= -D__DYNAMIC_REENT__ -mapcs";
BIOS.heapSize = 655360;
Clock.timerId = 0;
Semaphore.supportsEvents = true;
Task.numPriorities = 32;
ti_sysbios_timers_dmtimer_Timer.intFreq.lo = 12000000;
var clock0Params = new Clock.Params();
clock0Params.instance.name = "clock4ms";
clock0Params.period = 4;
clock0Params.startFlag = false;
Program.global.clock4ms = Clock.create("&timerFunc", 4, clock0Params);
Memory.defaultHeapSize = 6553600;