hi,
When I try to combine capture demo into MMW demo, which only set LVDS output while common chirp processing is enabled. (SDK1.1)
The main part of modification is adding CaptureDemo_configureStreaming function and other modification is as attachment:
The main problem is, when code ran into rlDeviceSetHsiClk function, and it will come out some error :
[C674X_0] Heap L1 : size 16384 (0x4000), free 14848 (0x3a00)
Heap L2 : size 32768 (0x8000), free 26088 (0x65e8)
Heap L3 : size 655360 (0xa0000), free 617472 (0x96c00)
A0=0x0 A1=0x1
A2=0x700 A3=0x8158a8
A4=0x813160 A5=0x813224
A6=0x0 A7=0x813456
A8=0x2 A9=0x12
A10=0x0 A11=0x81317c
A12=0x0 A13=0x0
A14=0x0 A15=0x0
A16=0x44a4321 A17=0x0
code:
static int32_t CaptureDemo_configureStreaming
(
MmwDemo_DSS_DataPathObj* dataPathObj
)
{
CBUFF_InitCfg initCfg;
CBUFF_SessionCfg sessionCfg;
rlDevHsiClk_t hsiClkgs;
int32_t errCode;
int32_t retVal = -1;
uint8_t index;
/* Initialize the CBUFF Initialization configuration: */
memset ((void *)&initCfg, 0, sizeof(CBUFF_InitCfg));
/* Populate the configuration: */
initCfg.socHandle = gMmwDssMCB.socHandle;
initCfg.enableECC = 0U;
initCfg.crcEnable = 1U;
initCfg.maxSessions = 2U;
initCfg.enableDebugMode = false;
initCfg.interface = CBUFF_Interface_LVDS;
initCfg.u.lvdsCfg.crcEnable = 0U;
initCfg.u.lvdsCfg.msbFirst = 1U;
initCfg.u.lvdsCfg.lvdsLaneEnable = 0x3U;
initCfg.u.lvdsCfg.ddrClockMode = 1U;
initCfg.u.lvdsCfg.ddrClockModeMux= 1U;
initCfg.outputDataFmt = CBUFF_OutputDataFmt_16bit;
/* Initialize the CBUFF Driver: */
gMmwDssMCB.cbuffHandle = CBUFF_init(&initCfg, &errCode);
if (gMmwDssMCB.cbuffHandle == NULL)
{
/* Error: Unable to initialize the CBUFF; report the error */
System_printf("Error: CBUFF Driver initialization failed [Error code %d]\n", errCode);
goto exit;
}
/* Initialize the session configuration: */
memset((void*)&sessionCfg, 0, sizeof(CBUFF_SessionCfg));
/* Populate the configuration: */
sessionCfg.executionMode = CBUFF_SessionExecuteMode_HW;
sessionCfg.edmaHandle = dataPathObj->context->edmaHandle;
sessionCfg.allocateEDMAChannelFxn = CaptureDemo_EDMAAllocateCBUFFChannel;
sessionCfg.freeEDMAChannelFxn = CaptureDemo_EDMAFreeCBUFFChannel;
sessionCfg.frameDoneCallbackFxn = CaptureDemo_HwTriggerFrameDone;
sessionCfg.dataType = CBUFF_DataType_COMPLEX;
sessionCfg.u.hwCfg.dataMode = CBUFF_DataMode_NON_INTERLEAVED;
sessionCfg.u.hwCfg.dataFormat = CBUFF_DataFmt_ADC_DATA;
/* Setup all the channels which are active: */
for (index = 0; index < SYS_COMMON_NUM_RX_CHANNEL; index++)
{
/* Is the channel enabled? */
if (gMmwDssMCB.cfg.openCfg.chCfg.rxChannelEn & (0x1 << index))
{
sessionCfg.u.hwCfg.rxChannelStatus[index] = CBUFF_RxChannelStatus_ACTIVE;
sessionCfg.u.hwCfg.headerCfg.adcBufferHeader[index].size = 0;
sessionCfg.u.hwCfg.headerCfg.adcBufferHeader[index].address = 0;
}
}
sessionCfg.u.hwCfg.headerMode = CBUFF_HeaderMode_NONE;
/* Initialize and setup the header(s): */
sessionCfg.u.hwCfg.headerCfg.continuousHeader.size = 0;
sessionCfg.u.hwCfg.headerCfg.continuousHeader.address = 0;
sessionCfg.u.hwCfg.headerCfg.userBufferHeader[0].size = 0;
sessionCfg.u.hwCfg.headerCfg.userBufferHeader[0].address = 0;
/* Setup the user buffer: */
sessionCfg.u.hwCfg.userBufferInfo[0].size = 0;
sessionCfg.u.hwCfg.userBufferInfo[0].address = 0;
sessionCfg.u.hwCfg.numChirpsPerFrame = dataPathObj->numChirpsPerFrame;
sessionCfg.u.hwCfg.numADCSamples = dataPathObj->numAdcSamples;
sessionCfg.u.hwCfg.opMode = CBUFF_OperationalMode_CHIRP;
/* Create the session: */
gMmwDssMCB.hwSessionHandle = CBUFF_createSession(gMmwDssMCB.cbuffHandle, &sessionCfg, &errCode);
if (gMmwDssMCB.hwSessionHandle == NULL)
{
System_printf("Error: Unable to create the CBUFF Session [Error code %d]\n", errCode);
retVal = -1;
goto exit;
}
if (CBUFF_activateSession(gMmwDssMCB.hwSessionHandle, &errCode) < 0)
{
System_printf("Error: Unable to activate the CBUFF Session [Error code %d]\n", errCode);
retVal = -1;
goto exit;
}
/*************************************************************************************
* Setup the HSI Clock through the mmWave Link:
*************************************************************************************/
memset ((void*)&hsiClkgs, 0, sizeof(rlDevHsiClk_t));
/* Setup the HSI Clock as per the Radar Interface Document: This is set to 900Mhtz DDR Mode */
hsiClkgs.hsiClk = 0xD;
/* Setup the HSI in the radar link: */
retVal = rlDeviceSetHsiClk(RL_DEVICE_MAP_CASCADED_1, &hsiClkgs);
if (retVal != RL_RET_CODE_OK)
{
/* Error: Unable to set the HSI clock */
System_printf ("Error: Setting up the HSI Clock in BSS Failed [Error %d]\n", retVal);
goto exit;
}
/* Setup the return value as the CBUFF streaming has been configured successfully */
retVal = 0;
exit:
return retVal;
}