Hi everyone!
I am implementing power supply control functionality. I am utilizing adc measurements with dma, triggered by a timer at fixed frequency (2k5 Hz). I wan’t to execute the control loop after every measurement by using vTaskNotifyGiveIndexedFromISR. However using it in the ISR causes hardfault but so hard, there haven’t been any SEGGER messages received from anywhere within the system.
void ADC_DMA_ISR(void) {
BaseType_t yield = pdFALSE;
dma_clear_interrupt_flags(ADC_DMA, ADC_DMA_CHANNEL, DMA_TCIF);
vTaskNotifyGiveIndexedFromISR(task_handle, 0, &yield);
portYIELD_FROM_ISR(yield);
}
SemaphoreHandle_t mutex;
void task(void* pvParameters) {
strat_adc();
mutex = xSemaphoreCreateMutex();
while (1) {
notification |= ulTaskNotifyTakeIndexed(0, pdTRUE, portMAX_DELAY);
// do the stuff
}
}
Prioirties:
task: 4 // set as the highest priority task in the system
dam isr: 1
I feel I’m missing something fundamental. What could cause this issue?