Timebase no longer works after the TouchGFX Engine Initialization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-22 7: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
- Labels:
-
FreeRTOS
-
STM32G0 Series
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-22 9:41 AM
Seems you dont setup interrupt priorities properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 12:24 AM
The timebase timer interrupt priority is set to 0 with "Uses FreeRTOS function" disabled.
Is not correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 6:32 AM
Show all interrupts config.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 6:42 AM
Interrupt configuration attached.
I also noticed that the HAL_InitTick function is called three times:
- once from the HAL_Init with priority 0 (TICK_INT_PRIORITY);
- twice from SystemClock_Config (HAL_RCC_OscConfig and HAL_RCC_ClockConfig) with priority 4 (uwTickPrio)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 8:04 AM
Break in debuger and check where code stuck, i mean in hard fault handler...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 8: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 8: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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-23 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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...
