Skip to main content
raffin
Associate III
January 11, 2019
Question

I am using CubeMX with STM32F765. I recently upgraded the CubeMX to the 5.0 and I noticed some differences on the SysTick management.

  • January 11, 2019
  • 2 replies
  • 995 views

I have configured TIM1 as SysTick().

I noticed that the function

void SysTick_Handler(void)

is no mode generated in stm32f7xx_it.c. Why?

According to the UM1718 (DocID025776 Rev 21) pag. 90, "SysTick_Handler calls osSystickHandler when FreeRTOS is used" and it is exactly what I get with previous CubeMX where i had (stm32f7xx_it.c):

/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
 /* USER CODE BEGIN SysTick_IRQn 0 */
 
 /* USER CODE END SysTick_IRQn 0 */
 osSystickHandler();
 /* USER CODE BEGIN SysTick_IRQn 1 */
 
 /* USER CODE END SysTick_IRQn 1 */
}

This topic has been closed for replies.

2 replies

Innomatic
Associate III
January 13, 2019

If you chosse one of the TIMs as Timebase Source as CubeMX recommends, then your SysTick_Handler is replaced by xPortSysTickHandler. Check FreeRTOSConfig.h for

#define xPortSysTickHandler SysTickHandler

If not ( if you choose SysTick as Timebase Source), then it should appear somewhere. But it didn't, which is clearly a bug of CubeMX v.5.

However in either cases, I'm wondering if your FreeRTOS actually runs. If not, check this post:

https://community.st.com/s/question/0D50X0000ADCHOVSQ5/freertos-adding-mpu-support-for-tasks

raffin
raffinAuthor
Associate III
January 14, 2019

Thank you Innomatic.

So having TIMs as Timebase source and the #define xPortSysTickHandler SysTickHandler all is right.

I am at the very beginning but the FreeRTOS seems to work.

In a my previous project I had the TIMs as timebase source.

The #define xPortSysTickHandler SysTickHandler was commented but I had the

void SysTick_Handler(void)

on  stm32f7xx_it.c. Also in this case the FreeRTOS works. I don't remember if this structure comes from the previous CUBEMX, but I think so.