cancel
Showing results for 
Search instead for 
Did you mean: 

Using any type of text causes HardFault

HMehr.14
Associate II

Hello,

I followed this guide (https://touchgfx.zendesk.com/hc/en-us/articles/115002741432-Create-custom-Application-Template) to adding TouchGFX to my existing project.

I'm working with IAR 8.30.1 and tgfx 4.10.0 and STM32F429ZG and FreeRTOS V9.0.0 ( with `heap_4.c` as memory manager ).

Everything works well now, except texts. Every time I added components that contain text, Hard Fault occurs during redraw (*.invalidate()) it.

I added 

virtual void handleTickEvent() { container.invalidate(); }

to my ScreenView class to verifying DMA2D and LTDC configurations. All components work well. But existing just a text component causes HardFault.

By tracking `LR` and `PC`, I find out that HardFault occures in `TextProvider` class.

I think stack corrupted. Due to often times, `PC` is in the `DataSection`.

I increased the stack size of my GUI task and `configTOTAL_HEAP_SIZE` of FreeRTOS configuration, But results not changed. Is there any other stack size ( or heap size ) limitation?

Or, May I has been configured `BoardConfiguration.cpp`, `STM32F4DMA.cpp` or `STM32F4HAL.cpp` in a wrong way ?

For more details :

0690X000008BDbFQAW.png

Please share your suggestions about my problem with me.

Thanks in advance.

34 REPLIES 34
TTulw.1
Associate II

Hi, I have a similar problem. Any text added to TouchGFX designer causes the application to HardFault. Setting the Wildcard characters doesn't fix the issue.

This has not been a problem before, but after messing with wildcard fonts in designer I cannot revert to the before state. Even reverting the .touchgfx file to the state when it was working does not fix the issue.

If I remove text from Designer everything works. Is this a bug known by ST? Is there a fix ?

Thanks,

Tytus

 edit: same thing after upgrading to touchgfx designer 4.15 (in cubemx too).

RPipi.1
Associate II

I am having the same issue too. Generated project with TouchGFX 4.14. editing with CubeIDE.

It looks like the SingleUseId keeps incrementing even if I remove a text and add a new.

KSchu.3
Associate

I'm also having this same issue. I've tried putting the wildcard characters and character range with no luck. I even completely started my project over and ended up getting the same issue once I've added a bunch of the text back. I upgrading to V4.15 and it didn't get fixed.

RPipi.1
Associate II

Yes, Same here... once there is a bunch of the text there I get the issue. But even if I remove one it does not solve the issue once its happened.

TTulw.1
Associate II

Compiling the code through the TouchGFX Designer instead of cubeIDE fixed the issue for me.

There seems to be a problem with text and bitmaps when put to external flash if generated with cubeIDE - fonts give HardFault and bitmaps are not displayed correctly. This is not a case when only internal flash is used.

Hope this bug will be fixed.

RPipi.1
Associate II

It seems for me that the hard fault occurs in MVPApplication.hpp line 174.

Instruction: ScreenType* newScreen = new (&heap.screenStorage.at<ScreenType>(0)) ScreenType;

​TouchGFXX will placement new when a new screen becomes active. is new implemented for you? What kind of memory strategy are you using with your OS?

/Martin

It is happening on start up on that line, the hard fault.

My project is built on touchgfx 4.13 or 4.14 project with the template for STM32F746G DISCO.

I am using the STM32F746G-DISCO example from touchgfx.

/Robin

​Peculiar - it's working on my desk here. Which version of the Application template are you using? Which compiler?