2025-02-24 2:11 AM - edited 2025-02-24 2:13 AM
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!
2025-02-25 4:57 AM
Hello @Sandro_K ,
Have you looked at the TouchGFX SPI guide ?
Regards,
2025-02-25 5:38 AM
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.
2025-02-25 7:48 AM
Well you can check what you have in TouchGFXGeneratedHAL.hpp.
Personally, on the STM32C071 TBS which use an SPI display I have that:
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,