cancel
Showing results for 
Search instead for 
Did you mean: 

How many frame buffers are selected in Demo project generated by TouchGFX designer.

Bala1
Associate II

I am using STM32L4R9 Evaluation board for my development.

When we generate a Demo Project from the TouchGFX Designer, how do we check that how many Frame buffers are used by default and how to check whether we are using any External RAM to store the Frame Buffer.

Regards,

Bala

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

@Bala​ ,

You can check the TouchGFXGeneratedHAL.cpp, specifically the setFrameBufferStartAddresses() - the arguments will tell you how many framebuffers you're using.

I can give you the answers for this board, though - It's:

One (since the display has GRAM) and Internal.

    setFrameBufferStartAddresses((void*)0x30000000, (void*)0, (void*)0);

/Martin

View solution in original post

7 REPLIES 7
MMoon.1
Associate II

Open up CubeMx project (IOC file):

for SDRAM check if fmc-sdram is configured

for buffering strategy check in additional software the configuration

Martin KJELDSEN
Chief III

@Bala​ ,

You can check the TouchGFXGeneratedHAL.cpp, specifically the setFrameBufferStartAddresses() - the arguments will tell you how many framebuffers you're using.

I can give you the answers for this board, though - It's:

One (since the display has GRAM) and Internal.

    setFrameBufferStartAddresses((void*)0x30000000, (void*)0, (void*)0);

/Martin

Hi @Martin KJELDSEN​,

Thank you so much for the details.

could you please give me details on below,

What is the GRAM size of the Display which is used in STM32L4RI Discovery kit ?

What is the minimum GRAM size required to use a 390x390 display with RGB888 ? and if display don't have GRAM can we use only single buffer for animation.

Thanks and Regards,

Bala

H,

Could you please give details on above.

Thanks and Regards,

Bala

​I don't know the size of the GRAM in the L4R9-DISCO - Large enough to hold one 24-bit per pixel framebuffer for the size of the display, at least (RGB888). Around 500kb.

You can always just use a single framebuffer in the SRAM of the MCU , regardless of what's on the display.

Hi @Martin KJELDSEN​ ,

Thanks for the details.

It's good if we can use single framebuffer, But does it impact the display performance while doing basic animations.

Thanks and Regards,

Bala

Using a single framebuffer can impact performance, for sure, because you're bound by the update of the display. e.g. you cannot update a line that's being transferred- BUT, we offer a strategy that allows the user to tell Touchgfx which line the display it's currently on, and then touchgfx will try to update the parts of the framebuffer that have already been transferred.

This strategy is already chosen if you select single framebuffer from the TouchGFX Generator. For the application templates, we already implemented this interface for the boards/displays that we support - But if you were using your own display you might have to implement these functions yourself. The singleframebuffer strategy where you follow the hsync of the display allows you to start drawing before reach the front porch of the display. 

hal.setFrameRefreshStrategy(HAL::REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL);

And you'd need to implement something we call getTFTCurrentLine() in your TouchGFX HAL. e.g for an F7 with LTDC (This version can be generated by TouchGFX Generator because of the LTDC):

uint16_t STM32F7HAL::getTFTCurrentLine()
{
    // This function only requires an implementation if single buffering
    // on LTDC display is being used (REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL).
 
    // The CPSR register (bits 15:0) specify current line of TFT controller.
    uint16_t curr = (uint16_t)(LTDC->CPSR & 0xffff);
    uint16_t backPorchY = (uint16_t)(LTDC->BPCR & 0x7FF) + 1;
 
    // The semantics of the getTFTCurrentLine() function is to return a value
    // in the range of 0-totalheight. If we are still in back porch area, return 0.
    if (curr < backPorchY)
    {
        return 0;
    }
    else
    {
        return curr - backPorchY;
    }
}

 /Martin