cancel
Showing results for 
Search instead for 
Did you mean: 

backPorchExited() hangs and never returns in tick() function ?

BDinh.1
Associate II

Hello,

I have STM32F4 discovery and trying to integrate TouchGFX with SPI TFT LCD. I implemented the necessary hooks specifically flushFrameBuffer() function.

However, my issue is that backPorchExited() never returns and hangs my touchgfx thread, eg:

 for (;;)
    {
        OSWrappers::waitForVSync();
        backPorchExited();
    }

backPorchExited() actually calls tick() function which belongs to libtouchgfx-float-abi-hard.a. I cannot step into library as no source is available and I do not know what it is doing.

My question is what could possibly hangs in tick() function. I found a hint that is it hangs after calling sampleTouch() function.

My second question is what function call is used to force touchgfx to render the full frame buffer. The reason I ask is when I force flushFrameBuffer in HAL initialize function, there is no valid data in framebuffer, it is supposed to be an image as generated in touchgfx designer. Someone here suggested this should work ?! What could be missing ?

void TouchGFXGeneratedHAL::initialize()
{
    HAL::initialize();
 
    registerEventListener(*(touchgfx::Application::getInstance()));
 
    setFrameBufferStartAddresses((void*)frameBuf, (void*)0, (void*)0);
    /*
     * Set whether the DMA transfers are locked to the TFT update cycle. If
     * locked, DMA transfer will not begin until the TFT controller has finished
     * updating the display. If not locked, DMA transfers will begin as soon as
     * possible. Default is true (DMA is locked with TFT).
     */
    lockDMAToFrontPorch(false);
 
 
    touchgfx::Rect r(0,0,240,320);
  flushFrameBuffer(r);
}

Best regards,

BD.

3 REPLIES 3
Alexandre RENOUX
Principal

Hello,

The function that tells you that rendering has been done and the new frame is available in the framebuffer is endFrame().

Are you using partial framebuffer ?

Also are you using any float or EasingEquations in your application ?

/Alexandre

Hi Alex,

My demo is pretty minimal so I did not use any floating point numbers or division operations. I am also not using partial framebuffer, as a matter of fact the STMF429 I am using is holding well at 98.51% RAM usage.

I created endFrame() function in my overrided ToughGFXHAL class and put a breakpoint in there but nop it never got hit. So are you saying there is no function to command touchGFX to redraw entire framebuffer ?

My speculative would be the tick() function is what does it all, but something hangs in there and I cannot debug. My signalVSync() and waitForVSync() are working well and they just get or put something in the queue. What else is wrong. Please help !

Regards,

BD

Hello,

First I don't think you should call flushFrameBuffer() in the HAL initialize function as TouchGFX has not yet rendered anything so it's normal if there's no valid data.

Did you implement flushFramebuffer() or you stayed with the one from the HAL ? I believe that your problem can also be because your program doesn't actually send the frame to the display, therefore stopping the app. Indeed, the framework cannot render a new frame because the current one has not been sent. And this is not something that the framework will do automatically for SPI display. It something that has to be implemented by the user. Please have a look at https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-fmc#transferring-the-framebuffer

Also, the fact that the RAM is so filled is a bit worrying to me but it might be completely fine.

/Alexandre