cancel
Showing results for 
Search instead for 
Did you mean: 

STM32IDE+TouchGFX can't start.

Sergii Volchenko
Associate III

I try to connect LCD by SPI to Nucleo-767 and TouchGFX.

LCD screen work perfect and I could draw on it without a problem, but I stuck with TouchGFX.

I found that void TouchGFXHAL::flushFrameBuffer never call.

Check this video - https://youtu.be/1UhEx7E_dH0

What I did:

  1. New project for my board
  2. Make timer for VSync each 15ms
  3. Add TouchGFX Generator package
  4. Add CRC
  5. In TouchGFX settings set size 320x240 and RGB888.
  6. Open TouchGFX Designer, add button, and generate code.
  7. In code add start & callback for timer and call function for generate tick
  8. add switch on led on board.

LED doesn't light.

Of course, I checked that timer callback works, led works.

In debug mode I found that app stuck in lockFrameBuffer function.

What I did wrong?

24 REPLIES 24
MM..1
Chief III

Seems as you plan use TouchGFX without OS then read and apply all steps for this config from docu.

Too write how mode display you use?...

Sergii Volchenko
Associate III

What steps i missed? Vsync -> flushbuffer.

I tried with rtos but steps the same - generate vsync, in flushbuffer send from buffer to screen.​

Sergii Volchenko
Associate III

Yes, i implemented all of that. ​What next?

​Again, the problem that flushBuffer doesnt call, so no sense show full code of it.

Try show your code here for example

void OSWrappers::signalVSync()
{
 
}

...

Sergii Volchenko
Associate III

I think this is autogenerated function

void OSWrappers::signalVSync()
{
  vsync_sem = 1;
}

and where you call it ?...

i write for example best is place here all relevant code

Sergii Volchenko
Associate III

main.c

extern void touchgfx_signalVSyncTimer(void);
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
    if (htim->Instance == TIM13) {
        touchgfx_signalVSyncTimer();
    }
}

TouchGFXHAL.cpp

extern "C" void touchgfx_signalVSyncTimer(void)
{
    HAL::getInstance()->vSync();
    OSWrappers::signalVSync();
}

timer setup

static void MX_TIM13_Init(void)
{
 
  /* USER CODE BEGIN TIM13_Init 0 */
 
  /* USER CODE END TIM13_Init 0 */
 
  /* USER CODE BEGIN TIM13_Init 1 */
 
  /* USER CODE END TIM13_Init 1 */
  htim13.Instance = TIM13;
  htim13.Init.Prescaler = 47999;
  htim13.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim13.Init.Period = 30;
  htim13.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  htim13.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
  if (HAL_TIM_Base_Init(&htim13) != HAL_OK)
  {
    Error_Handler();
  }
  /* USER CODE BEGIN TIM13_Init 2 */
    HAL_TIM_Base_Start_IT(&htim13);
  /* USER CODE END TIM13_Init 2 */
 
}

 Stacktrace on pause

0693W000007C6MZQA0.png 

Place breakpoint in

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
    if (htim->Instance == TIM13) {
        touchgfx_signalVSyncTimer();
    }
}

check period of call and start with longer periods. You need time to render full one frame.

When your display provide TE use it instead timer...