2022-06-27 12:41 AM
Hi ! I'm currently working on a STM32H747-DISCO with TouchGFX to test and discover this graphic library.
My touchGFX app is only 2 screens with a button to go screen 1 or 2 with a slide animation.
But when I'm implementing an other task in FreeRTOS with a higher priority, TouchGFX freeze at some point when i'm changing screen. My goal was to see when the animations of the library would lag with an other task running on the M7.
Do you have any idea why the screen freeze ? It may be linked to the slide animation of screen.
Solved! Go to Solution.
2022-07-12 03:22 AM
But a loop in my higher priority task won't let the hand to the TouchGFX's task cause at the end of the loop my task will start again.
I'm may be missing something important here sorry :/, trying my best to understand.
2022-07-12 05:19 AM
with OS run under preemt topology, high pri CPU_BURNER task have more oppotunity to run than ToughGFX engine, sometimes will preemt ToughGFX to left it to wait, if you use osDelay() to suspend scheduler, making TouchGFX starved, even if TE signal arrived as usual and IT handler send msg to permit TouchGFX to render again, but It have little chance to run, so freeze happened. I don't really know what difference between osDelay() and for loops(use for loops will not suspend scheduler), maybe little diffrence... but I strongly feel higher pri and osDealy is the source of freeze problem. I never see codes use long time int as parameter of osDealy(), you can use this function but just delay a few ms, use timer if you want dealy more, I know you want make some stress on TouchGFX, but TouchGFX make right reaction. so keep heavy task lower pri and make TouchGFX engine higher pri may consider a good thought? I'm not sure about this ,my opinoin may be incorrect, wish someone can help you.
2022-07-12 07:54 AM
okay, thank you for this detailed answer.
2022-07-13 02:57 AM
Hi,
I can see in your .icf file that your using both external SDRAM (from frame buffers most probably) and external FLASH (for graphic assets I guess), moreover you are using a Cortex-M7 based MCU.
This kind of unexpected crash in this context is usually due to an incorrect MPU (Memory Protection Unit) configuration.
The ARM Cortex-M7 is performing some optimizations at runtime, including "speculative accesses" that can sometimes lead try and access memory addresses of memory that are not even physically connected which lead to an hardfault !...
The only way to prevent that is to use the MPU configuration to first disable all accesses to the full address range of external memories and then define an MPU region per connected memory.
Please see our dedicated video:
Arm documentation :
Arm Cortex-M7 Processor Technical Reference Manual
Best regards,
Nicolas
2022-07-21 01:29 AM
Hello,
Thanks you for your answer.
I checked the MPU configuration on STM32CubeMX, and it's activated for 5 regions with :
The symptoms mentioned in the video for the speculative accesses read lock are different than mines. Here only the Touchgfx Task freezed, the main loop with other task is still running and i can still use the debugger.
I don't know if MPU is the real issue here...
Best regards,
2022-07-22 07:59 AM
Hi,
I just worked again on this issue, so here is an update and a summary about my problem.
-> The problem :
I'm working on a STM32H747-DISCO with the graphic library TouchGFX. I'm only using the M7 core under FreeRTOS. I added an other task called "CPU_Burner" to stress the CPU with some calculation to see how the TouchGFX's task respond and if the lagging effect is acceptable at some degrees. Of course the CPU_Burner task got an higher priority than the TouchGFX one or it won't get impacted.
When I flash the card and set up my CPU burner at 30% of the total load for example, after swiching between the two screens 1, 2 or 3 times, the TouchGFX GUI task freezed. And it's impossible to get it run again. The other task got no problem and is still runing, only TouchGFX and the screen remains fixed.
-> What I have done so far :
Some people managed to solve a similar issue with the MCU reconfiguration, in
this ST forum :
https://community.st.com/s/question/0D53W00000e067WSAQ/ui-stuck-in-takeframebuffersemaphore
-> The only solution that I Found :
void HAL_DSI_TearingEffectCallback(DSI_HandleTypeDef* hdsi)
" if (!refreshRequested)
HAL::getInstance()->allowDMATransfers(); "
I made a simplier project with System View with with the same issue. You can download it and try my project to see the freeze by yourself.
Thanks again to all the people trying to solve this ! :)