cancel
Showing results for 
Search instead for 
Did you mean: 

HardFaults when using TouchGFX TextArea::setTypedText()

JIN3473
Associate III

Hello everyone,

I am experiencing a HardFault on an STM32F746G-DISCO board while working with TouchGFX. The issue seems to be related to code automatically generated by the TouchGFX Generator in STM32CubeMX.

The fault occurs when my application tries to set text on a TextArea widget. The debugger stops inside the HardFault_Handler, and the call stack clearly indicates the issue originates from the setTypedText() function chain.

Here is the relevant part of the call stack from the debugger:

  • HardFault_Handler()

  • touchgfx::TextArea::getTextWidth()

  • touchgfx::TextArea::resizeToCurrentText()

  • touchgfx::TextArea::setTypedText()

  • ... (my application code, which was generated by the generator)

It seems that a call to setTypedText(), which is part of the generated code, is leading to the HardFault. I suspect this might be caused by an uninitialized TextArea object or a configuration issue within the generator, but I'm having trouble pinpointing the exact cause.

Has anyone encountered a similar issue with code generated by the TouchGFX Generator? Any guidance on what to investigate would be greatly appreciated.

Thank you.

5 REPLIES 5
JIN3473
Associate III

JIN3473_1-1760687533598.pngJIN3473_2-1760687557988.png

I forgot to attach the screenshot in my original post. Here it is

JohanAstrup
ST Employee

Hello @JIN3473.

Are you using the TBS available in TouchGFX Designer, and if so, are you using the latest version (v3.0.27)?

JohanAstrup_0-1760689194248.png

What board revision do you have? You should be able to check this on the sticker located on the back of the board.

Best regards,
Johan

Hello, thank you for your reply.

I am not using the official ST Discovery Kit. Instead, I am working with a custom board based on the STM32F746MGH6 MCU.

My LCD resolution is also different; it is 480x128. Therefore, I am not using the TBS (Target Board Setup) provided by the TouchGFX Designer.

JohanAstrup
ST Employee

OK, sorry, my mistake. I was just confused about you experiencing a hard fault on an STM32F746G-DISCO.

Have you used the TBS as a reference for your board setup?
Where are texts and fonts stored - in internal or external memory? If external, which type of external memory are you using?
Do you only experience issues with text? Can you e.g. draw images and boxes without any issues?

Best regards,
Johan

 

JIN3473_0-1760690645728.png

 

 

Hello Yohan, thank you for the detailed questions.

  • Regarding TBS: I did not use the TBS as a reference since I'm working with a custom board.

  • Text/Font Storage Location: I've attached a screenshot of my Text Configuration in TouchGFX Designer. With the 'Mapped storage format' option enabled, my understanding is that the font and text data are intended to be stored in the memory-mapped external QSPI flash. However, if you could provide a method to verify that this configuration correctly places the data into the external flash, I would be very grateful.

  • External Memory Types: Here are the external memory parts I am using:

    • SDRAM: MT48LC4M32B2B5-6A_IT

    • QSPI-FLASH: IS25LP128F-JLLE

    • For your information, I have also created and am using a custom loader file (.stldr) to program the external flash.

  • Issues with other widgets (Images/Boxes): The application goes into the HardFault_Handler immediately during the setTypedText call chain upon startup, so nothing is ever displayed on the LCD. Because of this, I haven't been able to verify if images or boxes can be drawn correctly. However, the call stack makes it clear that the fault occurs during the text handling process.

Thank you.