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.

Problem about DM365EVM with Leopard 5M02 camera board.

        Using the original kernel I tested the decode demos in the dm365EVM SDK, and that works well.

        After patch the kernel with patch Leopard provided, I build the mt9p031 as a module.  Then insmod the driver and running the leopard programme, the sensor works well and returns the fps normally.  But after that I runned the SDK DEMO, I found the cmemk.ko could not be loaded . The message is as below:

./loadmodules_sd.sh
CMEMK module: built on Aug 17 2009 at 03:49:10
  Reference Linux version 2.6.18
  File /projwork/dm365/dvsdk_2_10_01_18/linuxutils_2_24_02/packages/ti/sdo/linux
utils/cmem/src/module/cmemk.c
CMEM Range Overlaps Kernel Physical - allowing overlap
CMEM phys_start (0x85000000) overlaps kernel (0x80000000 -> 0x87400000)
CMEMK Error: Failed to request_mem_region(0x85000000, 50331648)
insmod: error inserting 'cmemk.ko': -1 Bad address
IRQK module: built on Aug 17 2009 at 03:49:13
  Reference Linux version 2.6.18
  File /projwork/dm365/dvsdk_2_10_01_18/linuxutils_2_24_02/packages/ti/sdo/linux
utils/irq/src/module/irqk.c
irqk initialized
EDMAK module: built on Aug 17 2009 at 03:49:13
  Reference Linux version 2.6.18
  File /projwork/dm365/dvsdk_2_10_01_18/linuxutils_2_24_02/packages/ti/sdo/linux
utils/edma/src/module/edmak.c

 

        And the bootargs in U-boot is :

bootargs :'console=ttyS0,115200n8 noinitrd rw ip=192.168.0.41:192.168.0.24:192.168.0.1:255.255.255.0:::off root=/dev/nfs nfsroot=192.168.0.24:/projwork/workdir/filesys,nolock mem=116M video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=3'

        I tried to use 76M as the nolock MEM, but the driver of the mt9p031 can't work with that.

        Is this problem comes from the kernel difference or the bootargs difference? Thanks a lot .

