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.

NDK scheduler starting with incorrect priority

Hello,

I'm using the following code in my RTSC configuration to setup NDK 2.22.03.20:

var Ndk = xdc.useModule('ti.ndk.config.Global');
Ndk.enableCodeGeneration = true;
Ndk.netSchedulerPri = Ndk.NC_PRIORITY_LOW;
Ndk.lowTaskPriLevel = 4;

The problem is that the scheduler always gets started based on the default value of 'lowTaskPriLevel', which is 3. The actual setting of 'lowTaskPriLevel' has no effect.

The source of the problem can be seen in the generated .c file (see also packages\ti\ndk\config\Global.xdt):

rc = NC_SystemOpen(NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT);
...
rc = 4;
CfgAddEntry(hCfg, CFGTAG_OS, CFGITEM_OS_TASKPRILOW,
             CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );

First, NC_SystemOpen() gets called with NC_PRIORITY_LOW which is defined as (_oscfg.TaskPriLow-1). At this point, _oscfg is only initialized with default values. The next call to CfgAddEntry() has no effect on the priority of the scheduler.

I think the same problem would occur with the NC_PRIORITY_HIGH setting ('highTaskPriLevel').

Thanks,
Ralf

  • Hi Ralf,

    Thanks for analyzing the problem. You are correct, if the priority is changed in the configuration, it takes affect very late and therefore the scheduler starts running with the old default priority. We are aware of this problem and have filed a bug for this issue: SDOCM00086985 NDK configuration values do not apply in NC_SystemOpen

    Best,
    Ashish