FreeRTOS exception waking the MAX86150 task
Happened after using the MAX86150 for a few hours:
2020-12-25 12:12:56.573 --- SYSTEM PANIC ---
2020-12-25 12:12:56.574 --- ---
2020-12-25 12:12:56.577 --- ---
2020-12-25 12:12:56.581 A fatal error occured:
2020-12-25 12:12:56.582 Assertion failure:
2020-12-25 12:12:56.589 "( ( &( pxTCB->xEventListItem ) )->pvContainer ) == ((void *)0)"
2020-12-25 12:12:56.593 failed in "../lib/FreeRTOS/Source/tasks.c:5001",
2020-12-25 12:12:56.597 function: vTaskNotifyGiveFromISR()
2020-12-25 12:12:56.598
2020-12-25 12:12:56.601 Firmware Version:
2020-12-25 12:12:56.602 v1.16-107-gad28755b-dirty
2020-12-25 12:12:56.605
2020-12-25 12:12:56.605 Stack Trace:
2020-12-25 12:12:56.606 0x10013e07
2020-12-25 12:12:56.609
2020-12-25 12:12:56.613 Please report this error to the card10 firmware team!
2020-12-25 12:12:56.617 -> https://git.card10.badge.events.ccc.de/card10/firmware/issues/new <-
2020-12-25 12:12:56.621 --- ====== ===== ---
FreeRTOS code:
void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken )
{
TCB_t * pxTCB;
uint8_t ucOriginalNotifyState;
UBaseType_t uxSavedInterruptStatus;
» configASSERT( xTaskToNotify );
» /* RTOS ports that support interrupt nesting have the concept of a
» maximum»system call (or maximum API call) interrupt priority.
» Interrupts that are»above the maximum system call priority are keep
» permanently enabled, even when the RTOS kernel is in a critical section,
» but cannot make any calls to FreeRTOS API functions. If configASSERT()
» is defined in FreeRTOSConfig.h then
» portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion
» failure if a FreeRTOS API function is called from an interrupt that has
» been assigned a priority above the configured maximum system call
» priority. Only FreeRTOS functions that end in FromISR can be called
» from interrupts»that have been assigned a priority at or (logically)
» below the maximum system call interrupt priority. FreeRTOS maintains a
» separate interrupt safe API to ensure interrupt entry is as fast and as
» simple as possible. More information (albeit Cortex-M specific) is
» provided on the following link:
» http://www.freertos.org/RTOS-Cortex-M3-M4.html */
» portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
» pxTCB = xTaskToNotify;
» uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
» {
» » ucOriginalNotifyState = pxTCB->ucNotifyState;
» » pxTCB->ucNotifyState = taskNOTIFICATION_RECEIVED;
» » /* 'Giving' is equivalent to incrementing a count in a counting
» » semaphore. */
» » ( pxTCB->ulNotifiedValue )++;
» » traceTASK_NOTIFY_GIVE_FROM_ISR();
» » /* If the task is in the blocked state specifically to wait for a
» » notification then unblock it now. */
» » if( ucOriginalNotifyState == taskWAITING_NOTIFICATION )
» » {
» » » /* The task should not have been on an event list. */
» » » configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL );
Random advice from the Internet: turn on configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
as this looks like a memory corruption:
https://www.freertos.org/FreeRTOS_Support_Forum_Archive/July_2018/freertos_xTaskNotify_assertion_50220597j.html