Problems with timers compilation on TMDX570LC43HDK

etantonio wrote on Monday, November 20, 2017:

Hy,
I’m trying to implement FreeRTOS V9.0.0 example 13 from
“161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide”,
I’ve modified it a little bit because my target environment is TMS570 on TMDX570LC43HDK board,
this is my configuration regarding timers:

define configUSE_TIMERS 1
define configTIMER_TASK_PRIORITY ( 5 )
define configTIMER_QUEUE_LENGTH 5
define configTIMER_TASK_STACK_DEPTH ( 100 )

the problem is that during compiling I’ve the error:

 undefined              first referenced                     
  symbol                    in file                          
 ---------              ----------------                     
 MPU_xTimerCreate       ./source/Main.obj                    
 xTimerPendFunctionCall ./HalCoGen/source/os_mpu_wrappers.obj

how can I solve such kind of compilation problems?
The main code is the following:


######include “HL_sci.h”
######include “HL_gio.h”
######include “HL_reg_het.h”

######include “FreeRTOS.h”

######include “os_projdefs.h”
######include “os_task.h”

######include “string.h”
######include “stdlib.h”

######include “Misc.h”
######include “os_queue.h”
######include “os_timer.h”

/* The periods assigned to the one-shot and auto-reload timers respectively. */
####define mainONE_SHOT_TIMER_PERIOD ( pdMS_TO_TICKS( 3333UL ) )
####define mainAUTO_RELOAD_TIMER_PERIOD ( pdMS_TO_TICKS( 500UL ) )

/-----------------------------------------------------------/

/*

  • The callback functions used by the one-shot and auto-reload timers
  • respectively.
    */
    static void prvOneShotTimerCallback( TimerHandle_t xTimer );
    static void prvAutoReloadTimerCallback( TimerHandle_t xTimer );

void Main_Main()
{
sciInit();
gioInit();

TimerHandle_t xAutoReloadTimer, xOneShotTimer;
BaseType_t xTimer1Started, xTimer2Started;

xOneShotTimer = xTimerCreate( "OneShot",					
							  mainONE_SHOT_TIMER_PERIOD,	
							  pdFALSE,						
							  0,							
							  prvOneShotTimerCallback );	

xAutoReloadTimer = xTimerCreate( "AutoReload",					
								 mainAUTO_RELOAD_TIMER_PERIOD,	
								 pdTRUE,						
								 0,								
								 prvAutoReloadTimerCallback );	

/* Check the timers were created. */
if( ( xOneShotTimer != NULL ) && ( xAutoReloadTimer != NULL ) )
{
	xTimer1Started = xTimerStart( xOneShotTimer, 0 );
	xTimer2Started = xTimerStart( xAutoReloadTimer, 0 );
	if( ( xTimer1Started == pdPASS ) && ( xTimer2Started == pdPASS ) )
	{
		vTaskStartScheduler();
	}
}
for( ;; );
return 0;

}

/-----------------------------------------------------------/

static void prvOneShotTimerCallback( TimerHandle_t xTimer )
{
static TickType_t xTimeNow;
xTimeNow = xTaskGetTickCount();
PutH32( xTimeNow );
}
/-----------------------------------------------------------/

static void prvAutoReloadTimerCallback( TimerHandle_t xTimer )
{
static TickType_t xTimeNow;
xTimeNow = xTaskGetTickCount();
PutH32( xTimeNow );
}
/-----------------------------------------------------------/

Thanks for your help,
Antonio

rtel wrote on Monday, November 20, 2017:

os_mpu_wrappers is not a file we provide for the Cortex-R port, I think
this is an extension provided by TI themselves, so I don’t know where
the missing symbol MPU_xTimerCreate() will be.

xTimerPendFunctionCall() is in FreeRTOS/source/timers.c. As can be seen
on line 1057 here:
https://sourceforge.net/p/freertos/code/HEAD/tree/tags/V9.0.0/FreeRTOS/Source/timers.c
INCLUDE_xTimerPendFunctionCall must be set to 1 in FreeRTOSConfig.h for
it to be available.

etantonio wrote on Tuesday, November 21, 2017:

Hy,
thanks for your answer,
it solves one of the error, I’ve no more:
xTimerPendFunctionCall ./HalCoGen/source/os_mpu_wrappers.obj
but I’ve again the error:

 undefined              first referenced                     
  symbol                    in file                          
 ---------              ----------------                     
 MPU_xTimerCreate       ./source/Main.obj  

I’ve tried also to substitute timer.c and timer.h in os_timers.c and os_timers.h but it doesn’t solve the problem.

Any idea about how to solve it?
Thanks,
Antonio

rtel wrote on Tuesday, November 21, 2017:

Like I said, that part is not our code, so other that stating the obvious and suggesting that you Greg the files to find where it is defined, I’m afraid I don’t know.

If that is TI code, did you ask on the TI forum?