AnsweredAssumed Answered

What does 'undefined reference ' mean in Truestudio

Question asked by melt brink on Jun 14, 2018
Latest reply on Jun 14, 2018 by melt brink

Im adding to touch to STM32f746 Disco. Using STCubeMx and STemwin + Guibuilder.  When trying to add touch I add the following two include files to main.h

#include "stm32746g_discovery.h"
#include "stm32746g_discovery_ts.h"

 

when I compile I two errors pop up :

 

         undefined reference to 'BSP_TS_GetState'

         undefined reference to BSP_TS_Init'

 

These are referenced in the stm32f746_discovery_ts.h  can someone tell me what these errors mean.

they are used in functions below from main.c (highlighted in bold)

 

 

void TouchTimer_Init()

{
BSP_TS_Init(480,272); // initialize touch screen
if (HAL_TIM_Base_Init(&htim3) != HAL_OK ) {while (1);} // start timers
if (HAL_TIM_Base_Start_IT(&htim3) != HAL_OK ) {while (1);}
}

and

 

 

void BSP_Pointer_Update(void)
{
GUI_PID_STATE TS_State; // structure that reports touch state
static TS_StateTypeDef prev_state; // previous touch state from touch sensor
TS_StateTypeDef ts; // actual touch state from the sensor from BSP package
uint16_t xDiff, yDiff; // difference in positions
BSP_TS_GetState(&ts); // read the touch state from sensor BSP API
TS_State.Pressed = ts.touchDetected; // Store the pressed state to Stemwin

xDiff = (prev_state.touchX[0] > ts.touchX) ? (prev_state.touchX[0] - ts.touchX[0]) : (ts.touchX[0] - prev_state.touchX[0]);
yDiff = (prev_state.touchY[0] > ts.touchY) ? (prev_state.touchY[0] - ts.touchY[0]) : (ts.touchY[0] - prev_state.touchY[0]);

if((prev_state.touchDetected = ts.touchDetected )|| (xDiff > 3 )||(yDiff > 3))

{
prev_state.touchDetected = ts.touchDetected;

if((ts.touchX[0] != 0) && (ts.touchY[0] != 0))
{
prev_state.touchX[0] = ts.touchX[0];
prev_state.touchY[0]= ts.touchY[0];
}
TS_State.Layer = 0;
TS_State.x = prev_state.touchX[0];
TS_State.y = prev_state.touchY[0];


//send touch state to stemnwin
GUI_TOUCH_StoreStateEx(&TS_State);

}
}

Outcomes