Hey,
i am trying to configure the CBUFF in the IWR6843 to stream the Raw ADC Data thru the LVDS to the DCA1000 and then to the PC. It works fine by using the Mmwave Studio.
It is also working fine, when i configure a Software Session in the CBUFF driver and hand it some basic array data. So following Code is working fine (the array "testdata" just contains some numbers):
int32_t errCode = 0; CBUFF_Handle cbuffHandle; CBUFF_InitCfg cbuffInitCfg; CBUFF_LVDSCfg lvdsConfig; memset((void*) &lvdsConfig, 0, sizeof(CBUFF_LVDSCfg)); lvdsConfig.crcEnable = 0U; lvdsConfig.ddrClockMode = 1U; lvdsConfig.ddrClockModeMux = 1U; lvdsConfig.lvdsLaneEnable = 0x3U; lvdsConfig.msbFirst = 1U; memset((void*) &cbuffInitCfg, 0, sizeof(CBUFF_InitCfg)); cbuffInitCfg.socHandle = MCB.socHandle; cbuffInitCfg.enableDebugMode = false; cbuffInitCfg.crcEnable = 1U; cbuffInitCfg.enableDebugMode = 0U; cbuffInitCfg.enableECC = 0U; cbuffInitCfg.interface = CBUFF_Interface_LVDS; cbuffInitCfg.maxSessions = 1U; cbuffInitCfg.outputDataFmt = CBUFF_OutputDataFmt_16bit; cbuffInitCfg.u.lvdsCfg = lvdsConfig; cbuffHandle = CBUFF_init(&cbuffInitCfg, &errCode); if (cbuffHandle == NULL) { System_printf("Error in CBUFF init [Error code %d]\n", errCode); return; } CBUFF_SessionCfg sessionCfg; memset((void*)&sessionCfg, 0, sizeof(CBUFF_SessionCfg)); sessionCfg.allocateEDMAChannelFxn = MmwDemo_LVDSStream_EDMAAllocateCBUFFSwChannel; sessionCfg.edmaHandle = edmaHandles[1]; sessionCfg.freeEDMAChannelFxn = MmwDemo_LVDSStream_EDMAFreeCBUFFSwChannel; sessionCfg.dataType = CBUFF_DataType_COMPLEX; sessionCfg.executionMode = CBUFF_SessionExecuteMode_SW; sessionCfg.frameDoneCallbackFxn = NULL; sessionCfg.header.size = 0; sessionCfg.u.swCfg.userBufferInfo[0].address = (uint32_t) &testdata; sessionCfg.u.swCfg.userBufferInfo[0].size = 512; cbuffSessionHandle = CBUFF_createSession(cbuffHandle, &sessionCfg, &errCode); if (cbuffSessionHandle == NULL) { System_printf("Error: CBUFF Session could not be created [Error Code %d]\n",errCode); return; }
As you can see, I just copied some functions from the MmwDemo_LVDSStream (some init functions for the EMDA, Callbacks and so on). As i said, it works fine.
Now I am trying to change it to the HW-Session to stream the Raw ADC Data. So change is:
if (TestFmk_ioctl(MCB.fmkHandle,TEST_FMK_CMD_GET_ADCBUF_HANDLE, (void*) &adcHandle,sizeof(adcHandle), &errCode) < 0) { System_printf("Error: Cant get ADCHandle [Error Code %d]\n",errCode); return; } sessionCfg.allocateEDMAChannelFxn = MmwDemo_LVDSStream_EDMAAllocateCBUFFHwChannel; sessionCfg.edmaHandle = edmaHandles[1]; sessionCfg.freeEDMAChannelFxn = MmwDemo_LVDSStream_EDMAFreeCBUFFHwChannel; sessionCfg.dataType = CBUFF_DataType_COMPLEX; sessionCfg.executionMode = CBUFF_SessionExecuteMode_HW; sessionCfg.frameDoneCallbackFxn = NULL; sessionCfg.header.size = 0U; sessionCfg.header.address = 0U; sessionCfg.u.hwCfg.adcBufHandle = adcHandle; sessionCfg.u.hwCfg.chirpMode = 1U; sessionCfg.u.hwCfg.dataFormat = CBUFF_DataFmt_ADC_DATA; sessionCfg.u.hwCfg.dataMode = CBUFF_DataMode_INTERLEAVED; sessionCfg.u.hwCfg.numADCSamples = 256; sessionCfg.u.hwCfg.numChirpsPerFrame = 96; sessionCfg.u.hwCfg.opMode = CBUFF_OperationalMode_CHIRP;
Now when calling CBUFF_createSession it returns with a "Invalid Argument" Error. But i cannot find an invalid argument. The configuration is the same as in the SDK CSI Example for the xWR14xx.
Any suggestions where to find my error and the Invalid argument?
Thanks