rtel wrote on Thursday, September 27, 2007:
I think IAR V4.2 is the latest so I’m surprised the project can be opened in V4.0. Sometimes with IAR opening the project in an older version will silently clobber some of the compilation options, so be aware of that if you have any compilation problems.
All the demo tasks are created in main(). If you look in main you will see:
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartDynamicPriorityTasks();
vStartMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
vStartQueuePeekTasks();
Start by commenting out some of these, for example:
//vStartIntegerMathTasks( tskIDLE_PRIORITY );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); // Leave this one!
//vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
//vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
//vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartDynamicPriorityTasks();
vStartMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
vStartQueuePeekTasks();
Each of the demo tasks is also checked from within main.c - within a function prvCheckOtherTasksAreStillRunning() - so you also need to comment out the reference to the task within this function.
For example, if you have commented out vStartIntegerMathTasks(), then you also need to comment out:
//if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
//{
// ulErrorFlags |= 0x01;
//}
Likewise, if you have commented out vStartBlockingQueueTasks(), then you also need to comment out:
//if( xAreBlockingQueuesStillRunning() != pdTRUE )
//{
// ulErrorFlags |= 0x08;
//}
IAR is intelligent enough to remove any unreferenced functions from the binary image, so this should make the code smaller by itself. If not, then remove the unused demo tasks from the build also. For example, if commenting out vStartIntegerMathTasks(), then you can also remove the file in which this function is defined, integer.c. This last step should not be necessary though.
Regards.