Best Regards;

 

  • This is likely a difference in the kernel and the overall system.  You see, the capture driver (along with other drivers) need to allocate DDR2 memory to carry out their work.  In addition, depending on size of kernel loaded to DDR2 along with any other application running on DDR2, the total size of 'mem=' will vary from system to system. 

    For IPNC, it appears they hace decided their system would require mem=116M.  This larger size may be due because their Linux system has not been optimized to fit in a smaller foot print yet, or maybe becuase it really cannot fit into a smaller memory foot-print.  I am not familiar enough with IPNC design to make this call.  Are they doing any encoding/decoding on this reference design?  If so, what resolutions?

    For our EVM, we set mem=76M and made sure that our Linux system is small enough to fit in the memory foot-print.  The motivation for this is that we wanted to support a large enough CMEM memory foot-print to accomodate encoding and decoding of HD video resolutions (which can take much memory, specially if you are doing double and/or tripple buffering like our demos do).

    To have both demos and IPNC app working in a single system, you may need to 1) optimize IPNC Linux system as much as feasible 2) rearrange CMEM to fit in smaller foot-print and change demos to use this smaller foot-print (e.g. eliminate tripple buffering, number of active windows, or support for higher resolutions).

  • Juan,

     

    I think you may have confused the Appro IPNC camera with the setup listed above which is the DM365 EVM with the Leopard Imaging Camera Daughter card with the MT9P031 sensor onboard.  I was having the same problem with CMEM not loading and I never got around the issue.  (See: http://e2e.ti.com/forums/t/10097.aspx ).

     

    I did manage to get video out of the camera so the Leopard code is most likely not using CMEM buffers.  I did not dig into to it after I got the camera to produce video, but would be interested in the solution if it comes up.

     

    Thanks,

    Jim

  • Hi Jmalone,

    Seems that u have the same problem with me. I have some troubles about running Leopard programmes.

    After insmod the mt9p031 drivers, running the ipipe_aew programme and the messages on the console seems the programme runs successful, but I can't see video display on the monitor.

    The message is as below:

    root@192.168.0.41:/opt/dvsdk# insmod mt9p031.ko
    vpfe ccdc capture vpfe ccdc capture.1: vpif_register_decoder: decoder = MT9P031
    root@192.168.0.41:/opt/dvsdk# ./ipipe_aew -v 31 &
    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:108
    [1] 785
    opening resize device
    Successfully setdavinci_previewer davinci_previewer.2: ipipe_set_preview_config
    davinci_previewer davinci_previewer.2: ipipe_set_preview_config

    default configuration setting in Resizer successfull
    Resizer ivpfe ccdc capture vpfe ccdc capture.1: IMP chained
    nitialized
    Opervpfe ccdc capture vpfe ccdc capture.1: Resizer present
    ating mode changed successfully to continuous in previewerSetting default config
    uration in previewer
    default configuration setting in previewer successfull
    Setting default for LUT Defect Correction
    Setting default for OTF Defect Pixel Correction
    Setting default for 2-D Noise filter - 1
    Setting default for 2-D Noise filter - 2
    Setting default for Green Imbalance Correction
    previewer -- set wb gain
    Setting default for CFA Interpolation
    previewer -- set rgb2rgb param
    Setting default for Gamma Correction
    Setting default for RGB-RGB Conversion - 2
    Setting default for 3D LUT
    Setting default for RGB-YCbCr conversion
    Setting default for Global Brightness,Contrast Control
    Setting default for YUV 422 conversion
    Setting default for Edge Enhancer
    Setting default for Chromatic Artifact Reduction
    Setting default for Chromatic Gain Suppression
    previewer initialized
    input_std_params: name = V4L2_STD_MT9P031_480p_30FPS
    input_std_params: scan width = 720
    input_std_params: scan height = 480
    input_std_params: output width = 720
    input_std_params: output height = 480
    init_camera_capture(): setting data format, width = 720, height = 480
    root@192.168.0.41:/opt/dvsdk# MUX: initialized GPIO40
    mt9p031 chip version reg = 1801
    mt9p031_set_format_params height = 1919, width = 2559
    setting data format, width = 720, height = 480
    set_data_format:setting std to 0
    camera_input =RAW-1
    input.name = RAW
    camera_input =RAW-1
    input.name = COMPOSITE
    camera_input =RAW-1
    input.name = SVIDEO
    camera_input =RAW-1
    input.name = COMPONENT
    camera_input =RAW-1
    input.name = RAW-1
    ----------camera_input =RAW-1--------
    ----------input.name = RAW-1---------
    ----------input.index = 4--------
    mt9p031 chip version reg = 1801
    mt9p031_set_format_params height = 1919, width = 2559
    mt9p031_set_format_params height = 1465, width = 2207
    InitDevice:ioctl:VIDIOC_S_INPUT, selected input

    Calling configCCDCraw()
    pix_fmt = 0
    frm_fmt = 0
    fid_pol = 0
    vd_pol = 0
    hd_pol = 0
    data_size = 4
    data_shift = 0
    test_pat_gen = 0
    win.width = 640
    win.height = 480
    module_params.culling.hcpat_odd = 0xff
    module_params.culling.hcpat_even = 0xff

    configCCDCraw Done

    S_STD Done
    vpfe ccdc capture vpfe ccdc capture.1: hpitch = 720, vpitch = 480, bpp = 2

    GetSTD Done WITH std = 0
    set_data_format:requesting width:720 height:480
    Setting format to V4L2_PIX_FMT_UYVYDavinciDisplay DavinciDisplay.1: Before finis
    hing with S_FMT:
    layer.pix_fmt.bytesperline = 1440,
     layer.pix_fmt.width = 720,
     layer.pix_fmt.height = 480,
     layer.pix_fmt.sizeimage =691200
     at capture

    SDavinciDisplay DavinciDisplay.1: pixfmt->width = 720,
     layer->layer_info.config.line_length= 1440
    _FMT Done
    initiStarting ccdc_config_raw..
    alizing capture starting ccdc_reset...buffers

    REQBU<7>
    End of ccdc_reset...F Done

    QUERYB<7>Writing 0x2 to ...CCDCFG
    UF Done
    captureStarting ccdc_setwin... buffer = 0x8400<7>
    End of ccdc_config_ycbcr...
    0000

    QUERYBUF Done
    capture buffer = 0x84800000

    QUERYBUF Done
    capture buffer = 0x83000000

    QUERYBUF Done
    capture buffer = 0x81000000

    QUERYBUF Done
    capture buffer = 0x81800000
    Capture initialized
    ---------init_display_device():width = 720 ,height = 480--------
    /sys/class/davinci_display/ch0/output was opened successfully
    Current output value is COMPOSITE

    Changed output to COMPOSITE

    /sys/class/davinci_display/ch0/mode was opened successfully
    Current mode value is NTSC

    Changed mode to PAL

    Setting display pixel format to V4L2_PIX_FMT_UYVY
    Initialized display
    Queing buffer:0

    Q_BUF Done
    Queing buffer:1

    Q_BUF Done
    Queing buffer:2

    Q_BUF Done
    Queing buffer:3

    Q_BUF Done
    Queing buffer:4

    Q_BUF Done

    STREAMON Done
    5. Test enque first buffer
    6. Test enqueuing of buffers - done
    5. Test enque second buffer
    6. Test enqueuing of buffers - done
    7. Test STREAM_ON

    fps = 25.00

     

     

    Thanks for your help.

  • Hi Leon Yin,

    Your issue is most likely the same one I discovered.  Notice the mode is being changed to PAL but it looks like your bootargs are setting the system up for NTSC.  Therefore, I am assuming you are intending to use NTSC.

    Leon Yin said:
    /sys/class/davinci_display/ch0/mode was opened successfully
    Current mode value is NTSC

    Changed mode to PAL

     

    In the software from Leopard in the path "dm365_2A_N_sensor_drivers/libaewdm365_1.0/ipipe_aew_demo" there should be an "ipipe_example.c" file.  In this file, there is an "init_display_device" function.  In that function is the following code snippet:

    printf("----------init_display_device():width = %d ,height = %d--------\n",width,height);

    if(width <=720 && height <= 480)

    {

            strcpy(output, DISPLAY_INTERFACE_COMPOSITE);

            strcpy(mode, DISPLAY_MODE_PAL);

            fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;

    }

    else if ....

    Change the DISPLAY_MODE_PAL to DISPLAY_MODE_NTSC and you should get video out the composite output and the frame rate should change to 29.97 (At the very end of you post if says fps=25.00 which is PAL).

     

    This worked for me and is not the ultimate fix to the code, but it was quick and easy.

    Jim