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/TMS320F28069M: Tasks Created Dynamically Not Shown in RTOS Analyzer -> Execution Graph

Part Number: TMS320F28069M

Tool/software: TI-RTOS

My question is about RTOS Analyzer -> Execution Graph. I have four tasks, two of them were hooked to functions, ConvertTemp(), LogTempDegC(), by using the app.cfg tool statically, the other two tasks, LoTaskFxn(), HiTaskFxn(), were created dynamically to experiment GateMutexPri usage, please refer to the attachment file for the two dynamically created tasks. The Expression window showed all the four tasks running normally. However, the HiTaskFxn task was not shown in the Execution Graph. Please advise how to make it visible in the Execution Graph.

 

 /****************************************************************************************
 * Copyright:  	GoldenMaple Technologies (C) 2019
 * Project:		EECS X497.34 Course Project
 * File Name:	F2806x_Temp.c
 * Description:	F2806x Device Concurrent Tasks Demo
 * Language:    TI TMS320F2806x C
 * Author:		Louis Zhu
 * Created:		9/15/2019
 * Notes:
 * Mod History: V1.0: Initial version developed on LaunchXL-F28069M LaunchPad
 ****************************************************************************************/

/* BIOS module Headers */
#include <xdc/std.h>
#include <ti/sysbios/BIOS.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/Log.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/gates/GateMutexPri.h>
#include <ti/sysbios/gates/GateTask.h>

#include "ConcurrentTasks.h"

/****************************************************
 * #pragma section
 ****************************************************/

/****************************************************
 * Variable Declaration
 ****************************************************/
Int resource = 0;
Int loTaskCount = 0;
Int hiTaskCount = 0;
UInt32 sleepTickCount;

GateMutexPri_Handle gateHandle;
Task_Handle loTaskHandle, hiTaskHandle;

/****************************************************
 * Static Function Prototypes
 ****************************************************/
void LoTaskFxn(void);
void HiTaskFxn(void);

/*******************************************************************************************
 * Function: InitConcurrentTasks
 *
 * Description: This function initializes Concurrent tasks data.
 *
 * Parameters: None
 *
 * Returns: None
 *
 * Special Notes:
 *
 *******************************************************************************************/
void InitConcurrentTasks(void)
{
	/* Create BIOS objects */
	Task_Params loTaskParams, hiTaskParams;
	Error_Block eb;
	GateMutexPri_Params gateParams;

	//create GateMutexPri object
	Error_init(&eb);
	GateMutexPri_Params_init(&gateParams);
	gateHandle = GateMutexPri_create(&gateParams, &eb);
	if (gateHandle == NULL)
	{
		Log_info0("Creating GateMutexPri failed.");
	}

	/* Construct writer/reader Task threads */
	Task_Params_init(&loTaskParams);
	loTaskParams.priority = 1;
	loTaskHandle = Task_create((Task_FuncPtr)LoTaskFxn, &loTaskParams, NULL);
	if (loTaskHandle == NULL)
	{
		Log_info0("Creating LoTaskFxn failed.");
	}

	Task_Params_init(&hiTaskParams);
	hiTaskParams.priority = 3;
	hiTaskHandle = Task_create((Task_FuncPtr)HiTaskFxn, &hiTaskParams, NULL);
	if (hiTaskHandle == NULL)
	{
		Log_info0("Creating HiTaskFxn failed.");
	}

	/* sleep for defined time */
	sleepTickCount = SLEEP_TIME / Clock_tickPeriod;

}

/*******************************************************************************************
 * Function: LoTaskFxn
 *
 * Description: This function
 *
 * Parameters: None
 *
 * Returns: None
 *
 * Special Notes:
 *
 *******************************************************************************************/
void LoTaskFxn(void)
{
	UInt32 time;
	IArg key;

	while (1)
	{
		Log_info0("Running LoTaskFxn function.");

		key = GateMutexPri_enter(gateHandle);

		// Do work by waiting for 2 system ticks to pass
		time = Clock_getTicks();
		while (Clock_getTicks() <= (time + sleepTickCount))
		{
			;
		}

		// Do work on locked resource
		resource += 1;
		loTaskCount += 1;	//track the count from LoTaskFxn

		// Unlock resource
		GateMutexPri_leave(gateHandle, key);

		Task_sleep(sleepTickCount);
	}
}

/*******************************************************************************************
 * Function: HiTaskFxn
 *
 * Description: This function
 *
 * Parameters: None
 *
 * Returns: None
 *
 * Special Notes:
 *
 *******************************************************************************************/
void HiTaskFxn(void)
{
    IArg key;

    while (1)
    {
    	Log_info0("Running HiTaskFxn function.");

        // Get access to resource
        key = GateMutexPri_enter(gateHandle);

        // Do work on locked resource
        resource += 1;
        hiTaskCount += 1;	//track the count from HiTaskFxn

        // Unlock resource
        GateMutexPri_leave(gateHandle, key);

        Task_sleep(sleepTickCount);
    }
}

  • Hi Louis,

    The execution graph is composed by it looking at the Log records. I'm assuming you are using LoggerStopmode. That logger holds the records in an internal buffer...so the number of records is limited to the size of the buffer.

    The tasks are "discovered" by the execution graph when it finds a context switch record. If HiTaskFxn never was actually running (e.g. blocked on something) during the period covered by the records in the internal buffer, the execution graph will not show it. If you increase the size of the logger buffer, you have a better chance of having that task run during the period.

    Todd
  • Hi Todd,

    Thank you for your hint, following your direction I increased the logger buffer size and adjusted timing among tasks, I was able to display all four tasks in the Execution Graph.

    Louis