Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: NDK task priorities vs. application task priorities

$
0
0
Hi John, There is a known bug in NDK due to which the updated configuration values are not visible in NC_SystemOpen() function as it is called very early. Since NC_SystemOpen() is responsible for setting up the scheduler priority, it ends up using the old value. For NC_PRIORITY_HIGH the old value would be (OS_TASKPRIKERN - 1) or (9 -1 = 8). We already have a bug filed for this issue: SDOCM00086985 NDK configuration values do not apply in NC_SystemOpen You could work around this issue by updating ti/ndk/netctrl/netctrl.c file as follows and rebuilding NDK library: int NC_SystemOpen( int Priority, int OpMode ) { HANDLE hSem = 0; /* Open the low-level enironment */ /* Set the network scheduler priority */ // !!! REMOVE CHECK !!! //if( Priority != NC_PRIORITY_LOW && Priority != NC_PRIORITY_HIGH ) // return(NC_OPEN_ILLEGAL_PRIORITY); // !!! REMOVE ASSIGNMENT !!! //SchedulerPriority = Priority; /* Check the operating mode */ if( OpMode != NC_OPMODE_POLLING && OpMode != NC_OPMODE_INTERRUPT ) return(NC_OPEN_ILLEGAL_OPMODE); /* Polling at high priority is illegal */ // !!! REMOVE CHECK !!! //if( Priority==NC_PRIORITY_HIGH && OpMode==NC_OPMODE_POLLING ) // return(NC_OPEN_ILLEGAL_OPMODE); /* Intialize the task environment */ _TaskInit(); and /* ARGSUSED */ static void NetScheduler( uint const SerialCnt, uint const EtherCnt ) { register int fEvents; /* Set the scheduler priority */ // !!! UPDATE SCHEDULER PRIORITY !!! // TaskSetPri( TaskSelf(), SchedulerPriority ); TaskSetPri( TaskSelf(), 14 ); // Replace SchedulerPriority with desired pri /* Enter scheduling loop */ while( !NetHaltFlag ) { I also wanted to check with you that are you using XGCONF or C code to configure NDK ? I have a doubt because I saw an earlier post of yours where you shared C code for a stackThread() that calls NC_SystemOpen() and create a new cfg. If you are using C code then I believe you need to add a CfgEntry to update the different default NDK priorities. Best, Ashish

Viewing all articles
Browse latest Browse all 25965

Trending Articles



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