This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR6843: Create CBUFF Hardware Session Fails

Part Number: IWR6843

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

  • Hi, have you tried running the SDK's mmw demo with LVDS enabled?  Section 3.3.2 of the SDK's user guide provides instructions on doing this.

    As for the CBUFF_createSession error, sometimes it helps to step through the function to see where it's going wrong.  Depending on your tolerance for strange debugger behavior, you can rebuild the CBUFF driver after modifying C:\ti\mmwave_sdk_03_04_00_03\packages\ti\common\mmwave_sdk.mak to change the -O3 flag under RF4_CFLAGS to -O0 (when the code is highly optimized, the debugger has difficulty tracking which line of code the PC is actually on). The SDK user guide provides instructions for rebuilding driver libraries.

     -dave

  • hey,

    thanks for the advice. It help me solving the problem. I will list my error, so someone who might find this thread could get a hint for his problem.

    First and biggest fault:

    I thought, that there are no .c files for the drivers like cbuff etc. so i did not debug into the corresponding functions.

    Second:

    With debugging into the CBUFF_createSession i found out, that i was creating the session before the ADCbuffer was fulling initialized. So it was a timing problem

    Last one:

    I configured the Session with DataMode = Interleaved. Which is not supported by the IWR6843 as mentioned in different Manuals/Guides.

    So thanks for helping me out