#ESP32-S3 #ESP-IDF-5.1 master #custom-board
I'm having weird behaviour of notifications to main task, i.e. the task is notified, but does not receive the notify. When the task occasionally receives the notification, its value seems to have some random/trash value. It can even cath a notification when my code didn't sent notify yet.
other_task.c
Code: Select all
extern TaskHandle_t main_task_handle;
void some_event(void)
{
//this task is started by app_main() after the main_task_handle is initialized
//the below event is triggered from e.g. uart communication
xTaskNotify(main_task_handle, MAIN_TASK_NOTIFY_MEASURE, eSetBits);
}
Code: Select all
TaskHandle_t main_task_handle;
void app_main(void)
{
main_task_handle = xTaskGetCurrentTaskHandle();
while (1)
{
//some other code e.g. reading internal ADC
adcIntRoutine();
uint32_t ulNotifyValue;
if (pdPASS == xTaskNotifyWait(0, UINT32_MAX, &ulNotifyValue, 0))
{
ESP_LOGI(TAG, "%s notified: %lu", __func__, ulNotifyValue);
}
vTaskDelay(1);
}
}
Intruder that interferes with my notifications:
Code: Select all
Thread #1 [IDLE] 1070210576 (Name: IDLE, State: Running @CPU0) (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)
vTaskGenericNotifyGiveFromISR() at tasks.c:6 171 0x4037fc64
prvConvDoneCallback() at adcInt.c:112 0x40377952
s_adc_dma_intr() at adc_continuous.c:310 0x4037ac12
adc_dma_in_suc_eof_callback() at adc_continuous.c:264 0x4037ac70
gdma_default_rx_isr() at gdma.c:701 0x4037aba7
_xt_medint2() at xtensa_vectors.S:1 215 0x4037720c
xt_utils_get_core_id() at xt_utils.h:36 0x40375981
esp_cpu_get_core_id() at esp_cpu.h:126 0x40375981
tick_hook() at int_wdt.c:64 0x40375981
esp_vApplicationTickHook() at freertos_hooks.c:37 0x40375fcc
xPortSysTickHandler() at port_systick.c:179 0x403806fe
SysTickIsrHandler() at port_systick.c:149 0x40376d14
_xt_lowint1() at xtensa_vectors.S:1 126 0x40377170
gpio_intr_service() at gpio.c:488 0x40377abe
esp_vApplicationIdleHook() at freertos_hooks.c:59 0x42003829
prvIdleTask() at tasks.c:4 249 0x4037e8b4
vPortTaskWrapper() at port.c:162 0x4037ff98
How should I use the task notification feature to not interfer with IDF ?
Maybe the IDF uses only index 0 of notifications and users should utilize only >0 indexes?