cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Screen Lockup / Freezing

PFlor.2
Senior

I have encountered an issue on a project with the STM32H743 using FreeRTOS and TouchGFX v4.20.0.  Occasionally the screen will freeze up and is not resposive to touch activity.  I TouchGFX part seems to be frozen as we can view structure variables at runtime and see that counters placed in TouchGFX code are no longer increment, both in screens and in the Model::tick() function within Model.cpp...also flashing messages on the screen no longer change state.

All other parts of the application continue to run normally such as communications on 2 UARTs as well as activity from the touch aspects of the display (can see x/y changes from touch but TouchGFX doesn't respond).

ST support has suggested it could be speculative read access to external memory that has been known to cause this type of behavior but we have setup the MPU to prevent this as recommended.  MPU configuration below, we are using external FMC SDRAM (32MB) at 0xC0000000 and external NORFlash (8MB) via QSPI at 0x90000000.  Using external SDRAM for frame buffers at 0xC0000000 and 0xC0080000.

Any suggestions of what else could be causing this or mistakes with my MPU configuration would be appreciated.

/* MPU Configuration */

 

void MPU_Config(void)

{

  MPU_Region_InitTypeDef MPU_InitStruct = {0};

 

  /* Disables the MPU */

  HAL_MPU_Disable();

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Enable = MPU_REGION_ENABLE;

  MPU_InitStruct.Number = MPU_REGION_NUMBER0;

  MPU_InitStruct.BaseAddress = 0x0;

  MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;

  MPU_InitStruct.SubRegionDisable = 0x87;

  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

  MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;

  MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;

  MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;

  MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;

  MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Number = MPU_REGION_NUMBER1;

  MPU_InitStruct.BaseAddress = 0xA0000000;

  MPU_InitStruct.Size = MPU_REGION_SIZE_8KB;

  MPU_InitStruct.SubRegionDisable = 0x0;

  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;

  MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;

  MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Number = MPU_REGION_NUMBER2;

  MPU_InitStruct.BaseAddress = 0x90000000;

  MPU_InitStruct.Size = MPU_REGION_SIZE_8MB;

  MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Number = MPU_REGION_NUMBER3;

  MPU_InitStruct.BaseAddress = 0xC0000000;

  MPU_InitStruct.Size = MPU_REGION_SIZE_32MB;

  MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Number = MPU_REGION_NUMBER4;

  MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;

  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;

  MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;

  MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;

  MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Number = MPU_REGION_NUMBER5;

  MPU_InitStruct.BaseAddress = 0xC0080000;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

  /** Initializes and configures the Region and the memory to be protected

  */

  MPU_InitStruct.Number = MPU_REGION_NUMBER6;

  MPU_InitStruct.BaseAddress = 0x20020000;

  MPU_InitStruct.Size = MPU_REGION_SIZE_1KB;

  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;

  MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;

 

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

  /* Enables the MPU */

  HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

 

 

1 REPLY 1

Hello @PFlor.2 ,

Is it possible for you to give some information about your project (application) as well? Are you using any functions in Model::tick() ? When does the freeze usually happen? Is there a specific trigger for it? 

Thank you

Mohammad MORADI
ST Software Developer | TouchGFX