2020-04-17 12:44 PM
I've created a simple project to interface a STM32L4R91-DISCO with a TFT using a SPI interface. I've attempted to follow the TouchGFX tutorial but thus far have been unsuccessful in getting the TouchGFX library to render anything.
I have a task that sits in a loop, periodically calling OSWrappers::signalVSync(). This appears to work as the vsync_queue fills up. However, in my separate task which is running the ToughGFX loop, the call to OSWrappers::waitForVsync never returns. This mean the frames don't get rendered and flushed to the display.
Any suggestions for getting this running would be greatly appreciated!
I'm using STM32CubeIDE 1.3.1 with TouchGFX 4.13.0.
2020-04-20 06:51 AM
How did you create the project? Are you entering the TouchGFX main event loop ( HAL::taskEntry() )? If not then nothing will take elements off the vsync queue (And, as far as our OSWrappers are concerned, the queue is of length 1).
/Martin
2020-04-20 07:00 AM
Are you hitting a breakpoint in OSWrappers::waitForVsync() - You say it never returns but it's not clear to me if you mean that the code is actually being executed.
/Martin
2020-04-20 03:19 PM
Martin,
I created the project in CubeIDE and used the TouchGFX Generator. My project is in C so I created "gfxwrappers.h/cpp" to translate the necessary functions. Here are my two tasks:
void start_main_task(void *argument)
{
#include "gfxwrappers.h"
for(;;)
{
vTaskDelay(pdMS_TO_TICKS(100));
oswrappers_signalVSync();
}
}
void start_gui_task(void *argument)
{
/* Infinite loop */
MX_TouchGFX_Process();
}
Inside OSWrappers::waitForVsync() there are two calls to osMessageQueueGet(). The first one, intended to clear the queue, returns as expected but the second call blocks forever. I've used breakpoints to confirm this. I also have a breakpoint inside TouchGFXGeneratedHAL::flushFrameBuffer and it is never reached.
The gui_task seems to be stuck at touchgfx::HAL::lockFrameBuffer(). Unfortunately, the debugger says there is "no source available" for any of the calls after touchgfx::HAL::backPorchExited() so I don't have much visibility into what's happening beyond that.
2020-04-20 05:14 PM
Please show me your OSWrappers
2020-04-21 06:01 AM
2020-04-21 06:02 AM
2020-04-21 06:02 AM
2020-04-27 03:39 AM
Hi @ebray,
Please remove the call to acquire in initialize and get back to me.
/Martin
2020-04-27 04:08 AM
Also, i'd suggest driving TouchGFX not from another thread controlled by a scheduler, but from an actual signal from display, controller or hardware timer.
/Martin