Skip to main content
Curtis B.
Associate III
April 5, 2020
Question

STM32H755 HALTick Timer and FreeRtos - Problem with Code generation

  • April 5, 2020
  • 10 replies
  • 3640 views

Hello folks,

I discovered a problem in the code generation of CubeIDE and I don't know if it is a bug or a PEBKAC.

I set up a project for te H755 nucleo board. First, I just started blinking some LEDs with both cores. Worked fine.

Then I changed the HAL tick timer from Systick to TIM7 for the CM7 core. Works as intended, too. But when I enable FreeRtos for the CM7 the program gets stuck, because the default handler is triggered.

I analysed that the interrupt that ended in the default handler ist the interrupt from TIM7. The reason for that is, when FreeRTOS is enabled, in the file "stm32h7xx_it.c" the IRQ handler for TIM7 is not generated that should normally look like this:

void TIM7_IRQHandler(void)
{
 /* USER CODE BEGIN TIM7_IRQn 0 */
 
 /* USER CODE END TIM7_IRQn 0 */
 HAL_TIM_IRQHandler(&htim7);
 /* USER CODE BEGIN TIM7_IRQn 1 */
 
 /* USER CODE END TIM7_IRQn 1 */
}

I added the snipped manually and everything works fine. But why is this code snippet not generated? In older firmaware packages for the H7 core and another controller it worked with no additional settings. Is the a bug, or did I miss something in the configuration?

Best regards,

Daniel

This topic has been closed for replies.

10 replies

AShri.1
Associate
April 5, 2020

0693W000000VKhMQAW.pngI ran into the same problem (on the STM32H745). For some reason the "Generate IRQ" and "Call HAL function" is unchecked in the code generation. So you either have to add it manually, or have to know to check the code generation option.

I don't see the logic as to why it's turned off, and I wasted a lot of time hunting down the root cause. I hope the default behaviour is changed in future versions.

Curtis B.
Curtis B.Author
Associate III
April 6, 2020

Hi AShri,

I thought that the SysTick interrupt is handled by the RTOS and the HalTick which I set to TIM7 should be generated by CubeIDE. Under NVIC1 TIM7 isn't present. For System Tick Timer I cannot activate Generate IRQ because it is greyed out. It is stated that this interrupt is handled by FreeRTOS. Only adding it manually worked for me.

Best Regards,

Daniel

AShri.1
Associate
April 6, 2020

I should have clarified: the code generator sometimes skips generating the isr for SysTick when you eneable -> then disable FreeRTOS. But I've also came across the same issue as you, where the isr for TIM7 (or whatever TIMx is used for SysTick) is not generated. I was able to trace it back to the code generation options.

This is a screenshot of a current project using FreeRTOS and TIM7 as the SysTick.

0693W000000VOaAQAW.png

Curtis B.
Curtis B.Author
Associate III
April 6, 2020

I see, in your project at least TIM 7 is listed in the code generation tab. This is how it looks in my project:

TIM7 does not even appear in the list. Annyways, fixing it manually works. At least I am not the only one with this problem. Thanks for your reply. :)

Khouloud ZEMMELI
ST Employee
April 14, 2020

Hello @Curtis B.​ ,

Could you please share your ioc file? issue not reproduced on my side..

Thanks,

Khouloud

Curtis B.
Curtis B.Author
Associate III
April 15, 2020

Hi Khouloud,

of course, please finde the file in the attachment.

Regards,

Daniel

Khouloud ZEMMELI
ST Employee
April 15, 2020

Thanks for the share, I need some more info

Did you created your ioc file from CubeIDE ? If yes which CubeIDE version?

Otherwise, your project (ioc ) was created with an old CubeMX version then you have migrate it to the 5.6.0 version ?

Thanks,

Khouloud

Curtis B.
Curtis B.Author
Associate III
April 16, 2020

Hi,

yes, the ioc file was created from CubeIDE it is the version 1.3.0.

Regards,

Daniel

Khouloud ZEMMELI
ST Employee
April 15, 2020

Check the ioc attached, is it ok ?

Curtis B.
Curtis B.Author
Associate III
April 16, 2020

I just tried the ioc file you provided. In the generated code, the IRQ handler is still missing.

Regards,

Daniel

Khouloud ZEMMELI
ST Employee
April 17, 2020

​Could you please re-install the CubeIDE then re-check ? Issue not reproduced on my side

Curtis B.
Curtis B.Author
Associate III
April 21, 2020

Hi, also checked this on another computer. Latest CubeIDE, latest firmwarepackage. Same problem :(

Khouloud ZEMMELI
ST Employee
April 24, 2020

​Hi @Curtis B.​ ,

This will be internally ore checked, I will give you an update as soon as possible, and sorry for any inconvenience this may have caused.

Best Regards,

Khouloud