AnsweredAssumed Answered

CubeMX 4.3.1 - FreeRTOS SysTick and HardFault

Question asked by GeorgeP on Sep 29, 2014
Latest reply on Nov 6, 2014 by delaunay.christophe
Hello,

I am using the STM32F3 Discovery Board to try out CubeMX for IAR and FreeRTOS.
I have encountered the following situation, where the system hangs:

SysTick_Handler is never reached. The system hangs in the HardFault_Handler.
I have replaced the code in SysTick_Handler as mentioned in the fora by ST employees to:
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
  {
    xPortSysTickHandler();
  }
  HAL_IncTick();

but this is irrelevant, since the device branches to the HardFault_Handler before ever reaching the SysTick_Handler.

The solution I have found to this, is to comment out the osDelay(1) line in StartThread thread, or completely avoid using this thread.

I have tested this with a single other thread, written by me and it works well.
I will reply to this post, after testing with more threads.

I do not know the true cause to this mishap, but I'd like to see this fixed since it's something that is given as a starting point for Discovery and Development Kits.

Regards,
George

Outcomes