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.

RTOS/CC1310EMK: How to use Task_delete() ;

Part Number: CC1310EMK
Other Parts Discussed in Thread: SYSBIOS, CC1350

Tool/software: TI-RTOS

TI RTOS: tirtos_cc13xx_cc26xx_2_21_00_06

Software: IAR FOR ARM7.7

I want to delete several tasks,

When I add   (Task.deleteTerminatedTasks = true;)   in the .cfg file

Compiler error:

Error while running "c:/ti/xdctools_3_32_00_06_core/xs" 
--xdcpath="c:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/packages;c:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/tidrivers_cc13xx_cc26xx_2_21_00_04/packages;c:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/bios_6_46_01_37/packages;
c:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/uia_2_01_00_01/packages" iar.tools.configuro -c "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\arm" --cc "C:\Program Files (x86)\IAR Systems\Embedded Workbench 
7.5\arm\bin\iccarm.exe" --device "CC1310F128" --compileOptions "-o E:\jinchaoli\GS511\Software_Design\example\ADC_Project\Debug\Obj --no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling 
--debug --endian=little --cpu=Cortex-M3 -f E:\jinchaoli\GS511\Software_Design\example\ADC_Project/configPkg/compiler.opt.defs --diag_suppress=Pa050 -Ic:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc13xxware_2_04_03_17272 
-Dewarm --debug --silent -e --fpu=None --dlib_config \"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\arm\INC\c\DLib_Config_Normal.h\" -Ol" --linkOptions "-o E:\jinchaoli\GS511\Software_Design\example\
ADC_Project\Debug\Exe\adc_project.out --map E:\jinchaoli\GS511\Software_Design\example\ADC_Project\Debug\List\adc_project.map --config E:\jinchaoli\GS511\Software_Design\example\
ADC_Project/adc_project_CC1310DK_7XD.icf -f E:\jinchaoli\GS511\Software_Design\example\ADC_Project/configPkg/linker.cmd c:/ti/tirtos_cc13xx_cc26xx_2_21_00_06/products/cc13xxware_2_04_03_17272/driverlib/bin/iar/driverlib.lib 
--silent --cpu=Cortex-M3 --entry=__iar_program_start --redirect _Printf=_PrintfSmall --redirect _Scanf=_ScanfSmall --semihosting --entry __iar_program_start --vfe" --profile release --projFile "E:\jinchaoli\GS511\Software_Design\example\
ADC_Project\adc_project.ewp"
 
Total number of errors: 1
Total number of warnings: 0

When I add   (Task.deleteTerminatedTasks = 0;)   in the .cfg file

Compiler ok:

 

  • If you are using the kernel in the ROM (specified in the .cfg...see below), you cannot set "Task.deleteTerminatedTasks = true;" in the .cfg. Since the kernel is in the ROM, some decision had to be made in regards to configuration. Note: you can call Task_delete yourself. This parameter was to enable the automatic deletion of a task that exits (calls Task_exit or simply falls out of the function).

    Todd

    var ROM = xdc.useModule('ti.sysbios.rom.ROM');
    ROM.romName = ROM.CC1350; // CC1350 is used for all CC13xx devices

    If you comment out the above lines, you can set use "Task.deleteTerminatedTasks = true;" Note: the overall size of the application will increase because the kernel code is now in flash.

    Todd
  • Thank you very much for your support.

    You mean,If i am are using the kernel in the ROM , i cannot use Task_delete() ,if use Task_delete(), i must use flash store kernel? Does the Task_delete(),the contents of the flash memory will be deleted?

    I found in the debugger, the beginning of a few cycles of normal operation. After a period of time, my semaphore value is no longer reduced. At the same time, the corresponding task is no longer executed,the task is blocked.Look at the picture.This is a headache.

    Does this have anything to do with the CFG configuration?   BIOS in ROM ,"Pending tasks are services based on first in, first out basis."

    /* ================ Semaphore configuration ================ */
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    /*
     * Enables global support for Task priority pend queuing.
     *
     * Pick one:
     *  - true (default)
     *      This allows pending tasks to be serviced based on their task priority.
     *  - false
     *      Pending tasks are services based on first in, first out basis.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //Semaphore.supportsPriority = true;
    Semaphore.supportsPriority = false;

    /*
     * Allows for the implicit posting of events through the semaphore,
     * disable for additional code saving.
     *
     * Pick one:
     *  - true
     *      This allows the Semaphore module to post semaphores and events
     *      simultaneously.
     *  - false (default)
     *      Events must be explicitly posted to unblock tasks.
     *
     *  When using BIOS in ROM:
     *      This option must be set to false.
     */
    //Semaphore.supportsEvents = true;
    Semaphore.supportsEvents = false;

  • user4202186 said:
    You mean,If i am are using the kernel in the ROM , i cannot use Task_delete() ,if use Task_delete(), i must use flash store kernel? Does the Task_delete(),the contents of the flash memory will be deleted?

    No. You can use Task_delete in either case (kernel in ROM or kernel in flash). You cannot use Task.deleteTerminatedTasks = true; with the kernel in ROM.

    "Task.deleteTerminatedTasks = true;" will delete terminated tasks for you. With it set to false, you have to call Task_delete yourself if you want to reclaim the memory of a terminated task (termination occurs if a task calls Task_exit or if it exit the task function).

    Note: Task_delete takes the address of a Task_Handle also...common mistake to just pass in the Task_Handle.

    Todd