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