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.

Linux/TDA2PXEVM: how to dump csi2 mipi raw data

Part Number: TDA2PXEVM


Tool/software: Linux

Hi,

we are debuging camera sensor driver, we need dump raw data.

could you tell us how to dump csi2 mipi raw data?

thanks

  • Hi Jack,

    Why do you want to dump raw mipi data?
    You could dump raw linear data from the capture module. If you are using single channel iss usecase, there is a option on the console menu to dump capture data into sd card..

    Regards,
    Brijesh
  • Hi Brijesh,

    Our sensor not output standard raw data, so we need dump the raw data and analyze.

    We run linux usecase, we found no dump menu.

    We have tried to get the raw data and write to file. But no permission to access the data.

    Could you tell us how to dump raw data in Linux usecase and how to copy kernel data to user?

    Thanks

  • Hi Brijesh,

    We choose tda2px_evm_linux_all, so we can't use Utils_fileWriteFile save data to file.

    Could you tell us how to save data to file in RTOS?

    Thanks
  • Hi Jack,

    oh ok, i was thinking it is BIOS usecase. 

    For Linux, you should use OSA APIs like OSA_fileWriteFile from the file vision_sdk\links_fw\src\hlos\osa\src\osa_file.c. 

    here is a control command in the capture link to dump the captured frame into a buffer and then return the buffer address. Then you could this buffer address to write captured frame into file using OSA APIs. I am pasting below example code from the BIOS. You could add one runtime option in the usecase and write captured frame to a file.

    /* Send command to Capture Link to save a frame */
    System_linkControl(
    chainsObj.ucObj.IssCaptureLinkID,
    ISSCAPTURE_LINK_CMD_SAVE_FRAME,
    &chId,
    sizeof(chId),
    TRUE);

    do {
    System_linkControl(
    chainsObj.ucObj.IssCaptureLinkID,
    ISSCAPTURE_LINK_CMD_GET_SAVE_FRAME_STATUS,
    &rawSaveFrameStatus,
    sizeof(IssCaptureLink_GetSaveFrameStatus),
    TRUE);

    } while (rawSaveFrameStatus.isSaveFrameComplete == FALSE);
    CapImCounter = xUtils_nextAvailableFile( fName, "raw%04u.raw", CapImCounter );

    status = Utils_fileWriteFile( fName, (UInt8*)rawSaveFrameStatus.bufAddr, rawSaveFrameStatus.bufSize);

    sprintf( fName, "raw%04u.txt", CapImCounter );

    if(status)
    {
    Vps_printf("Error %d: Error performing file write\n",status);
    xUtils_fileWriteInfo( fName, "RAW, Error" );
    } else {
    Vps_printf("Wrote image %s to file\n",fName);
    xUtils_fileWriteInfo( fName, "RAW, OK" );
    }

  • Hi Brijesh,

    we got under log:

    [HOST] ZZZXXX [FILE ] Writing to file [raw0000.raw] (3686400 bytes) ... [HOST] [IPU2 ] 62.207497 s: *********************************************
    [HOST] [IPU2 ] 62.207588 s: ####### Save Frame from location 0x84c8f000 #######
    [HOST] [IPU2 ] 62.207680 s: saveRaw(0, 0x84c8f000, filename, 921600, 32, false);
    [HOST] [IPU2 ] 62.207771 s: *********************************************

    ****** Segmentation fault caught ....
    Faulty address is 0x84c8f000, called from 0xb6bd6129
    Totally Obtained 0 stack frames. signal number =11
    Signal number = 11, Signal errno = 0
    SI code = 1 (Address not mapped to object)
    Fault addr = 0x84c8f000
    [bt] Execution path:
    root@dra7xx-evm:/opt/vision_sdk# [ 58.279694] virtio_rpmsg_bus virtio2: msg received with no recipient


    please help analyze the issue.

    Thanks
  • Hi Jack,

    I think the ioctl returns the physical address and Linux requires virtual address, can you call OSA_phystovirt API to convert physical address to virtual and then pass virtual address to file write API?

    Rgds,
    Brijesh