# configASSERT( xTimer )

**URL:** <https://forums.freertos.org/t/configassert-xtimer/21964>\
**Category:** Kernel\
**Tags:** debug\
**Created:** [November 26, 2024, 1:36pm UTC](https://forums.freertos.org/t/configassert-xtimer/21964 "2024-11-26T13:36:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roberth73](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@roberth73](https://forums.freertos.org/u/roberth73)\
**Post date:** [November 26, 2024, 1:36pm UTC](https://forums.freertos.org/t/configassert-xtimer/21964/1 "2024-11-26T13:36:43Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [November 26, 2024, 2:16pm UTC](https://forums.freertos.org/t/configassert-xtimer/21964/2 "2024-11-26T14:16:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![roberth73](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@roberth73](https://forums.freertos.org/u/roberth73)\
**Post date:** [November 27, 2024, 1:02pm UTC](https://forums.freertos.org/t/configassert-xtimer/21964/3 "2024-11-27T13:02:00Z")

</div>

Hi Richard,

Thanks for your response. Here is the stack trace:

```auto
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)	
```

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [November 28, 2024, 6:09am UTC](https://forums.freertos.org/t/configassert-xtimer/21964/4 "2024-11-28T06:09:14Z")

</div>

Seems like you are hitting [this assert](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/timers.c#L461). Are you calling any timer API (such as xTimerStart,  
xTimerStop, xTimerReset etc.) in vInitRTCTask and the timer is not created yet?
