configASSERT( xTimer )

Hi guys, sorry to be a bother again, but my timer issue is not yet solved. My timer creation gets stuck in configASSERT. My FreeRTOS version is 11.1; I use MCUXpresso and the MCU is an NXP Arm Cortex-M7. My code is relatively simple:

TimerHandle_t xTimerShutdownBrake;
StaticTimer_t xTimerBufferShutdownBrake;

TimerCallbackFunction_t pxCallbackShutdownBrake(TimerHandle_t xTimerShutdownBrake) {
    set_control_word(SHUTDOWN);
    brake_engage();
}

/* In a function:  */
    xTimerShutdownBrake = xTimerCreateStatic(
        "Shutdown & Brake", 
        pdMS_TO_TICKS(TIMER_PERIOD_SHUTDOWN_BRAKE * 1000), 
        pdFALSE, 
        (void*)0, 
        pxCallbackShutdownBrake, 
        &xTimerBufferShutdownBrake  
    );

I tried passing the callback by pointer as is hinted at in the docs by the naming convention. I also tried to change its return value to void. The result is the same in all cases.

Am I missing something?

What is the call stack from the configASSERT?

Nothing in the code you show makes a call that should be able to do that.

You probably should check that the create succeeded, but I don’t know what could make a static create fail.

Hi Richard,

Thanks for your response. Here is the stack trace:

u_sw JLink Debug [GDB SEGGER Interface Debugging]	
	rcu_sw.axf	
		Thread #1 57005 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)	
			xTimerGenericCommandFromTask() at timers.c:461 0x10003734	
			vInitRTCTask() at rcu_sw.c:4,298 0x100020ec	
			vUARTUITask() at rcu_sw.c:1,416 0x100021f2	
			Timer0Task_NestedDefaultTask() at timer0.c:131 0x10002524	
	arm-none-eabi-gdb (13.2.90.20231008)	

Seems like you are hitting this assert. Are you calling any timer API (such as xTimerStart,
xTimerStop, xTimerReset etc.) in vInitRTCTask and the timer is not created yet?