cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX code enters hard fault after code generation with CubeMX

btyilmaz
Associate II

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];

11 REPLIES 11
Yoann KLEIN
ST Employee

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 KLEIN
ST Software Developer | TouchGFX
btyilmaz
Associate II

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 III

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
Associate II

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 II

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

Hello,

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

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX
VAUDI
Associate II

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 II

Hi, Do you have succeed to reproduce the problem?

Thanks

PMerv.1
Associate II

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