2025-10-22 9:38 PM
Hi, I’m working with an STM32H7S78-DK board and I want to replace the current display with a new one that has a resolution of 480x272. I’d like to know if this is possible, and if so, what steps or considerations I need to follow to make it work properly. Any guidance on configuring the MCU, adjusting the display driver, or handling any hardware/software changes would be really helpful. Thanks!
2025-10-27 2:58 PM
Hello @Sanjay27 ,
I can suggest to look at our documentation where we explain how to setup a display.
2025-11-17 12:20 AM
Hello @Sanjay27 , any progress on configuring your screen?
2025-11-25 4:27 AM
I Configured the Display, but TouchGFX isn't working correctly. The button touches aren't registering properly; they react continuously even before I release them.
2025-12-04 3:04 AM
Hello @Sanjay27 ,
Could you check you I2C1 config? Because the sampleTouch function reads touch status from it (at least from our TBS)?You can read more about that in our documentation.
2025-12-15 4:39 AM
Hello @Osman SOYKURT
The Buttons are Reacts before release, see the Pictures and attached video files
2025-12-17 4:50 AM
Could you show us your STM32TouchController.cpp file ?
2025-12-17 10:06 PM - last edited on 2025-12-18 1:25 AM by Osman SOYKURT
Sure,
/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : STM32TouchController.cpp
******************************************************************************
* This file was created by TouchGFX Generator 4.26.0. This file is only
* generated once! Delete this file from your project and re-generate code
* using STM32CubeMX or change this file manually to update it.
******************************************************************************
* @attention
*
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* USER CODE BEGIN STM32TouchController */
#include <touchgfx/hal/HAL.hpp>
#include <touchgfx/hal/Types.hpp>
#include <STM32TouchController.hpp>
#include "main.h"
volatile bool doSampleTouch = false;
extern "C" I2C_HandleTypeDef hi2c1;
using namespace touchgfx;
extern "C"
{
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if (GPIO_Pin == TP_IRQ_Pin)
{
/* Communication with TS is done via I2C.
Often the sw requires ISRs (interrupt service routines) to be quick while communication
with I2C can be considered relatively long (depending on SW requirements).
Considering that the TS feature don't need immediate reaction,
it is suggested to use polling mode instead of EXTI mode,
in order to avoid blocking I2C communication on interrupt service routines */
/* Here an example of implementation is proposed which is a mix between pooling and exit mode:
On ISR a flag is set (exti5_received), the main loop polls on the flag rather then polling the TS;
Mcu communicates with TS only when the flag has been set by ISR. This is just an example:
the users should choose they strategy depending on their application needs.*/
doSampleTouch = true;
return;
}
}
}
void STM32TouchController::init()
{
/**
* Initialize touch controller and driver
*
*/
}
bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y)
{
uint8_t touches = 0;
uint8_t buf[6];
const uint16_t STATUS_REG = 0x814E;
const uint16_t TOUCH_POS_REG = 0x8150;
uint8_t ZERO = 0;
NVIC_DisableIRQ(TP_IRQ_EXTI_IRQn);
if (doSampleTouch)
{
HAL_I2C_Mem_Read(&hi2c1, 0xBA, STATUS_REG, 2, buf, 1, HAL_MAX_DELAY);
touches = (0x0F & buf[0]);
HAL_I2C_Mem_Write(&hi2c1, 0xBA, STATUS_REG, 2, &ZERO, 1, HAL_MAX_DELAY);
doSampleTouch = false;
if (touches > 0)
{
HAL_I2C_Mem_Read(&hi2c1, 0xBA, TOUCH_POS_REG, 2, buf, 4, HAL_MAX_DELAY);
x = buf[0] + (buf[1] << 8);
y = buf[2] + (buf[3] << 8);
}
}
NVIC_EnableIRQ(TP_IRQ_EXTI_IRQn);
return (touches > 0);
}
/* USER CODE END STM32TouchController */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
2025-12-18 1:34 AM
Ok, could you now check your TP_IRQ_Pin configuration on STM32CubeMX ?
You can also check you i2c configuration (I would suggest to make it similar to our current) :
2025-12-18 2:56 AM
My Configurations Still not working well