cancel
Showing results for 
Search instead for 
Did you mean: 

Using touchgfx without external RAM

ETale.1
Associate III

I designed a GUI on stm32f746 discovery board and programmed the board successfully and GUI worked perfectly, now I want to redesign the GUI and my programm to be able to use a custom board which doesn't have an external RAM

at first I disabled the MX_FMC_Init fuction but the display is black and nothing shows up, then I read the article below and followed the instruction but display went black again.

I'm a beginner and I would be very gratefull if anyone guides me how to config the CubeMX and touchgfx to work without external RAM.

https://support.touchgfx.com/docs/development/board-bring-up/how-to/03-display-internal

26 REPLIES 26

O now I get what you meant,

I made these changes you mentioned in touchGFXGeneratedHAL.cpp file, but the output is the same :(

extern uint16_t framebuffer[400*100*3];
void TouchGFXGeneratedHAL::initialize()
{
    HAL::initialize();
    registerEventListener(*(Application::getInstance()));
    registerTaskDelayFunction(&OSWrappers::taskDelay);
    setFrameRefreshStrategy(HAL::REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL);
    setFrameBufferStartAddresses((void*)framebuffer, (void*)0, (void*)0);

How you build your project? Because when in TouchGFX, then generated files is overwrited on each build. Your changes is removed.

I recommend use IDE . and you dont write where yuo place line in main?

HAL_LTDC_SetAddress(&hltdc, (uint32_t*)framebuffer, LTDC_LAYER_1);

As simple test add memset(framebuffer,55,4800); //this make some gray part on screen when buffer works.

Too i recomm use debuger and check if your code work and not halt in an hardfault...

Why 400*100*3 ?

VChan.2
Associate II

Hi @ETale.1​ 

May be it is now too late to post an answer

I was also looking to use Touchgfx without external RAM as my application has very minimal graphics. This post helped me a lot to poke at the right places

Here is what I did

  • Open Cube MX configurator
  • Change to single buffer and by allocation

  • This would update TouchGFXGeneratedHAL.cpp as described in here Framebuffer Strategies | TouchGFX Documentation
  • What they dont post is that there is another file TouchGFXHAL.cpp which is not generated and overrides whatever was changed in the base TouchGFXGeneratedHAL class
  • So, we need to comment out the following two lines in the TouchGFXHAL.cpp file below
void TouchGFXHAL::initialize()
{
    // Calling parent implementation of initialize().
    //
    // To overwrite the generated implementation, omit call to parent function
    // and implemented needed functionality here.
    // Please note, HAL::initialize() must be called to initialize the framework.
 
    TouchGFXGeneratedHAL::initialize();
// Commented out
    // setFrameBufferStartAddresses((void*)0xC0000000, (void*)0xC003FC00, (void*)0xC007F800);  //enable the animation storage to allow slide animations
    // lockDMAToFrontPorch(false);
    instrumentation.init();
    setMCUInstrumentation(&instrumentation);
    enableMCULoadCalculation(true);
}

  • Now, you have to modify the linker files and create a section named 'TouchGFX_Framebuffer' which is the name used by the code generator
  • Modify STM32F746NGHX_RAM.ld
MEMORY
{
  RAM                 (xrw)     : ORIGIN = 0x20000000,    LENGTH = 64K
  // frame buffer is 255k long in my case
  RAM_FRAME_BUFFER    (xrw)     : ORIGIN = 0x20001000,    LENGTH = 256K
  FLASH               (rx)      : ORIGIN = 0x8000000,     LENGTH = 1024K
}
 
// add at the end
    /*Added for frame buffer */
    .TouchGFX_Framebuffer : {
       __TouchGFX_Framebuffer_start = .;
       KEEP(*(.TouchGFX_Framebuffer))
       __TouchGFX_Framebuffer_end = .;
    } > RAM_FRAME_BUFFER
  • Clean and build

Thanks,

Vimal

BParh.1
Senior III

I am interested as well to know this. Would choosing partial framebuffer help in this case?

https://support.touchgfx.com/docs/development/scenarios/lowering-memory-usage-with-partial-framebuffer

Hi,

Could you maybe add in the "Idea zone" of this forum the demand of improvement of this article ? It makes sense to put a reminder that due to the hierarchy of the code the generated files can be overwritten by the user in the relevant files.

/Romain

0693W00000AMRWmQAP.jpgPartial is usable only when LCD have own memory framebuffer. And too partial cant use acceleration. And one example of custom 1280x480 LTDC layer 0 image in flash, 1024x320 layer 1 320kB (internal ram) TouchGFX framebuffer with alpha 150.

hi ETale.1

are you got any solution

i am also stuck in same problem