Hi,
I'm trying to get familiar with the Packet DMA on the C6670, using CCS5.0.3 and the C6670 simulator.
I took the "cppiTestProject" from pdk_C6670_1_0_0_9_beta2 and modified "test_host_mode.c" to run on 2 different cores.
- Core0 is used for transmitting to the Packet DMA.
- Core1 is used to receive from Packet DMA
This works well if both cores are running. If I halt core0, core1 doesn't get new data and waits in his receive loop. That is what I expected.
But now the problem:
If I halt core1 I expect the rxDMA to run out of free Descriptors form the rxFreeDescQueue. Then the rxDMA should notify the txDMA to stop sending new data. So the txDMA should stop reading from the txQueue. In the simulator the txDMA seems to go on working. It pops form the txQueue and recycles the descriptor to the freeDescQueue.
so my question:
Why doesn't the txDMA stop working?
or
Is there a method to check if the data will be transmittet or not?
Thanks,
Sebastian
Here the send code for Core0:
/*init*/
while(1) {
/* Get a free descriptor */
while((hostDescPtr = (Cppi_Desc *) Qmss_queuePop(txFreeQueHnd)) == NULL) ;
/* Set PS data */
Cppi_setPSLocation(Cppi_DescType_HOST, hostDescPtr,
Cppi_PSLoc_PS_IN_DESC);
Cppi_setPSData(Cppi_DescType_HOST, hostDescPtr, (UInt8 *) &psData,
SIZE_PS_DATA);
/* Add data buffer */
Cppi_setData(Cppi_DescType_HOST, hostDescPtr,
(UInt8 *) l2_global_address((UInt32) dataBuff),
SIZE_DATA_BUFFER);
/* Save original buffer information */
Cppi_setOriginalBufInfo(Cppi_DescType_HOST, hostDescPtr,
(UInt8 *) l2_global_address((UInt32) dataBuff),
SIZE_DATA_BUFFER);
System_printf("Core %d : Transmitting descriptor 0x%p\n", coreNum, hostDescPtr);
/* Set packet length */
Cppi_setPacketLen(Cppi_DescType_HOST, hostDescPtr, SIZE_DATA_BUFFER);
/* Push descriptor to Tx queue */
Qmss_queuePushDescSize(txQueHnd, (UInt32 *) hostDescPtr, SIZE_HOST_DESC);
}
Here the receive code for Core1:
/*init*/
while (1) {
while (Qmss_getQueueEntryCount (rxQueHnd) == 0);
rxPkt = (Cppi_Desc *) QMSS_DESC_PTR (Qmss_queuePop (rxQueHnd));
length = Cppi_getPacketLen(Cppi_DescType_HOST, rxPkt);
System_printf("Core %d : Received descriptor 0x%p of length : %d\n", coreNum, rxPkt, length);
/* Get PS Info */
Cppi_getPSData(Cppi_DescType_HOST, Cppi_PSLoc_PS_IN_DESC,
(Cppi_Desc *) rxPkt, &psBuffPtr, &psLen);
/* Check if length is correct */
if (psLen != SIZE_PS_DATA) {
System_printf(
"Error Core %d : PS data length mismatch Tx: %d - Rx: %d\n",
coreNum, SIZE_PS_DATA, psLen);
errorCount++;
}
/* Get data buffer */
Cppi_getData(Cppi_DescType_HOST, rxPkt, &dataBuffPtr, &destLen);
(...)
/* Recycle the descriptors */
queInfo = Cppi_getReturnQueue(Cppi_DescType_HOST, rxPkt);
/* Push descriptor back to free queue */
Qmss_queuePushDesc(Qmss_getQueueHandle(queInfo), (UInt32 *) rxPkt);
}