2022-03-22 07:12 AM
Form TouchGFX Designer 4.18.1 I created a simple application.
I imported the project into the STM32CubeIDE (1.9) and added support for FreeRTOS.
I have selected TIM7 as the timebase source.
After calling TouchGFXGeneratedHAL::initialize() in file TouchGFXHAL.cpp the TIM7 interrupt is no longer called!
I also tried with other timers: same result.
What could be the problem ?
I noticed the problem because I had put a Hal_Delay after switching on the Display which never returned.
My hardware is NUCLEO-G071RE and X-NUCLEO-GFX01M1
2022-03-22 09:41 AM
Seems you dont setup interrupt priorities properly.
2022-03-23 12:24 AM
The timebase timer interrupt priority is set to 0 with "Uses FreeRTOS function" disabled.
Is not correct?
2022-03-23 06:32 AM
Show all interrupts config.
2022-03-23 06:42 AM
2022-03-23 08:04 AM
Break in debuger and check where code stuck, i mean in hard fault handler...
2022-03-23 08:14 AM
The code stuck in HAL_Delay called in MB1642BDisplayDriver_DisplayOn after TouchGFXGeneratedHAL::initialize().
If I remove the HAL_Delay the code correctly run.
If I add an HAL_Delay before TouchGFXGeneratedHAL::initialize() the code not stuck.
I can share the source code if it helps
2022-03-23 08:31 AM
Normal delay func is in hal weak , then maybe you try write own overide,
in F4 for example
__weak void HAL_Delay(uint32_t Delay)
{
uint32_t tickstart = HAL_GetTick();
uint32_t wait = Delay;
/* Add a freq to guarantee minimum wait */
if (wait < HAL_MAX_DELAY)
{
wait += (uint32_t)(uwTickFreq);
}
while((HAL_GetTick() - tickstart) < wait)
{
}
}
__weak void HAL_IncTick(void)
{
uwTick += uwTickFreq;
}
2022-03-23 09:03 AM
Sorry @MM..1, but I don't understand what you are telling me :smiling_face_with_smiling_eyes:
Do you think the interrupt configuration you asked me is correct ?
Do you think that the timebase interrupt priority at 4 (despite I have set 0 in the CubeMX) is correct ?
What I see is, despite the timebae configuration does not change (checked in debug), that its interrupt no longer fired after the call to the TouchGFX library function (TouchGFXGeneratedHAL::initialize())
As previously written if I remove this call the interrupt will fire correctly.
Unfortunately it's a library function and I can't debug it.
2022-03-23 10:10 AM
Sorry i reread your "simple" My hardware is NUCLEO-G071RE and X-NUCLEO-GFX01M1
This use custom settings (not simple) in TouchGFX and seems use too reconfig in touchGFX hal layer.
Check registers for enabled interrupts, config TIM7 and compare before and after (TouchGFXGeneratedHAL::initialize())
I dont understand Do you think that the timebase interrupt priority at 4, .... priority need be 0...