mktime exception after update to idf 5.0

luissilva.lfrs
Posts: 2
Joined: Tue May 17, 2022 5:16 pm

mktime exception after update to idf 5.0

Postby luissilva.lfrs » Sat Dec 17, 2022 12:07 pm

Hi,

When i update the IDF to version 5.0 i get this exception from mktime, what can it be?

assert failed: xQueueGenericSend queue.c:837 (pxQueue->pcHead != ((void *)0) || pxQueue->u.xSemaphore.xMutexHolder == ((void *)0) || pxQueue->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle())


Backtrace: 0x40081fae:0x3ffca370 0x400891e1:0x3ffca390 0x4008d2c1:0x3ffca3b0 0x4015865d:0x3ffca4d0 0x400830b1:0x3ffca510 0x40083169:0x3ffca540 0x400831da:0x3ffca560 0x40147615:0x3ffca590 0x40142679:0x3ffca5b0 0x400e13ff:0x3ffca5f0 0x400e203f:0x3ffca650 0x400e20ea:0x3ffca6c0 0x40089635:0x3ffca6e0
0x40081fae: panic_abort at C:/esp/esp-idf/components/esp_system/panic.c:412

0x400891e1: esp_system_abort at C:/esp/esp-idf/components/esp_system/esp_system.c:135

0x4008d2c1: __assert_func at C:/esp/esp-idf/components/newlib/assert.c:78

0x4015865d: xQueueGenericSend at C:/esp/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:837 (discriminator 8)

0x400830b1: lock_release_generic at C:/esp/esp-idf/components/newlib/locks.c:192

0x40083169: _lock_release at C:/esp/esp-idf/components/newlib/locks.c:198

0x400831da: __retarget_lock_release at C:/esp/esp-idf/components/newlib/locks.c:334

0x40147615: __tz_unlock at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/time/tzlock.c:50

0x40142679: mktime at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/time/mktime.c:272

0x400e13ff: LOG_Calc_Next_Reading_DT at D:/002-DevESP/001-Robin/main/sources/LOG_Logs.c:378

0x400e203f: LOG_Periodic_Logging at D:/002-DevESP/001-Robin/main/sources/LOG_Logs.c:246

0x400e20ea: LOG_Task at D:/002-DevESP/001-Robin/main/sources/LOG_Logs.c:192 (discriminator 1)

0x40089635: vPortTaskWrapper at C:/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:151

Thanks,
Luis

kammutierspule
Posts: 7
Joined: Sat Apr 11, 2020 9:25 am

Re: mktime exception after update to idf 5.0

Postby kammutierspule » Tue Oct 01, 2024 1:18 pm

I had a similar issue, I found that OS must be running while to access this functions.
Eg: tasks can't be suspended while using these functions.

nopnop2002
Posts: 112
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: mktime exception after update to idf 5.0

Postby nopnop2002 » Tue Oct 01, 2024 10:25 pm

There's nothing wrong with it.

Code: Select all

#include <stdio.h>
#include <inttypes.h>
#include <time.h>

void app_main()
{
    time_t now;
    struct tm timeinfo;
    /* fill date_time */
    timeinfo.tm_year= 2024 - 1900 ;
    timeinfo.tm_mon = 10 - 1;
    timeinfo.tm_mday = 2;
    timeinfo.tm_hour = 8;
    timeinfo.tm_min = 0;
    timeinfo.tm_sec = 0;
    timeinfo.tm_wday = 1;
    now = mktime(&timeinfo);
}

Code: Select all

$ idf.py --version
ESP-IDF v5.3.1

Who is online

Users browsing this forum: No registered users and 202 guests