2019-05-03 12:09 AM
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 :
Please share your suggestions about my problem with me.
Thanks in advance.
Solved! Go to Solution.
2022-08-15 08:10 AM
Martin,
I didn't have time to further investigate the issue, however QSPI is initialized before TGFX. I have all assets including fonts in external memory. I believe RPipi is correct that something is being messed up as widgets are added removed. All worked well - including texts in external flash- fo certain point (lets say 8 text area's) Adding one more caused HT. Removing added area didn't cure the issue. Only removing all text area's got rid of HT. For now i left text in internal flash. Will have closer look at it when time allows.
2022-08-16 05:29 AM
Okay, let me know. You can just post to this thread and i'll try to help.
2023-09-18 11:53 PM
I have the same exact behavior. All assets work fine in External QSPI memory. Bitmaps, fonts, etc. But as soon as I add a single TextArea widget, I get a HardFault. When removing the QSPI directive from the linker, and placing text in the internal flash, all works. I'm really at a loss on this one and haven't seen much in the way of helpful hints.
2023-10-13 12:04 AM
2024-07-10 03:49 AM
I was facing that specific issue due to a stack overflow, so make sure you allocated enough memory for the stack