Skip to main content
Senior
July 25, 2023
Question

TouchGFX calls HAL_Delay in ISR

  • July 25, 2023
  • 3 replies
  • 1619 views

Hi,

In TouchGFXHAL.cpp, HAL_DSI_EndOfRefreshCallback() contains HAL_Delay(). Meantime it is called from HAL_DSI_IRQHandler(). Can it be avoided?

The code is generated with TouchGFX Designer 4.22.0 for STM32H747I-DISCO.

The generated file is attached.

This topic has been closed for replies.

3 replies

ST Employee
July 25, 2023

Hello @ERROR ,

I hope I have understood your question correctly. HAL_DSI_EndOfRefreshCallback function is used to send the frame buffer to the DSI display. If you remove the HAL_Delay(), you cannot get the correct frame buffer displayed. Therefore, the answer would be no it cannot be avoided.

If you have more questions, don't hesitate to ask

Mohammad MORADIST Software Developer | TouchGFX
Graduate II
July 26, 2023

Hello all

Since this seems to be just callback from DSI, I think that using blocking HAL delay on the interrupt handler can be easily avoided. Just set some tick- handler for example which handles the delayed update start. Maybe somebody from TGFX programming team could take a look ?

Br J.T

ERRORAuthor
Senior
July 26, 2023

Hi Mohammad,

Thank you for your fast and concrete response!

This is very very unusual engineering practice - adding delays in ISR.

1. It causes side effects for lower priority ISRs and RTOS's tasks, especially sensitive in time critical applications.

2. TouchGFX can be declined as not compliant to coding rules in some companies in industrial and automotive industries. It can even lead to switching to another MCU manufacturer, supporting another GUI.

Since actually I have no more questions, feel free to close this topic.