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.

TDA3XEVM: Frame Number (counter) from IssCapture

Part Number: TDA3XEVM

Hi,

Does IssCapture provide a frame counter for each channel it hands over to the next link in the chain? If so, which is the exact parameter or in which data structure does this info resides? I would like to consume this counter in the subsequent Link. If not, please provide detail instruction to safely modify the code and add this info in a data structure that hands down from IssCapture link to the lower link.

Thanks,

--Khai

  • Hi Khai,

    The current capture link does not support frame counter/number. You could add in in the system frame, populate in the capture link and copy it every link in you chain from input to output system buffer.

    Rgds,

    Brijesh

  • Hi Brijesh,

    Thanks for the tips on adding the frame counter. I was able to add the frame counter and it replicates down to lower links and eventually out to Ethernet when external Host request the RDM data. I added this frame counter to the RDM metadata on a per frame basis.

    Reason I was interested in adding the frame counter was that I observed that the RDM frames received over Ethernet on the Host were out of order. Therefore, I had to confirm that was the case by adding a frame counter. Adding the frame counter led to some very interesting discovery that I would have known if I didn't do this exercise. I seriously need to be on a call with you guys to help me understand how IssCapture really works. Somehow I got 6 chirp ADC frames for every frame counter incremented on the per framePeriodicity defined for the chirp frame. I need someone of Piyali expertise to be on a call to help walk me thru understanding of the capture framework.

    Thanks,

    --Khai

  • Here is the data that show the FFT Link processed and output old frames thus frames received over Ethernet on the Host PC is back in time:

    [IPU1-0]     15.280577 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 1.0
    [IPU1-0]     15.280790 s: IssCaptureLink_drvProcessData: frame1, 1.0
    [DSP1  ]     15.283535 s: AlgorithmFxn_RadarFftProcess - frame 1, angle 1.0
    [IPU1-0]     15.380650 s: IssCaptureLink_drvProcessData: frame2, 1.0
    [DSP1  ]     15.383395 s: AlgorithmFxn_RadarFftProcess - frame 0, angle 0.0
    [IPU1-0]     15.480601 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 2.0
    [IPU1-0]     15.480784 s: IssCaptureLink_drvProcessData: frame3, 2.0
    [DSP1  ]     15.483529 s: AlgorithmFxn_RadarFftProcess - frame 0, angle 0.0
    [IPU1-0]     15.580674 s: IssCaptureLink_drvProcessData: frame4, 2.0
    [DSP1  ]     15.583419 s: AlgorithmFxn_RadarFftProcess - frame 4, angle 2.0
    [IPU1-0]     15.680595 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 3.0
    [IPU1-0]     15.680808 s: IssCaptureLink_drvProcessData: frame5, 3.0
    [DSP1  ]     15.683553 s: AlgorithmFxn_RadarFftProcess - frame 0, angle 0.0
    [IPU1-0]     15.780668 s: IssCaptureLink_drvProcessData: frame6, 3.0
    [DSP1  ]     15.783413 s: AlgorithmFxn_RadarFftProcess - frame 0, angle 0.0
    [IPU1-0]     15.880619 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 4.0
    [IPU1-0]     15.880833 s: IssCaptureLink_drvProcessData: frame7, 4.0
    [DSP1  ]     15.883578 s: AlgorithmFxn_RadarFftProcess - frame 1, angle 1.0
    [IPU1-0]     15.980692 s: IssCaptureLink_drvProcessData: frame8, 4.0
    [DSP1  ]     15.983438 s: AlgorithmFxn_RadarFftProcess - frame 0, angle 0.0
    [IPU1-0]     16.080613 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 5.0
    [IPU1-0]     16.080827 s: IssCaptureLink_drvProcessData: frame9, 5.0
    [DSP1  ]     16.083572 s: AlgorithmFxn_RadarFftProcess - frame 0, angle 0.0
    [IPU1-0]     16.180686 s: IssCaptureLink_drvProcessData: frame10, 5.0
    [DSP1  ]     16.183431 s: AlgorithmFxn_RadarFftProcess - frame 10, angle 5.0
    [IPU1-0]     16.280638 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 6.0
    [IPU1-0]     16.280821 s: IssCaptureLink_drvProcessData: frame11, 6.0
    [DSP1  ]     16.283566 s: AlgorithmFxn_RadarFftProcess - frame 11, angle 6.0
    [IPU1-0]     16.380680 s: IssCaptureLink_drvProcessData: frame12, 6.0
    [DSP1  ]     16.383456 s: AlgorithmFxn_RadarFftProcess - frame 12, angle 6.0
    [IPU1-0]     16.480631 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 7.0
    [IPU1-0]     16.480845 s: IssCaptureLink_drvProcessData: frame13, 7.0
    [DSP1  ]     16.483590 s: AlgorithmFxn_RadarFftProcess - frame 7, angle 4.0
    [IPU1-0]     16.580705 s: IssCaptureLink_drvProcessData: frame14, 7.0
    [DSP1  ]     16.583450 s: AlgorithmFxn_RadarFftProcess - frame 8, angle 4.0
    [IPU1-0]     16.680656 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 8.0
    [IPU1-0]     16.680869 s: IssCaptureLink_drvProcessData: frame15, 8.0
    [DSP1  ]     16.683584 s: AlgorithmFxn_RadarFftProcess - frame 9, angle 5.0
    [IPU1-0]     16.780729 s: IssCaptureLink_drvProcessData: frame16, 8.0
    [DSP1  ]     16.783444 s: AlgorithmFxn_RadarFftProcess - frame 10, angle 5.0
    [IPU1-0]     16.880650 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 9.0
    [IPU1-0]     16.880863 s: IssCaptureLink_drvProcessData: frame17, 9.0
    [DSP1  ]     16.883608 s: AlgorithmFxn_RadarFftProcess - frame 17, angle 9.0
    [IPU1-0]     16.980723 s: IssCaptureLink_drvProcessData: frame18, 9.0
    [DSP1  ]     16.983499 s: AlgorithmFxn_RadarFftProcess - frame 12, angle 6.0
    [IPU1-0]     17.080674 s: MwBeamSteeringLink_steer: BOTH - Steered angle.az to PSC: 10.0
    [IPU1-0]     17.080888 s: IssCaptureLink_drvProcessData: frame19, 10.0
    [DSP1  ]     17.083602 s: AlgorithmFxn_RadarFftProcess - frame 7, angle 4.0
    [IPU1-0]     17.180747 s: IssCaptureLink_drvProcessData: frame20, 10.0
    Let me explain what I have here:
    - The chirp framePeriodicity is set to 100ms as you can see the time stamp on the left
    - We steer Both TX/RX from 0 -> 10 degrees in phase change. For every phase change, we captured 2 frames of ADC data. FrameId is added in the IssCapture so we can track the frame moment
    - The BOLD lines are the FFT Alg plugin that processed and output the RDMs to NetwrokTx for Ethernet output
    - As you can see, why the FFT Link went back in time mulitple time per frames and output duplicate frames which it already processed? This is what I don't understand and can't seem to track in the code why it's done so.
    Thanks,
    --Khai
  • How did you pass the frame counter info from IPU to DSP?

    It looks like maybe cache coherence was not maintained properly.

  • HI Stanley,

    I can share code that I have if we can schedule a Conf Call.

    How then can I configure/set for cache coherency?

    Thanks,

    --Khai

  • You can call Cache_wb() to do cache writeback on IPU side after updating the buffer.

    Then on DSP side, before reading the buffer, you call Cache_inv() to invalidate the cache.

    You can search for example in SDK.

  • Hi Stanley,

    Your suggestion fixed the out of order frame counter and angle data arrived at PC Host. Although it fixed the problem seen, it seems to slow down the throughput even more. 

    I would like to understand what these 2 calls are doing. My questions:

    1. Why does it go out of order without these two calls?

    2. These two calls seem to somehow synchronize the frame flow with a penalty of slowing down the throughput

    Thanks,

    --Khai

  • Khai,

    1. IPU and DSP both use cache inside its respective subsystem for DDR memory. If IPU doesn't call writeback, the data could still be in cache write buffer instead of DDR until some other writes push the data to DDR. When DSP reads the buffer in DDR, since it was updated by IPU, it would read from its cache first unless doing cache invalidate operation first.

    2. Cache operation takes cycles. In addition, DSP will fetch the data from DDR instead of cache. For large data buffer, we typically use DMA to move data from DDR to internal memory to eliminate the overhead. For very small buffer, like a counter, you can try to use uncached memory.

  • "Uncached memory"? How do I specify a data structure to be allocated in uncached memory that can be written to from IPU and read from DSP?

    Thanks,

    --Khai

  • Please call Utils_memAlloc() with Heap ID = UTILS_HEAPID_DDR_NON_CACHED_SR0 to allocate memory from non cached region.

  • Hi Stanley,

    BTW, using the Utils_mem() call to allocated uncached memory didn't work. After bootup, there wasn't any activity for a while and then I got continue error printing MBX something something error.

    Do you have any idea?

    Thanks,

    --Khai

  • Sorry, just didn't recall the exact API name. That was what I used but got error

  • Hi Stanley,

    I did use this API call to allocated metadata buffers in IssCapture create function and write the angle data to it in the process function. The board booted up but no activity for a while and then printed out MBX something something error. I am not sure why it happened so didn't work.

    Thanks,

    --Khai

  • FYI, I removed all calls to CacheWB in issCapture and Cache Invert in DSP FFT Code

  • It's possible there is no free memory for that section.

    Please following the instruction provided under 6.3 in the below document to add a new memory section in non-cached memory region.

    ~/vision_sdk/docs/FeatureSpecificUserGuides/VisionSDK_UserGuide_MemoryMap.pdf

    Then you can assign your data object to this new memory section.

  • Thanks, will try that out and let you know.

    Regards,

    --Khai