2021-03-18 01:09 PM
Hi,
I'm using keil MDK V5.34 and touchGFX V 4.16.1 , I made a minimal project with these settings using LTDC, and a simple default project, But the problem is that when the MX_TouchGFX_Process is called, the MCU crashes! what's going on wrong?
any Ideas
[url=https://ibb.co/MV62hsP][img]https://i.ibb.co/swHmP2s/LCD1.png[/img][/url]
[url=https://ibb.co/Vgxpn4x][img]https://i.ibb.co/Lxrhj7r/LCD2.png[/img][/url]
[url=https://ibb.co/0cMt5rk][img]https://i.ibb.co/KXqwnWY/LCD3.png[/img][/url]
[url=https://ibb.co/VVrYCBb][img]https://i.ibb.co/6YV0tsG/LCD4.png[/img][/url]
[url=https://ibb.co/ypQnF3j][img]https://i.ibb.co/cwrchmn/LCD5.png[/img][/url]
[url=https://ibb.co/82GP2Qs][img]https://i.ibb.co/DkmwkjW/LCD6.png[/img][/url]
and here is the default code,
[code]
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Configure the peripherals common clocks */
PeriphCommonClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
MX_I2C1_Init();
MX_I2S1_Init();
MX_LTDC_Init();
MX_SPI4_Init();
MX_TIM14_Init();
MX_UART8_Init();
MX_USART2_UART_Init();
MX_USB_OTG_FS_PCD_Init();
MX_USB_OTG_HS_HCD_Init();
MX_DMA2D_Init();
MX_CRC_Init();
MX_TouchGFX_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
MX_TouchGFX_Process();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
[/code]
What's going on wrong!
2021-03-20 04:02 PM
Dear Franck23 I have found the problem of touch and correct it, in a weird way, the touch data was like LCD data, But I had to change the coordinates like this in the code, so it would accept touch data as valid coordinates, my LCD is in portrait mode, so why should I change touch data?
*x = 320 - touchx;
*y = 480 - touchy;
Also I have another problem, I have made the screens to transition from one screen to the other one, But the transition almost happen instantly! why is this happening? I have measured my frame rate is 60Hz, and it has 16ms delay between each frame, How can I solve the transition speed? what might be wrong?
2021-03-21 09:45 AM
The position 0.0 on your touch screen depends on how your touchscreen is attached to your LCD.
Maybe another supplier of LCD will attach the touchscreen in another direction and the position 0 would become 320.
Touch Gfx doesn't know which way the touchscreen is attached, so it is the programmer's job (you) to adjust the coordonates. And this is what you have done.
For the screen transition, I have noticed the same problem, but I never had the time to check why it is happening.
Maybe someone else on the forum can help?
2021-03-21 02:09 PM
Franck23, thanks for the update, I have another problem too, when I use any dynamic text, the project crashes! I have used the digital clock widget, when I update the time, it would just crash! any Idea what's wrong?
2021-03-22 06:29 AM
I don't know what it can be.
What do you mean by crash?
Do you have the same problem if you update a text area?
2021-03-22 09:06 AM
I did some problems, I have increased the stack and heap size to 0x1000, now it can be updated.