FreeRTOS failing in prvTimerTask


I’m using FreeRTOS kernel on a new silicon based on ARM Cortex-M33. I am using the ARM CMSIS RTOS APIs and underlying is the FreeRTOS kernel. With the minimal blinky setup,
the application is crashing in prvTimerTask. The following is the stack trace where the crash occurs:

Thread #1 57005 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)	
	HardFault_Handler() at startup.S:170 0x10276a	
	<signal handler called>() at 0xffffffbc	
	prvTimerTask() at timers.c:549 0x101da4	
	vPortSetupTimerInterrupt() at port.c:346 0x100610	

The crash happens after the scheduler is started and it does not execute any tasks. The FreeRTOSConfig.h has the following definitions:

* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
#define xPortPendSVHandler                      PendSV_Handler
#define vPortSVCHandler                         SVC_Handler

/* Ensure Cortex-M port compatibility. */
#define SysTick_Handler                         xPortSysTickHandler

I have not configured any other timers and expect to use the SysTick for the FreeRTOS tick. What could be wrong ? Any points on debugging this further are appreciated.

On the hardfault, the INVPC bit of the SCB->CFSR is set.

Can you describe your conflagration a bit more:

  • Which FreeRTOS port are you using?
  • Are you using TrustZone or not?
  • Are you running FreeRTOS on the secure side or on the non-secure side?

Please share your complete FreeRTOSConfig.h file too. This article provides detailed information about using FreeRTOS on an ARMv8-M device: Using FreeRTOS on ARMv8-M Microcontrollers - FreeRTOS