cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX: advanceFrameBufferToRect() undefined reference

Sandro_K
Associate

Hello,

I have a STM32F777 with ST7789 Display controller over SPI.

To write the Framebuffer i have the following code:

 

void TouchGFXHAL::flushFrameBuffer(const touchgfx::Rect& rect)
{
    // Get Framebuffer Address
    uint8_t* frameBufferAddress = (uint8_t*)HAL::lockFrameBuffer();

    // Calc start address
    uint8_t* fbPtr = advanceFrameBufferToRect(frameBufferAddress, rect

    // Set window
    DisplaySetWindow(rect.x, rect.y, rect.width, rect.height);

    // Start DMA Transfer
    DisplaySendDataDMA(fbPtr, rect.width * rect.height * 2);  

    // Wait for DMA Transfer end
    if (osSemaphoreWait(DisplayTransferSemHandle, osWaitForever) == pdTRUE)
    {
    	HAL::unlockFrameBuffer();
        HAL::flushFrameBuffer(rect);  
    }
}

 

I can't build the code because the function advanceFrameBufferToRect() is defined as inline but without implementation in the header. The implementation in the source file is not accesible with the inline statement.

How can I fix this error? Is the code above correct?

Thanks for your reply!

 

3 REPLIES 3
GaetanGodart
ST Employee

Hello @Sandro_K ,

 

Have you looked at the TouchGFX SPI guide ?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Sandro_K
Associate

Thanks for your reply. Yes, i have looked at the SPI guide but there ist not much information.

In the TouchGFXHAL.cpp file at function flushFrameBuffer(...)  there is some information:

    // Calling parent implementation of flushFrameBuffer(const touchgfx::Rect& rect).
    //
    // To overwrite the generated implementation, omit the call to the parent function
    // and implement the needed functionality here.
    // Please note, HAL::flushFrameBuffer(const touchgfx::Rect& rect) must
    // be called to notify the touchgfx framework that flush has been performed.
    // To calculate the start address of rect,
    // use advanceFrameBufferToRect(uint8_t* fbPtr, const touchgfx::Rect& rect)
    // defined in TouchGFXGeneratedHAL.cpp

I tried to implement these instructions. So I need the function advanceFrameBufferToRect(). 

And there comes the point. The function prototype is specified as inline function in the header file of the library. The implementation is in the .cpp file but this is not working because the function is defined as inline. I think there is a bug in the library. 

Either the function is implemented directly as an inline function in the header or the keyword inline is omitted.

Well you can check what you have in TouchGFXGeneratedHAL.hpp.
Personally, on the STM32C071 TBS which use an SPI display I have that:

GaetanGodart_0-1740498288293.png

The inline is not omitted and the function is not implemented in the hpp.

What do you have in your project?

 

Here is an example of implementation of flushFrameBuffer.

 

In the code you shared, on line 7, why is there no closing parenthesis and semicolon?

uint8_t* fbPtr = advanceFrameBufferToRect(frameBufferAddress, rect

 

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)