# Sizeof assertion fails when calling xTimerCreateStatic/xTimerCreate

**URL:** <https://forums.freertos.org/t/sizeof-assertion-fails-when-calling-xtimercreatestatic-xtimercreate/20921>\
**Category:** Kernel\
**Tags:** debug\
**Created:** [July 9, 2024, 10:11am UTC](https://forums.freertos.org/t/sizeof-assertion-fails-when-calling-xtimercreatestatic-xtimercreate/20921 "2024-07-09T10:11:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kraftpunk97](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/kraftpunk97/32/4758_2.png) [@kraftpunk97](https://forums.freertos.org/u/kraftpunk97)\
**Post date:** [July 9, 2024, 10:11am UTC](https://forums.freertos.org/t/sizeof-assertion-fails-when-calling-xtimercreatestatic-xtimercreate/20921/1 "2024-07-09T10:11:04Z")

</div>

Hello. I am working on a ESP32 project that uses FreeRTOS. When I monitor the program, it boots up the chip, but fails at the point where I call xTimerCreate or xTimerCreateStatic. By analysing the backtrace, I’ve found that it fails this assertion (github dot com/FreeRTOS/FreeRTOS-Kernel/blob/0452603a943e13d27e7117f7112c4dd000748705/timers.c#L387).

I also tried increasing the `configTIMER_TASK_STACK_DEPTH` from 2048 to 4096, but to no avail.

I’m left confused by this behavior. Help with is very much appreciated.

---

<div class="post-metadata">

**Author:** ![kraftpunk97](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/kraftpunk97/32/4758_2.png) [@kraftpunk97](https://forums.freertos.org/u/kraftpunk97)\
**Post date:** [July 9, 2024, 10:54am UTC](https://forums.freertos.org/t/sizeof-assertion-fails-when-calling-xtimercreatestatic-xtimercreate/20921/3 "2024-07-09T10:54:37Z")

</div>

Turns out I was using a very low value for the`xTimerPeriodinTicks` argument. It seems that I set the time period to be 1 millisec, so I passed `pdMS_TO_TICK(1)` as the argument to this parameter. And I think this was being translated as 0 ticks.

---

<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:** [July 9, 2024, 12:49pm UTC](https://forums.freertos.org/t/sizeof-assertion-fails-when-calling-xtimercreatestatic-xtimercreate/20921/4 "2024-07-09T12:49:07Z")

</div>

Thank you for sharing your solution!
