cancel
Showing results for 
Search instead for 
Did you mean: 

"STM32CubeIDE" statistical profiling missing task handler and other functions

Garnett.Robert
Senior III

Hi,

I am programming a STM32H7B3I-DK Disco board and am trying to profile the functions.

I have a freeRTOS task used as an I2C DMA driver handler. The code is:

/* Main i2c Handler Task  */
static void i2c_1_HandlerTsk(void *argument)
{
	osSemaphoreAcquire(sampleTimerSemHandle, 0);
 
	/* Initialise the  VCNL40x0 Prox Device*/
	initProxProbe();
 
  /* Start the sample clock */
	HAL_TIM_Base_Start_IT(&htim5);
 
	/* Main sample loop driven by Timer 5 Interrupt */
	while(1)
	{
		if (osSemaphoreAcquire(sampleTimerSemHandle, SAMPLE_TIME_SEM_TIMEOUT / portTICK_PERIOD_MS) == osErrorTimeout)
		{
				/* TODO */
		}
		/* Get the proximiter 16 bit value from the device */
		ReadProxiOnDemand(&proxValue) ;
 
		/* Remove dc value and low pass filter the data */
		LowPassFilt_U.ProxSig = proxValue;
		LowPassFilt_step();
 
		/* Apply Auto gain control and detect signal */
		Detector_U.DetIp = LowPassFilt_U.ProxSig;
		Detector_step();
 
		if (prox.HoldOffTime == 0x00U)
		{
			/* Disable the holdoff function */
			Detector_U.DisableHoldOff = 0x01U;
		}
		else
		{
			/* Enable the holdoff function */
			Detector_U.DisableHoldOff = 0x00U;
			Detector_U.BlockingLength = prox.HoldOffTime;
 
			/* Toggle the Holdoff timer clock input */
			Detector_U.Clock = !Detector_U.Clock;
		}
	}
}	

The code is static, definitely gets executed. I have optimizations set to 0 so it shouldn't be optimized out and I have tried the code with inline disabled. When I run the profiler the function does not appear in the list of functions and neither do any of the others that this code calls, however a number of other functions another level down do get logged.

Another peculiar thing is that the Static Analyzer reports this function as "de3ad code" yet the code is executed and is included in the output map of the build.

  1. What would cause my functions to be invisible to the Stat's Profiler
  2. What can I do to get them included?

The code runs perfectly.

Best regards

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
Garnett.Robert
Senior III

I found the problem.

My the function has very little code of its own and therefore does not get hit by the tracer. If you run the trace for a long time you might get one or two hits which are reported.

View solution in original post

1 REPLY 1
Garnett.Robert
Senior III

I found the problem.

My the function has very little code of its own and therefore does not get hit by the tracer. If you run the trace for a long time you might get one or two hits which are reported.