Migrate to V4.4.6, get xTaskGenericNotifyWait failure

HighVoltage
Posts: 52
Joined: Mon Oct 24, 2022 9:37 pm

Migrate to V4.4.6, get xTaskGenericNotifyWait failure

Postby HighVoltage » Thu Nov 30, 2023 6:01 pm

I have a working application running on ESP32E 4MB, and I've been running v4.4.2. I've decided to port to the latest v4, v4.4.6. I get this error:

assert failed: xTaskGenericNotifyWait tasks.c:5456 (uxIndexToWait < 1)

0x40081d26: panic_abort at C:/exp/frameworks/esp-idf-v4.4.6/components/esp_system/panic.c:408
0x40089e4d: esp_system_abort at C:/exp/frameworks/esp-idf-v4.4.6/components/esp_system/esp_system.c:137
0x40090e49: __assert_func at C:/exp/frameworks/esp-idf-v4.4.6/components/newlib/assert.c:85
0x4008caec: xTaskGenericNotifyWait at C:/exp/frameworks/esp-idf-v4.4.6/components/freertos/tasks.c:5456 (discriminator 1)

My application code is making this call

if ( xTaskNotifyWaitIndexed( 1, 0, ULONG_MAX, NULL, pdMS_TO_TICKS(nextms) ) == pdTRUE ) {

Any idea why it has problems under v4.4.6? The index is 1, not less than 1. This is working code in v4.4.2.

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Migrate to V4.4.6, get xTaskGenericNotifyWait failure

Postby MicroController » Thu Nov 30, 2023 8:38 pm

The index is 1, not less than 1
That's exactly the problem.

https://github.com/espressif/esp-idf/bl ... ks.c#L5482

Check the value of configTASK_NOTIFICATION_ARRAY_ENTRIES in menuconfig.

HighVoltage
Posts: 52
Joined: Mon Oct 24, 2022 9:37 pm

Re: Migrate to V4.4.6, get xTaskGenericNotifyWait failure

Postby HighVoltage » Thu Nov 30, 2023 9:11 pm

That's exactly the problem.

https://github.com/espressif/esp-idf/bl ... ks.c#L5482

Check the value of configTASK_NOTIFICATION_ARRAY_ENTRIES in menuconfig.
Thanks for that link. Where in menuconfig should this be? I can't seem to find anything related. Doesn't seem to be in the FreeRTOS section, and can't find anything like that in sdkconfig. Tried that as the name as a test, didn't make a difference.

I just tried index 0. That clears the problem. Now need to figure out the WiFi issue. Curious the NotifyIndexed API didn't mind 1.

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Migrate to V4.4.6, get xTaskGenericNotifyWait failure

Postby MicroController » Thu Nov 30, 2023 11:33 pm

HighVoltage wrote:
Thu Nov 30, 2023 9:11 pm
Where in menuconfig should this be? I can't seem to find anything related.
Can't find it either in v4.4, but in v5.1 it's under Component config -> FreeRTOS -> Kernel. The macro is however handled/defaulted in FreeRTOS.h.
If you actually do need more than one notification 'channel' you may have to -D efine it manually.

HighVoltage
Posts: 52
Joined: Mon Oct 24, 2022 9:37 pm

Re: Migrate to V4.4.6, get xTaskGenericNotifyWait failure

Postby HighVoltage » Thu Nov 30, 2023 11:54 pm

MicroController wrote:
Thu Nov 30, 2023 11:33 pm
Can't find it either in v4.4, but in v5.1 it's under Component config -> FreeRTOS -> Kernel. The macro is however handled/defaulted in FreeRTOS.h.
If you actually do need more than one notification 'channel' you may have to -D efine it manually.
Thanks for checking. What is the name of the entry in sdkconfig in 5.1? Would like to see if it's actually recognized even if not in menuconfig.

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Migrate to V4.4.6, get xTaskGenericNotifyWait failure

Postby MicroController » Sat Dec 02, 2023 11:06 pm

"CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1"
- sdkconfig, 5.1

Who is online

Users browsing this forum: No registered users and 79 guests