summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 4b53ebb)
raw | patch | inline | side by side (from parent 1: 4b53ebb)
author | Sinthu Raja M <x0257345@ti.com> | |
Tue, 24 Jul 2018 11:19:07 +0000 (16:49 +0530) | ||
committer | Sinthu Raja M <x0257345@ti.com> | |
Tue, 24 Jul 2018 11:19:07 +0000 (16:49 +0530) |
Add UART print function to print messages on to the UART console.
Add unit test print phrase Äll unit test have passed
Add unit test print phrase Äll unit test have passed
diff --git a/example/c6657/MCBSPDigLpbk/MCBSP_evmc6657_C66DigLpbkExampleProject.txt b/example/c6657/MCBSPDigLpbk/MCBSP_evmc6657_C66DigLpbkExampleProject.txt
index d5967ca0d3959cbce313107796054c4109de5447..1c429a48109b5caa3c323e9311d6be4cd131ac5e 100644 (file)
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/c6657/MCBSPDigLpbk/mcbspMasterDigLpbk.cfg"
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/c6657/MCBSPDigLpbk/mcbspMasterDigLpbk_osal.c"
--ccs.setCompilerOptions "-DSOC_C6657 -DMCBSP_DEBUG_TEMP -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/c6657/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
+-ccs.setCompilerOptions "-DSOC_C6657 -DMCBSP_DEBUG_TEMP -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/c6657/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
diff --git a/example/c6657/MCBSPDigLpbk/mcbspMasterDigLpbk.c b/example/c6657/MCBSPDigLpbk/mcbspMasterDigLpbk.c
index e2f11b2ed7d0014ec990086965aca0152d0d4fa7..22a7fa9672e05ca256e2d1be417d9b33387f7d8d 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);
}
/* Enabling the dmaChannel MCBSP Events to EDMA (36-40) */
temp=sampleEdma3GblCfgParams[0].dmaChannelHwEvtMap[1];
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 */
diff --git a/example/c674x/MCBSPDigLpbk/MCBSP_DigLpbkC66ExampleProject.txt b/example/c674x/MCBSPDigLpbk/MCBSP_DigLpbkC66ExampleProject.txt
index 433f4cbeb09e211a5f266d5bf2141460b453ef2b..2565bf5e5d10c66cface8ff465c12e6fef1375b5 100644 (file)
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/c674x/MCBSPDigLpbk/sample_cs.c"
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/c674x/MCBSPDigLpbk/sample_init.c"
--ccs.setCompilerOptions "-Domapl138 -DMCBSP_DEBUG_TEMP -mv6740 -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
+-ccs.setCompilerOptions "-Domapl138 -DMCBSP_DEBUG_TEMP -mv6740 -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
diff --git a/example/c674x/MCBSPDigLpbk/mcbspMasterDigLpbk.c b/example/c674x/MCBSPDigLpbk/mcbspMasterDigLpbk.c
index 688d7822ce31edb76c247e4ac8d9c2a216ff8335..005508e249a75a8f9b337035845251a6d0c7feae 100644 (file)
#include <ti/drv/mcbsp/mcbsp_drv.h>
#include <ti/drv/mcbsp/mcbsp_osal.h>
#include <board.h>
+#include <MCBSP_log.h>
/* PlatformLib Include File */
//#include <ti/platform/platform.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 */
diff --git a/example/include/MCBSP_log.h b/example/include/MCBSP_log.h
--- /dev/null
@@ -0,0 +1,77 @@
+/**
+ * \file MCBSP_log.h
+ *
+ * \brief This file contains the prototypes for the log print functions. By
+ default the prints will be directed to serial console using UART.
+ *
+ */
+
+/*
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _MCBSP_LOG_H
+#define _MCBSP_LOG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+
+/* UART Header files */
+#include <ti/drv/uart/UART.h>
+#include <ti/drv/uart/UART_stdio.h>
+
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+extern void UART_printf(const char *pcString, ...);
+extern void ConsoleUtilsInit(void);
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+/* Enable the below macro to have prints on the IO Console */
+//#define IO_CONSOLE
+
+#ifndef IO_CONSOLE
+#define MCBSP_log UART_printf
+#else
+#define MCBSP_log System_printf
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MCBSP_LOG_H */
diff --git a/example/k2g/MCBSPDigLpbk/MCBSP_DigLpbkevmK2Gc66ExampleProject.txt b/example/k2g/MCBSPDigLpbk/MCBSP_DigLpbkevmK2Gc66ExampleProject.txt
index ae0e011c3cf029c94826b34282b5416976879c14..3b4f5ff32226012a73b5ae464d982da627d41413 100644 (file)
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/k2g/MCBSPDigLpbk/sample_cs.c"
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/k2g/MCBSPDigLpbk/sample_init.c"
--ccs.setCompilerOptions "-DDEVICE_K2G -DMCBSP_DEBUG_TEMP -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/k2g/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
+-ccs.setCompilerOptions "-DDEVICE_K2G -DMCBSP_DEBUG_TEMP -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/k2g/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
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 */
diff --git a/example/omapl138/MCBSPDigLpbk/MCBSP_DigLpbk_lcdkOMAPL138_c674xExampleProject.txt b/example/omapl138/MCBSPDigLpbk/MCBSP_DigLpbk_lcdkOMAPL138_c674xExampleProject.txt
index a9eb08f202eccac7af64ddb682039f412e13366b..6ef721e68ddfface5eeb6464ace9f72bea3235c8 100644 (file)
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/omapl138/MCBSPDigLpbk/sample_cs.c"
-ccs.linkFile "${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/omapl138/MCBSPDigLpbk/sample_init.c"
--ccs.setCompilerOptions "-mv6740 --abi=eabi -g --define=SOC_OMAPL138 --define=LCDK_OMAPL138 -DMCBSP_DEBUG_TEMP -mv6740 -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/omapl138/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
+-ccs.setCompilerOptions "-mv6740 --abi=eabi -g --define=SOC_OMAPL138 --define=LCDK_OMAPL138 -DMCBSP_DEBUG_TEMP -mv6740 -g --diag_warning=225 -I${PDK_INSTALL_PATH} -I${BIOS_INSTALL_PATH}/packages -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/omapl138/MCBSPDigLpbk -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/example/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp/include -I${PDK_INSTALL_PATH}/ti/drv/mcbsp -I${PDK_INSTALL_PATH}/ti/board" -rtsc.enableRtsc
diff --git a/example/omapl138/MCBSPDigLpbk/mcbspMasterDigLpbk.c b/example/omapl138/MCBSPDigLpbk/mcbspMasterDigLpbk.c
index 3426cd119fbaa52ac6db43be55771fef901f0ea4..86516a1d580ed3f7e664dd5addbfd311e10ccdd4 100644 (file)
#include <ti/drv/mcbsp/mcbsp_drv.h>
#include <ti/drv/mcbsp/mcbsp_osal.h>
#include <board.h>
+#include <MCBSP_log.h>
/* PlatformLib Include File */
//#include <ti/platform/platform.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 */