Skip to main content
btyilmaz
Associate
Sep 26, 2022 5:47 AM UTC
Question

TouchGFX code enters hard fault after code generation with CubeMX

Hi,

I am currently working in a project with TouchGFX. I am using STM32H757 evaluation board. I created a simple GUI to learn the basics of TouchGFX, when i debug the code after generating the code in TouchGFX designer there is no problem i can see the gui on the screen.

However, when i add a functionality (GPIO and USART) in the CubeMX screen and generate the code, debug process is slowed down (it takes around 2-3 minutes) and code enters hard fault at MX_TouchGFX_Init.

I stepped over each line and found that code enters hard fault at setLanguage function inside the Texts.cpp. Exactly the following line causes a hard fault. I didn't change any settings in the CubeMX screen (same settings for LTDC, TouchGFX and FreeRTOS), just added a GPIO function.

If anyone can help me how to solve this issue i would appreciate it. I am a beginner at TouchGFX, so any guideline would be really helpful to me.

currentLanguageTypedText = typedTextDatabaseArray[id];

This topic has been closed for replies.

11 replies

Yoann KLEIN
ST Employee
Sep 26, 2022 8:13 AM UTC

Hello @Batuhan Yılmaz​ ,

Which version of TouchGFX are you using ?

Did you remember to generate code in both TouchGFXDesigner and CubeMX ?

What are you trying to do with GPIO and USART ?

Thanks for the info,

/Yoann

Yoann KLEINST Software Developer | TouchGFX
btyilmaz
btyilmazAuthor
Associate
Sep 26, 2022 9:33 AM UTC

TouchGFX version is 4.20. I generated the code first in the TouchGFX designer. After adding GPIO pins to control some LEDs in the CubeMX and generating the code, then code enters hard fault. I tried to remove USART and GPIO pins, but the result is same.

wired
Senior II
Sep 27, 2022 7:33 PM UTC

Are you sure you didn't change the GUI and forget to flash the external asset (QSPI) memory? I only ask this because it happens frequently.

btyilmaz
btyilmazAuthor
Associate
Sep 28, 2022 4:39 AM UTC

I checked it but i still get the same error. However, i solved the problem by using another computer. Weird thing is that it worked on a different computer with the same versions of both TouchGFX and CubeMX. I will check the differences between two computers and post an update if i find anything.

Thank you for your answers

VAUDI
Associate
Feb 2, 2023 10:50 AM UTC

Hello,

I have probably the same problem, I found some thread about it but any of them resolved it.

At the beginning everything works well until I had Uart and GPIO with Stm32CubeMx. I tried to remove them but not better. I also tried to start a new TouchGfx project with only TextAera but anything better. And I tried with the stm32f746-Disco and Demo 1 and I have the same problem.

I throwing a hard fault error after the, Texts::setLanguage(0); currentLanguageTypedText = typedTextDatabaseArray[id];

My setup :

IAR 8.50.1

stm32f746-Disco

TouchGfx 4.21.1

Cube MX version v6.7.0

Do you have a solution?

Thanks

Yoann KLEIN
ST Employee
Feb 2, 2023 11:30 AM UTC

Hello,

Can you share your project so we can try to see where the problem comes from ?

/Yoann

Yoann KLEINST Software Developer | TouchGFX
VAUDI
Associate
Feb 2, 2023 12:28 PM UTC

For sure : Here it is the demo1 project with my setup, I have the same problem with it. I'm using IAR 8.50.1. Demo files were ok before I generated my config with GPIO and Uart on CubeMX.

VAUDI
Associate
Feb 15, 2023 2:34 PM UTC

Hi, Do you have succeed to reproduce the problem?

Thanks

PMerv.1
Associate
Feb 15, 2023 7:41 PM UTC

Hi, I think, I have the same problem. TouchGFX 4.21.1 and CubeMX IDE 1.11.2 - when I create GUI in TouchGFX, then Generate code and open project in CubeIDE, build all content, load to board (STM32H745i-DISCO) and it's working. But then, I open *.IOC from CubeIDE Project Explorer window, switch on some GPIO's and USART3 and affter pressing CTRL+S it starts to generate code. After a few seconds the CubeIDE was crashed without any message or error notice. On another computer it's working normaly (only I'm not able to use USART3 due "undefined reference to `HAL_UART_Init' " error, but this is another problem already..)

Edit: issue catched on video: https://k00.fr/vtvoil4d

Romain DIELEMAN
ST Employee
Feb 16, 2023 1:27 AM UTC

I recommend to not open the ioc file in STM32CubeIDE and to open it instead directly in STM32CubeMX :grinning_face_with_sweat: The process will be smoother in my opinion, I find it laggy with stm32CubeIDE which is why I never do it that way even though I have never experienced such a bug.

/Romain

PMerv.1
Associate
Feb 16, 2023 7:43 AM UTC

Romain thanks, it seems, this workaround, you've mentioned above, is working well :)