diff --git a/example/k2g/MCBSPDigLpbk/mcbspMasterDigLpbk.c b/example/k2g/MCBSPDigLpbk/mcbspMasterDigLpbk.c
index 888acbeb5269dbdafef05dda79bfa1c7c8eabcbc..03a52bc0c92cd200562e49b88bc8aec770d0dd0f 100644 (file)
#include <xdc/cfg/global.h>
#include <board.h>
+#include <MCBSP_log.h>
/* Include EDMA3 Driver */
#include <ti/sdo/edma3/drv/edma3_drv.h>
*/
void mcbsp_GblErrCallback(uint32_t chanHandle,uint32_t spcr_read,uint32_t Arg3)
{
- System_printf ("Debug(Core %d): ERROR callback called SPCR: %x", coreNum, spcr_read);
+ MCBSP_log ("Debug(Core %d): ERROR callback called SPCR: %x", coreNum, spcr_read);
}
/*
/* Initialize the OSAL */
if (Osal_dataBufferInitMemory(BUFSIZE) < 0)
{
- System_printf ("Debug(Core %d): Error: Unable to initialize the OSAL. \n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Unable to initialize the OSAL. \n", coreNum);
return;
}
if (status != MCBSP_STATUS_COMPLETED)
{
- System_printf ("Debug(Core %d): MCBSP LLD Bind Device Failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): MCBSP LLD Bind Device Failed\n", coreNum);
return;
}
status = mcbspCreateChan(&hMcbspRxChan, hMcbspDev, MCBSP_MODE_INPUT, &mcbspChanparamRx, mcbspAppCallback, &rxChanMode);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Create Channel (RX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Create Channel (RX) failed\n", coreNum);
return;
}
status = mcbspCreateChan(&hMcbspTxChan, hMcbspDev, MCBSP_MODE_OUTPUT, &mcbspChanparamTx, mcbspAppCallback, &txChanMode);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Create Channel (TX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Create Channel (TX) failed\n", coreNum);
return;
}
if (bufTx[count] == NULL)
{
- System_printf ("Debug(Core %d): Error: Tx Buffer (%d) Memory Allocation Failed\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): Error: Tx Buffer (%d) Memory Allocation Failed\n", coreNum, count);
return;
}
if (bufRx[count] == NULL)
{
- System_printf ("Debug(Core %d): Error: Rx Buffer (%d) Memory Allocation Failed\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): Error: Rx Buffer (%d) Memory Allocation Failed\n", coreNum, count);
return;
}
}
if (bufTxPingPong[count] == NULL)
{
- System_printf ("Debug(Core %d): Error: Tx Ping pong Buffer (%d) Memory Allocation Failed\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): Error: Tx Ping pong Buffer (%d) Memory Allocation Failed\n", coreNum, count);
return;
}
if (bufRxPingPong[count] == NULL)
{
- System_printf ("Debug(Core %d): Error: Rx Ping pong Buffer (%d) Memory Allocation Failed\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): Error: Rx Ping pong Buffer (%d) Memory Allocation Failed\n", coreNum, count);
return;
}
}
((uint8_t *)bufTx[count])[tempCount] = (tempCount % 0x100);
}
}
- System_printf ("Debug(Core %d): If required to restart set debugCommand variable to %d\n", coreNum, DEBUG_COMMAND_RESTART_CHANNELS);
+ MCBSP_log ("Debug(Core %d): If required to restart set debugCommand variable to %d\n", coreNum, DEBUG_COMMAND_RESTART_CHANNELS);
restart_mcbsp_point:
txFrameIndex=0;
status = mcbspSubmitChan(hMcbspRxChan, (void *)&rxFrame[rxFrameIndex]);
if (status != MCBSP_STATUS_PENDING)
{
- System_printf ("Debug(Core %d): Error: RX buffer #%d submission FAILED\n", coreNum, init_count);
+ MCBSP_log ("Debug(Core %d): Error: RX buffer #%d submission FAILED\n", coreNum, init_count);
retval = 1;
}
else
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): RX buffer #%d is submitted to MCBSP driver\n", coreNum, init_count);
+ MCBSP_log ("Debug(Core %d): RX buffer #%d is submitted to MCBSP driver\n", coreNum, init_count);
#endif
}
rxFrameIndex++;
status = mcbspSubmitChan(hMcbspTxChan, (void *)&txFrame[txFrameIndex]);
if (status != MCBSP_STATUS_PENDING)
{
- System_printf ("Debug(Core %d): Error: TX buffer #%d submission FAILED\n", coreNum, init_count);
+ MCBSP_log ("Debug(Core %d): Error: TX buffer #%d submission FAILED\n", coreNum, init_count);
retval = 1;
}
else
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): TX buffer #%d submission is submitted to MCBSP driver\n", coreNum, init_count);
+ MCBSP_log ("Debug(Core %d): TX buffer #%d submission is submitted to MCBSP driver\n", coreNum, init_count);
#endif
}
txFrameIndex++;
if (edmaTxDone == 1)
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): EDMA -> Iteration-%d frames are transmitted to TX path\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): EDMA -> Iteration-%d frames are transmitted to TX path\n", coreNum, count);
#endif
edmaTxDone = 0; /* Reset for next iteration */
mcbspTxDone = 1;
if (edmaRxDone == 1)
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): EDMA -> Iteration-%d frames are received from RX path\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): EDMA -> Iteration-%d frames are received from RX path\n", coreNum, count);
#endif
edmaRxDone = 0; /* Reset for next iteration */
mcbspRxDone = 1;
status = mcbspSubmitChan(hMcbspRxChan, (void *)&rxFrame[rxFrameIndex]);
if (status != MCBSP_STATUS_PENDING)
{
- System_printf ("Debug(Core %d): Error: RX buffer #%d submission FAILED\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): Error: RX buffer #%d submission FAILED\n", coreNum, count);
retval = 1;
}
else
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): RX buffer #%d is submitted to MCBSP driver\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): RX buffer #%d is submitted to MCBSP driver\n", coreNum, count);
#endif
}
rxFrameIndex++;
status = mcbspSubmitChan(hMcbspTxChan, (void *)&txFrame[txFrameIndex]);
if (status != MCBSP_STATUS_PENDING)
{
- System_printf ("Debug(Core %d): Error: TX buffer #%d submission FAILED\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): Error: TX buffer #%d submission FAILED\n", coreNum, count);
retval = 1;
}
else
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): TX buffer #%d is submitted to MCBSP driver\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): TX buffer #%d is submitted to MCBSP driver\n", coreNum, count);
#endif
}
txFrameIndex++;
if (edmaTxDone == 1)
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): EDMA -> Buffer #-%d is transmitted to TX path\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): EDMA -> Buffer #-%d is transmitted to TX path\n", coreNum, count);
#endif
edmaTxDone = 0; /* Reset for next iteration */
mcbspTxDone = 1;
if (edmaRxDone == 1)
{
#ifdef MCBSP_APP_VERBOSE
- System_printf ("Debug(Core %d): EDMA -> Buffer #-%d is received from RX path\n", coreNum, count);
+ MCBSP_log ("Debug(Core %d): EDMA -> Buffer #-%d is received from RX path\n", coreNum, count);
#endif
edmaRxDone = 0; /* Reset for next iteration */
mcbspRxDone = 1;
if (((char *)bufTx[count])[tempCount] != ((char *)bufRx[count])[tempCount])
{
#ifdef MCBSP_APP_VERBOSE
- System_printf("Debug(Core %d): Error: TX and RX frame data DOES NOT match in Buffer #-%d\n",
+ MCBSP_log("Debug(Core %d): Error: TX and RX frame data DOES NOT match in Buffer #-%d\n",
coreNum, count);
- System_printf("Debug(Core %d): Error: Buffer index = %d, Tx data = %d, Rx data = %d\n", coreNum,
+ MCBSP_log("Debug(Core %d): Error: Buffer index = %d, Tx data = %d, Rx data = %d\n", coreNum,
tempCount, ((char *)bufTx[count])[tempCount], ((char *)bufRx[count])[tempCount]);
#endif
errBuffCount++;
if (tempCount >= BUFSIZE)
{
#ifdef MCBSP_APP_VERBOSE
- System_printf("Debug(Core %d): TX and RX frames data match in iteration-%d !!!\n", coreNum, count);
+ MCBSP_log("Debug(Core %d): TX and RX frames data match in iteration-%d !!!\n", coreNum, count);
#endif
}
}
status = mcbspDeleteChan(hMcbspRxChan);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Delete Channel (RX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Delete Channel (RX) failed\n", coreNum);
return;
}
status = mcbspDeleteChan(hMcbspTxChan);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Delete Channel (TX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Delete Channel (TX) failed\n", coreNum);
return;
}
/* Create a RX channel for receiving */
status = mcbspCreateChan(&hMcbspRxChan, hMcbspDev, MCBSP_MODE_INPUT, &mcbspChanparamRx, mcbspAppCallback, &rxChanMode);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Create Channel (RX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Create Channel (RX) failed\n", coreNum);
return;
}
status = mcbspCreateChan(&hMcbspTxChan, hMcbspDev, MCBSP_MODE_OUTPUT, &mcbspChanparamTx, mcbspAppCallback, &txChanMode);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Create Channel (TX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Create Channel (TX) failed\n", coreNum);
return;
}
edmaTxDone = 0; /* Reset for next iteration */
if ((errBuffCount == 0 ) & (retval ==0))
{
- System_printf("Debug(Core %d): MCBSP Digital Loopback Application completed successfully : "\
+ MCBSP_log("Debug(Core %d): MCBSP Digital Loopback Application completed successfully : "\
"Num iterations %d Num buffers per iteration %d!!!\n",
coreNum, num_iterations, NUM_BUFS);
+ MCBSP_log("\n All tests have passed \n");
}
else
{
- System_printf("Debug(Core %d): MCBSP Digital Loopback application FAILED : "\
+ MCBSP_log("Debug(Core %d): MCBSP Digital Loopback application FAILED : "\
"Num iterations %d Num buffers per iteration %d Failed buffers %d!!!\n",
coreNum, num_iterations, NUM_BUFS, errBuffCount);
}
status = mcbspDeleteChan(hMcbspRxChan);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Delete Channel (RX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Delete Channel (RX) failed\n", coreNum);
return;
}
status = mcbspDeleteChan(hMcbspTxChan);
if (MCBSP_STATUS_COMPLETED != status)
{
- System_printf ("Debug(Core %d): Error: Delete Channel (TX) failed\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Error: Delete Channel (TX) failed\n", coreNum);
return;
}
return;
#ifdef SIMULATOR_SUPPORT
#warn MCBSP Digital Loopback example is not supported on SIMULATOR !!!
- System_printf ("MCBSP Digital Loopback example is not supported on SIMULATOR. Exiting!\n");
+ MCBSP_log ("MCBSP Digital Loopback example is not supported on SIMULATOR. Exiting!\n");
return;
#else
- System_printf ("Debug(Core %d): Running MCBSP Digital Loopback example on the DEVICE\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Running MCBSP Digital Loopback example on the DEVICE\n", coreNum);
#endif
/* Initialize the system only if the core was configured to do so. */
if (coreNum == CORE_SYS_INIT)
{
#if 0
- System_printf ("Debug(Core %d): System Initialization for MCBSP\n", coreNum);
+ MCBSP_log ("Debug(Core %d): System Initialization for MCBSP\n", coreNum);
/* Read FPGA register */
if (0 != (platform_fpgaReadConfigReg(MCBSP_FPGA_MISC_REG_OFFSET, &uchReadValue)))
{
- System_printf ("Debug(Core %d): FPGA McBSP_AMC_EN# register READ failed \n", coreNum);
+ MCBSP_log ("Debug(Core %d): FPGA McBSP_AMC_EN# register READ failed \n", coreNum);
return;
}
/* Clear field for configuration */
* These clocks and syncs are tri-stated and McBSP is accessed over 80-pin header */
if (0 != (platform_fpgaWriteConfigReg(MCBSP_FPGA_MISC_REG_OFFSET, (uchValue))))
{
- System_printf ("Debug(Core %d): FPGA McBSP_AMC_EN# register WRITE failed \n", coreNum);
+ MCBSP_log ("Debug(Core %d): FPGA McBSP_AMC_EN# register WRITE failed \n", coreNum);
return;
}
/* DEBUG: Verify if FPGA register is configured correctly */
if (0 != (platform_fpgaReadConfigReg(MCBSP_FPGA_MISC_REG_OFFSET, &uchReadValue)))
{
- System_printf ("Debug(Core %d): FPGA McBSP_AMC_EN# register READ failed \n", coreNum);
+ MCBSP_log ("Debug(Core %d): FPGA McBSP_AMC_EN# register READ failed \n", coreNum);
return;
}
if (uchValue != uchReadValue)
{
- System_printf ("Debug(Core %d): FPGA McBSP_AMC_EN# register setting failed \n", coreNum);
+ MCBSP_log ("Debug(Core %d): FPGA McBSP_AMC_EN# register setting failed \n", coreNum);
return;
}
else
{
- System_printf ("Debug(Core %d): FPGA McBSP_AMC_EN# register is set to %d \n", coreNum, uchValue);
+ MCBSP_log ("Debug(Core %d): FPGA McBSP_AMC_EN# register is set to %d \n", coreNum, uchValue);
}
#endif
/* MCBSP Driver Initialization: This should always be called before
McbspDevice_init();
/* MCBSP Driver is operational at this time. */
- System_printf ("Debug(Core %d): MCBSP Driver Initialization Done\n", coreNum);
+ MCBSP_log ("Debug(Core %d): MCBSP Driver Initialization Done\n", coreNum);
/* Write to the SHARED memory location at this point in time. The other cores cannot execute
* till the MCBSP Driver is up and running. */
else
{
/* All other cores need to wait for the MCBSP to be initialized before they proceed with the test. */
- System_printf ("Debug(Core %d): Waiting for MCBSP to be initialized.\n", coreNum);
+ MCBSP_log ("Debug(Core %d): Waiting for MCBSP to be initialized.\n", coreNum);
/* All other cores loop around forever till the MCBSP is up and running.
* We need to invalidate the cache so that we always read this from the memory. */
Cache_inv ((void *) &isMCBSPInitialized[0], MCBSP_CACHE_LENGTH, 0x7fff, 1);
- System_printf ("Debug(Core %d): MCBSP can now be used.\n", coreNum);
+ MCBSP_log ("Debug(Core %d): MCBSP can now be used.\n", coreNum);
}
/* Initialize EDMA3 library */
if (edmaResult != EDMA3_DRV_SOK)
{
/* Report EDMA Error */
- System_printf("Debug(Core %d): EDMA Driver Initialization FAILED\n", coreNum);
+ MCBSP_log("Debug(Core %d): EDMA Driver Initialization FAILED\n", coreNum);
}
else
{
- System_printf("Debug(Core %d): EDMA Driver Initialization Done\n", coreNum);
+ MCBSP_log("Debug(Core %d): EDMA Driver Initialization Done\n", coreNum);
}
/* Create the Digital Loopback Application Task */