2025-01-05 06:19 AM
Im new to TouchGFX. Im goung to create my first demostration on a custom setup.
I got a NUCLEO-L4A6ZG board with a display shield using an MCU interface.
This works:
I have no touch controller on the hardware, expecting to use hardware buttons.
This should have been the hard part. But now I have to get TouchGFX working. I got:
In the project browser I can see code generated for the screens and the buttons on the screens. And I can verify that the code is actually in the elf-file and flashed to the board.
But:
So here is the questions:
Please give some hints. Thanks in advance.
Regards
Leonhardt
2025-01-05 11:03 AM
Optimaly start here Framebuffer Strategies | TouchGFX Documentation
and better is connect display to real peripheral bus . Bitbanging is last resort...
2025-01-06 12:55 AM
Hi
Framebuffer Strategies | TouchGFX Documentation does not help me. I believe that the configuration from CubeMX is done correctly.
From TouchGFXGeneratedHAL.cpp:
void TouchGFXGeneratedHAL::initialize()
{
HAL::initialize();
registerEventListener(*(Application::getInstance()));
setFrameBufferStartAddresses((void*)0x2002A800, (void*)0, (void*)0);
}
From TouchGFXGeneratedConfiguration.cpp:
Snippets:
#include <platform/driver/lcd/LCD16bpp.hpp>
static LCD16bpp display;
static TouchGFXHAL hal(dma, display, tc, 320, 240);
And from my display update task I call my display driver:
void StartDefaultTask(void *argument)
{
/* USER CODE BEGIN 5 */
memset((uint8_t *)0x2002A800, 0xFF, 320*240*2);
for(;;)
{
ili9341_WriteDisplayBuffer((uint16_t*)0x2002A800);
osDelay(100);
}
/* USER CODE END 5 */
}
Changing the display buffer by the debugger manually, changes the image on the display as it should.
Here is my configuration from CubeMX:
So I believe that there is something in TouchGFX that is not setup correctly. But I cannot locate the problem as the TouchGFX is a blackbox.
Kasper
2025-01-21 04:10 AM
Hello LeonHardt.
Have you filled out the functions in the TouchGFXHAL.cpp file? You e.g. need to call the touchgfxSignalVSync() function every time you want TouchGFX to render a new frame (tick). This is usually done in a LCD Tearing Effect signal interrupt. You can see how it is done in the board setups we deliver in TouchGFX Designer, e.g. for the NUCLEO-C71RB. Hope this can help you forward.
Best regards, Peter
2025-01-21 04:29 AM - edited 2025-01-21 04:58 AM
I would recommend you to create a bitmap and then create a header file from that bitmap.
Then add it to your project, and check if you are able to see it on LTDC.
Basically, after starting your FMC, on the LTCD init() in the FBStartAdress you instead of pointing to:
pLayerCfg.FBStartAdress = 0xC0000000;
Do something like:
pLayerCfg.FBStartAdress = (uint32_t)bit_map_name;
Where bit_map_name is the array where the bitmap is placed.
If your hardware is able to show this, then you can continue debugging.
Hope this helps.
2025-01-26 03:36 AM
Hi Peter
The touchgfxSignalVSync() does not exists in my project for some reson. Maybe because I use "Custom interface" or using FreeRTOS. I therefore copied the function from a demo project and placed it in TouchGFXHAL.cpp. Project compiles. Now display buffer is filled correctly.
Thanks
2025-01-26 04:38 AM
Yes for custom your code require implement it.