TouchGFX with SPI TFT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
SPI
-
STM32L4 Series
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-20 6: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-20 7: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-20 3: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-20 5:14 PM
Please show me your OSWrappers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-21 6:01 AM
I've attached the OSWrappers.cpp that was generated by the tools . My gfxwrappers files are also attached which just provides a simple extern helper to allow me to call signalVSync() from C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-21 6:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-21 6:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-27 3:39 AM
Hi @ebray​,
Please remove the call to acquire in initialize and get back to me.
/Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-27 4: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
