@richard-damon actually, this program has two working parts:
A) Two tasks, prvRxTask and prvTxTask, are working connected with a queue.
B) Task VDMA works with interruptions that happend every 30ms.
@aggarg nothing changed
@ActoryOu As i see, in the configASSERT is defined, how should i use it?
The process A ,with and without vTaskDelay( pdMS_TO_TICKS(500) ), works well by separated,
But I noticed that if I run only the task VDMA , it only works as long as I dont use vTaskDelay in task VDMA.
And A and B together work well as long as i don’t use vTaskDelay.
It seems that there something between vTaskDelay and VDMA interruptions. The code for interruptions is below:
static int SetupIntrSystem_WR_RD(XAxiVdma *AxiVdmaPtr, u16 ReadIntrId, u16 WriteIntrId)
{
int Status;
/* Instance of the Interrupt Controller */
XScuGic *IntcInstancePtr = &xInterruptController;
Status = xPortInstallInterruptHandler( ReadIntrId, (XInterruptHandler) XAxiVdma_ReadIntrHandler, AxiVdmaPtr);
XScuGic_SetPriorityTriggerType(IntcInstancePtr, ReadIntrId, 0xA0, 0x3);//(configMAX_API_CALL_INTERRUPT_PRIORITY + 1) << portPRIORITY_SHIFT
XScuGic_SetPriorityTriggerType(IntcInstancePtr, WriteIntrId, 0xA0, 0x3);
/*
* Connect the device driver handler that will be called when an
* interrupt for the device occurs, the handler defined above performs
* the specific interrupt processing for the device.
*/
Status = XScuGic_Connect(IntcInstancePtr, ReadIntrId, (Xil_InterruptHandler)XAxiVdma_ReadIntrHandler, AxiVdmaPtr);
if (Status != XST_SUCCESS) {
return Status;
}
Status = XScuGic_Connect(IntcInstancePtr, WriteIntrId, (Xil_InterruptHandler)XAxiVdma_WriteIntrHandler, AxiVdmaPtr);
if (Status != XST_SUCCESS) {
return Status;
}
/*
* Enable the interrupt for the DMA device.
*/
XScuGic_Enable(IntcInstancePtr, ReadIntrId);
XScuGic_Enable(IntcInstancePtr, WriteIntrId);
Xil_ExceptionInit();
/*
* Connect the interrupt controller interrupt handler to the hardware
* interrupt handling logic in the processor.
*/
Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_IRQ_INT,
(Xil_ExceptionHandler)XScuGic_InterruptHandler,
IntcInstancePtr);
/*
* Enable interrupts in the Processor.
*/
Xil_ExceptionEnable();
/* Register callback functions
*/
XAxiVdma_SetCallBack(AxiVdmaPtr, XAXIVDMA_HANDLER_GENERAL, ReadCallBack, (void *)AxiVdmaPtr, XAXIVDMA_READ);
XAxiVdma_SetCallBack(AxiVdmaPtr, XAXIVDMA_HANDLER_ERROR, ReadErrorCallBack, (void *)AxiVdmaPtr, XAXIVDMA_READ);
XAxiVdma_SetCallBack(AxiVdmaPtr, XAXIVDMA_HANDLER_GENERAL, WriteCallBack, (void *)AxiVdmaPtr, XAXIVDMA_WRITE);
XAxiVdma_SetCallBack(AxiVdmaPtr, XAXIVDMA_HANDLER_ERROR, WriteErrorCallBack, (void *)AxiVdmaPtr, XAXIVDMA_WRITE);
return XST_SUCCESS;
}
In code above there is the part Writing frame and Reading frame interruption from VDMA, both interruptions work, but just to simplified in VDMA i only use the semaphore SemVDMAWr.
Another thing is that the interrupt controller instance xInterruptController defined in portZynq7000.c is not initialized. As far I read in many sites , FreeRTOS initializes the interrupt controller instance xInterruptController, that why it is not initialize the XScugic instance, and indeed FreeRTOS commutes tasks.
That’s why before add VDMA interruptions to FreeRTOS, I needed to use :
XScuGic *IntcInstancePtr = &xInterruptController;
Status = xPortInstallInterruptHandler( ReadIntrId, (XInterruptHandler)XAxiVdma_ReadIntrHandler, AxiVdmaPtr);
just only to initialize the xInterruptController. xInterruptController is declared as extern in the VDMA.c file
BUT if xInterruptController is not initialized, what is FreeRTOS initialize to commute tasks?
Here are links where i used
https://support.xilinx.com/s/question/0D52E00006iHj5lSAC/freertos-multiple-tasks-not-responding-when-mixed-with-a-semaphore?language=en_US
https://forums.freertos.org/t/multiple-tasks-not-responding-when-mixed-with-a-semaphore/10242/2