Issue with touchpad of Stm32f429 Discovery board

Hello all,
Recently, I ported LVGL ver9.0.0 to the STM32f429Discovery kit. I ran the "lv_example_calendar_1() " and noticed the touch is not calibrated. Because when I clicked on a place out of the calendar box specific day highlighted it. In the following picture, you can see I did click on the top right and day 30 is highlighted. I am using STM32CubeIDE as well.
Also, I have two warnings also:

  1. I think you need to flip touch vertically.
  2. about warnings. Can you show code in this lines?

One error is due to the function touchpad_read, as it returns bool, while callback doesn’t accept any return type.
I fixed this by changing the return type to void, because I don’t see if return value has some usage, as it is always returning false.
For GCC compiler this is not a problem, as it just generates warning, but when I ported the same code for IAR compiler, I received 100 of warnings and for this piece of code I received error (which without fixing this I can’t even compile).
Out of context when I ported my code from STM32CubeIDE to IAR, it doesn’t work and I get Hard-Fault error, more information here, but with STM32CubeIDE everything works well
Hard Fault Error when executing the function lv_timer_handler - Get started - LVGL Forum

Hello spider_vc,
How to flip the touch vertically?
Here is related to touch:

The following related to the warning for memset :slight_smile:

The 'F429 Disco is manufactured for almost a decade an during that time it came in several variants, some of them have touchscreen flipped, some not.


For future case don’t post screen shot instead use CODE format.
change you touchpad_read function declaration to:

static void touchpad_read(lv_indev_drv_t * drv, lv_indev_data_t *data)

second. How is my_fb declared?

and finally. when reading X/Y coords from touchscreen make flip of Y coordinate.

y = TFT_VER_RES - y;

Hello spider_vc
Thank you for your information. I will put the code instead of a screenshot in the future.
By flipping the Y coordinate it did work. Thank you very much for your valuable information.
you asked about my_fb declaration, it declares as below, I did not change its declaration:
#if TFT_EXT_FB != 0
SDRAM_HandleTypeDef hsdram;
FMC_SDRAM_TimingTypeDef SDRAM_Timing;
FMC_SDRAM_CommandTypeDef command;
static __IO uint16_t * my_fb = (__IO uint16_t*) (SDRAM_BANK_ADDR);
static uint16_t my_fb[TFT_HOR_RES * TFT_VER_RES];

I am not using external buffer so I disabled it via TFT_EXT_FB in the “tft.h” file I copied as the follow:
#define TFT_EXT_FB 0
So the my_fb is declared like this:
static uint16_t my_fb[TFT_HOR_RES * TFT_VER_RES];

thi simples way to fix warning is :

memset(my_fb, 0x1234, sizeof(my_fb));

but it will work only for TFT_EXT_FB == 0
else and universal way is:

memset(my_fb, 0x1234, sizeof(my_fb[0])*TFT_HOR_RES * TFT_VER_RES);

Hello spider_vc
Sorry for the late reply. Now all are Ok and working with no errors and no warnings. Thank you very much for your information and help!

1 Like