Skip to main content
Korry
Associate III
July 27, 2020
Question

What possible error would cause the return value of getBlockForTransfer to return 0

  • July 27, 2020
  • 1 reply
  • 1998 views

Hi

​I had a problem with this getBlockForTransfer function that always returns 0 when I use FSMC + partial frame buffer.

The main changes are in the TouchGFXHAL file.

Below is my entire project, and any help would be appreciated.

Thank you very much for your generosity.

This topic has been closed for replies.

1 reply

Alexandre RENOUX
Visitor II
August 17, 2020

Hello,

What is your current status ?

/Alexandre

Korry
KorryAuthor
Associate III
August 18, 2020

I'm glad you could answer my questions。

I can now display a certain color all over the screen, but that's not what I want.

Now it's the pixels. I don't know how the pixels will be stored after GFX is rendered.I notice that a pointer to Uint8_t is always returned.I use RGB565 format, should I be R<<11 | G <<5 | B  thus forms a complete RGB pixel, and then transmits the pixel to my screen through FSMC.

Thank you very much.

/Korry

Alexandre RENOUX
Visitor II
August 18, 2020

It is probably unrelated but in your TouchGFXGeneratedHAL.cpp, in the HAL_TIM_PeriodElapsedCallback function you don't need to call swapFrameBuffers.

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
 if(htim->Instance == TIM2)
 {
 HAL::getInstance()->vSync();
 OSWrappers::signalVSync();
 HAL::getInstance()->swapFrameBuffers(); //should be removed
 }
	if (htim->Instance == TIM1) 
	{
		HAL_IncTick();
	}
}

As for how to write pixels in the framebuffer : https://support.touchgfx.com/docs/development/board-bring-up/how-to/03-display-internal/#checking-the-display-colors

The Application Template STM32L496-DISCO uses FSMC interface and a new Application template using SPI and Partial Framebuffer is being created and will be available in September, so you can refer to at least the L496 for now and the new one soon.

"I can now display a certain color all over the screen, but that's not what I want." -> please elaborate

/Alexandre