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.

AM69A: CSI cameras for AM68A / AM69A EVM?

Part Number: AM69A
Other Parts Discussed in Thread: AM68A, TDA4VM, AM69

Champs:

#1.

What's the recommended CSI cameras for AM68A + AM69A?

Do we have the AVL camera modules for the customers?

#2.

Where is the demo guide for AM68A/ AM69A CSI cameras running with AI?

BR Rio

  • Hi Karan:

    Thanks for helping.

    I'm use these 2 EVM:

    https://www.ti.com/tool/SK-AM68 

    https://www.ti.com/tool/SK-AM69 

    BR Rio

  • Champs:

    I have experienced the EdgeAI EVM with 2 CSI cameras.

    So, I think those 2 CSI cameras shall work with AM68A/AM69A evm as well?

    BR Rio

  • Hi Karan:

    Thanks, Some questions:

    A. How about AM69A cameras?

    B. I need to make 2 CSI cameras running on AM68A + AM69A.

        So, dual cameras are functional ?

    BR Rio

  • Hi Karan:

    I have activated 2 CSI IMX390 on AM69A. The log is as the below.

    am69a-sk login: root
    CSI Camera 0 detected
    device = /dev/video4
    name = imx219
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = /dev/v4l-subdev2
    isp_required = yes
    CSI Camera 1 detected
    device = /dev/video12
    name = imx219
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = /dev/v4l-subdev5
    isp_required = yes

    But the Edge AI won't not run, how to fix it?

    BR Rio

  • Even I trigger the yaml to IMX390, it will give me this error.

    root@am69a-sk:/opt/edgeai-gst-apps/apps_python# ./app_edgeai.py ../configs/imx390_cam_example.yaml
    libtidl_onnxrt_EP loaded 0x3f8f0dc0
    Final number of subgraphs created are : 1, - Offloaded Nodes - 289, Total Nodes - 289
    APP: Init ... !!!
    APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP: Init ... Done !!!
    Segmentation fault (core dumped)

  • Hi Shyam:

    Sorry for my typo:

    I'm trying the IMX219 cameras adapted.

    That's why the below log shows 219 activated.

    Any comments / guide line to make me proceding?

    am69a-sk login: root
    CSI Camera 0 detected
    device = /dev/video4
    name = imx219
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = /dev/v4l-subdev2
    isp_required = yes
    CSI Camera 1 detected
    device = /dev/video12
    name = imx219
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = /dev/v4l-s

  • Hi Shyam:

    Any feedback?

    BR Rio

  • Hi Shyam:

    Any feedback?

    BR Rio

  • Hi Rio,

    Can you please share you uEnv.txt?  We have validated using two IMX219 cameras on AM68A/AM69A

    Did you try connecting just one? Also please use rpiV2_cam_example.yaml when you are working with Rpi v2 cameras

  • Hi Shyam:

    Okay, I will get it by next week due to I dont have EVM right now.

    I think i have added this line in my uEvn.txt:

    name_overlays=k3-am69-sk-rpi-cam-imx219.dtbo

    That's why the IMX219 be detected.

    BR Rio

  • Hi Shyam:

    Here it is.

    Please review as the below.

    Thanks.

    BR Rio

    ##########################

    # NOTE: This file will be evaluated after the bootcmd is run and the
    # bootcmd must be set to load this file if it exists (this is the
    # default on all newer U-Boot images. This also means that some
    # variables such as bootdelay cannot be changed by this file since
    # it is not evaluated until the bootcmd is run.
    psdk_setup_file=.psdk_setup
    check_psdk_setup=load mmc 1:1 ${loadaddr} ${psdk_setup_file}

    # Reset to the default environment
    do_psdk_setup=env default -f -a; saveenv

    # If not done previously, then reset to the default environment and indicate this by writing a file
    # Also, the SK requires an additional dtbo to boot. Prepend it to name_overlays depending on board_name
    uenvcmd=if run check_psdk_setup; then echo "Already setup."; else run do_psdk_setup; mw.b ${loadaddr} 0 1; fatwrite mmc 1:1 ${loadaddr} .psdk_setup 1; reset; fi; if test "$board_name" = "am

    # Setting the right U-Boot environment variables
    dorprocboot=1

    #Rio: Original
    #name_overlays=k3-j784s4-edgeai-apps.dtbo
    #Rio: For IMX219 camera
    name_overlays=k3-am69-sk-rpi-cam-imx219.dtbo

  • Hi Shyam:

    Any feedback?

    BR Rio

  • Hi Shyam:

    If you have any image that proves the 2X CSI IMX219 work well with AI, please provide me thru TI Drive.

    Thanks.

    BR Rio

  • Hi Rio,

    For IMX219, use rpiV2_cam_example.yaml file as a reference. Ensure that the sources of your inputs in that yaml file match your devices. In your case it appears it would be /dev/video4 and /dev/video12. Take a look at the flow section of the file and ensure that the desired inputs, which would be your two cameras, are going to the right output. For more detailed information please refer to this page: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-edgeai/AM68A/08_06_00/exports/docs/common/configuration_file.html

    I hope this helps.

    Thank you,

    Fabiana Jaimes

  • #1. I have modified the yam for video 4 and video 12 separately l, but it still gives me those error logs.

    Please scroll up the above discussion, it's the same error log: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!

    root@am69a-sk:/opt/edgeai-gst-apps/apps_python# ./app_edgeai.py ../configs/rpiV2_cam_example_Video4.yaml
    libtidl_onnxrt_EP loaded 0x193fc2a0
    Final number of subgraphs created are : 1, - Offloaded Nodes - 289, Total Nodes - 289
    APP: Init ... !!!
    APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP: Init ... Done !!!
    Segmentation fault (core dumped)

    #2. Have you test 2 X CSI current working?

          To make 2 CSI concurrent working, the yaml needs to have 2 video sources.

          I ever made the edgi_AI_EVM working before, please see this video: https://www.youtube.com/watch?v=vxEDPDV3wdE

    #3. My questions are:

           A. If you want to display 2 CSI cam output, you need to make the default HDMI screen UI layout disappear.

                How to do this on AM69A?

           B. From the error log, the problem is the TIDL is not working for the Nodes,

                If you prove you have made 2 CSI cameras working, please take a picture here.

    Thanks.

    BR Rio

  • Which dtbo should be used for AM69 SK?

    please comment. !!

    k3-am69-sk-rpi-cam-imx219.dtbo

    k3-j721e-sk-rpi-cam-imx219.dtbo

  • Did you see this serious error log?

    Segmentation fault (core dumped)

  • If using those 2 cmds, I confirmed my CSI 2 cameras working.for preview.

    gst-launch-1.0 -v v4l2src device=/dev/video4 ! video/x-bayer, width=1920, height=1080, framerate=30/1 ! bayer2rgb ! video/x-raw,width=1920,height=1080 ! videoconvert ! videoscale ! kmssink driver-name=tidss
    gst-launch-1.0 -v v4l2src device=/dev/video12 ! video/x-bayer, width=1920, height=1080, framerate=30/1 ! bayer2rgb ! video/x-raw,width=1920,height=1080 ! videoconvert ! videoscale ! kmssink driver-name=tidss

    Now, the rest is to debug the segment faiult.

    please help

    BR Rio

  • Hi Rio, I see the issue here. We still need edgeai-apps dtbo. imx219 dtbo is just an add on. Your file should look like:

    name_overlays=k3-j784s4-edgeai-apps.dtbo k3-am69-sk-rpi-cam-imx219.dtbo

    Once this is done, you can run the application using the modified yaml file.

  • Hi.Abhay:

    #1.Please review the attached to know my seqeunces.

    #2.My key steps are shown as these.

    ./init_script.sh

    ./setup_cameras.sh

    /cat configs/rpiV2_cam_example_Video4.yaml

    /cat configs/rpiV2_cam_example_Video12.yaml

    libtidl_onnxrt_EP loaded 0x2028f2a0
    Final number of subgraphs created are : 1, - Offloaded Nodes - 289, Total Nodes - 289
    APP: Init ... !!!
    APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP: Init ... Done !!!
    Segmentation fault (core dumped)

    libtidl_onnxrt_EP loaded 0x32eb2570
    Final number of subgraphs created are : 1, - Offloaded Nodes - 289, Total Nodes - 289
    APP: Init ... !!!
    APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP: Init ... Done !!!

    The dtbo is set according your saying.

    cat /run/media/mmcblk1p1/uEnv.txt

    -->name_overlays=k3-j784s4-edgeai-apps.dtbo k3-am69-sk-rpi-cam-imx219.dtbo

    BR Rio

    Fail_Logs_For_Abhay.txt
    root@am69a-sk:/opt/edgeai-gst-apps# ./init_script.sh
    CSI Camera 0 detected
        device = /dev/video4
        name = imx219
        format = [fmt:SRGGB8_1X8/1920x1080]
        subdev_id = /dev/v4l-subdev2
        isp_required = yes
    CSI Camera 1 detected
        device = /dev/video12
        name = imx219
        format = [fmt:SRGGB8_1X8/1920x1080]
        subdev_id = /dev/v4l-subdev5
        isp_required = yes
    root@am69a-sk:/opt/edgeai-gst-apps# cd scripts/
    root@am69a-sk:/opt/edgeai-gst-apps/scripts# ls
    compile_cpp_apps.sh  get_fb_resolution.c  install_dl_inferer.sh   install_robotics_sdk.sh  install_tiovx_kernels.sh  optiflow    perf_vis.py       setup_wallpaper.sh
    detect_soc.sh        gst_tracers          install_gst_plugins.sh  install_ti_gpio_libs.sh  install_tiovx_modules.sh  perf_stats  setup_cameras.sh  udp_vis.py
    root@am69a-sk:/opt/edgeai-gst-apps/scripts# ./setup_cameras.sh
    CSI Camera 0 detected
        device = /dev/video4
        name = imx219
        format = [fmt:SRGGB8_1X8/1920x1080]
        subdev_id = /dev/v4l-subdev2
        isp_required = yes
    CSI Camera 1 detected
        device = /dev/video12
        name = imx219
        format = [fmt:SRGGB8_1X8/1920x1080]
        subdev_id = /dev/v4l-subdev5
        isp_required = yes
    root@am69a-sk:/opt/edgeai-gst-apps/scripts#
    root@am69a-sk:/opt/edgeai-gst-apps/scripts# cd ..
    root@am69a-sk:/opt/edgeai-gst-apps# cat configs/rpiV2_cam_example_Video4.yaml
    title: "RPi Camera"
    log_level: 2
    inputs:
        # rpi camera is supported only in Starter Kit
        # rpiV2 camera should be connected to CAM1 rpi header on SK
        # k3-j721e-sk-rpi-cam-imx219.dtbo should be applied in uenv.txt
        input0:
            source: /dev/video4
            width: 1920
            height: 1080
            format: rggb
            subdev-id: 2
            framerate: 30
    models:
        model0:
            model_path: /opt/model_zoo/TVM-CL-3090-mobileNetV2-tv
            topN: 5
        model1:
            model_path: /opt/model_zoo/ONR-OD-8200-yolox-nano-lite-mmdet-coco-416x416
            viz_threshold: 0.6
        model2:
            model_path: /opt/model_zoo/ONR-SS-8610-deeplabv3lite-mobv2-ade20k32-512x512
            alpha: 0.4
    outputs:
        output0:
            sink: kmssink
            width: 1920
            height: 1080
            overlay-performance: True
        output1:
            sink: /opt/edgeai-test-data/output/output_video.mkv
            width: 1920
            height: 1080
        output2:
            sink: /opt/edgeai-test-data/output/output_image_%04d.jpg
            width: 1920
            height: 1080
    
    flows:
        flow0: [input0,model1,output0,[320,180,1280,720]]
    root@am69a-sk:/opt/edgeai-gst-apps# cat configs/rpiV2_cam_example_Video12.yaml
    title: "RPi Camera"
    log_level: 2
    inputs:
        # rpi camera is supported only in Starter Kit
        # rpiV2 camera should be connected to CAM1 rpi header on SK
        # k3-j721e-sk-rpi-cam-imx219.dtbo should be applied in uenv.txt
        input0:
            source: /dev/video12
            width: 1920
            height: 1080
            format: rggb
            subdev-id: 2
            framerate: 30
    models:
        model0:
            model_path: /opt/model_zoo/TVM-CL-3090-mobileNetV2-tv
            topN: 5
        model1:
            model_path: /opt/model_zoo/ONR-OD-8200-yolox-nano-lite-mmdet-coco-416x416
            viz_threshold: 0.6
        model2:
            model_path: /opt/model_zoo/ONR-SS-8610-deeplabv3lite-mobv2-ade20k32-512x512
            alpha: 0.4
    outputs:
        output0:
            sink: kmssink
            width: 1920
            height: 1080
            overlay-performance: True
        output1:
            sink: /opt/edgeai-test-data/output/output_video.mkv
            width: 1920
            height: 1080
        output2:
            sink: /opt/edgeai-test-data/output/output_image_%04d.jpg
            width: 1920
            height: 1080
    
    flows:
        flow0: [input0,model1,output0,[320,180,1280,720]]
    root@am69a-sk:/opt/edgeai-gst-apps# cd apps_python/
    root@am69a-sk:/opt/edgeai-gst-apps/apps_python# ./app_edgeai.py ../configs/rpiV2_cam_example_Video4.yaml
    libtidl_onnxrt_EP loaded 0x2028f2a0
    Final number of subgraphs created are : 1, - Offloaded Nodes - 289, Total Nodes - 289
    APP: Init ... !!!
    APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP: Init ... Done !!!
    Segmentation fault (core dumped)
    root@am69a-sk:/opt/edgeai-gst-apps/apps_python# ./app_edgeai.py ../configs/rpiV2_cam_example_Video12.yaml
    libtidl_onnxrt_EP loaded 0x32eb2570
    Final number of subgraphs created are : 1, - Offloaded Nodes - 289, Total Nodes - 289
    APP: Init ... !!!
    APP_LOG: ERROR: Unable to map memory @ 0xaf000000 of size 262144 bytes !!!
    APP: ERROR: Log writer init failed !!!
    APP: Init ... Done !!!
    Segmentation fault (core dumped)
    root@am69a-sk:/opt/edgeai-gst-apps/apps_python# cat /run/media/mmcblk1p1/uEnv.txt
    # This uEnv.txt file can contain additional environment settings that you
    # want to set in U-Boot at boot time.  This can be simple variables such
    # as the serverip or custom variables.  The format of this file is:
    #    variable=value
    # NOTE: This file will be evaluated after the bootcmd is run and the
    #       bootcmd must be set to load this file if it exists (this is the
    #       default on all newer U-Boot images.  This also means that some
    #       variables such as bootdelay cannot be changed by this file since
    #       it is not evaluated until the bootcmd is run.
    psdk_setup_file=.psdk_setup
    check_psdk_setup=load mmc 1:1 ${loadaddr} ${psdk_setup_file}
    
    # Reset to the default environment
    do_psdk_setup=env default -f -a; saveenv
    
    # If not done previously, then reset to the default environment and indicate this by writing a file
    # Also, the SK requires an additional dtbo to boot. Prepend it to name_overlays depending on board_name
    uenvcmd=if run check_psdk_setup; then echo "Already setup."; else run do_psdk_setup; mw.b ${loadaddr} 0 1; fatwrite mmc 1:1 ${loadaddr} .psdk_setup 1; reset; fi; if test "$board_name" = "am69-sk"; then ; setenv name_overlays k3-am69-sk-ddr-mem-carveout.dtbo $name_overlays ; fi
    
    # Setting the right U-Boot environment variables
    dorprocboot=1
    
    #Rio: Original
    #name_overlays=k3-j784s4-edgeai-apps.dtbo
    #Rio: For IMX219 camera
    name_overlays=k3-j784s4-edgeai-apps.dtbo k3-am69-sk-rpi-cam-imx219.dtbo
    
    
    
    root@am69a-sk:/opt/edgeai-gst-apps/apps_python#

  •  Rio few comments,

    - You dont need to run init_script or setup_script, both runs automatically on boot

     - In config file, along with device, you also need to take care of subdev-id. For example, in rpiV2_cam_example_Video12.yaml subdev-id should be 5 (as seen after the boot)

    - I am not sure why this is not working because we have tried the same here and it works. What is suggest is re-flash the sd card and prepare a fresh image and then try it. (Not applying the correct dtbos and running tests previously might have resulted in something going wrong)

  • One more question. Did you reboot the board after uEnv.txt changes? If not, then please do. You have to reboot the board after applying , sorry i forgot to mention it. Even after the reboot doesnt work, then you might follow my suggestions.

  • #1. I have reboot many times.

    #2. re-create the SD card is done several times.

  • plz share me your yaml which is working.

    Thanks.

  • I already set the Video4 as subdev2, Video12 as subdev5.

    Still gives me segmentation fault.

  • Hi Abhay:

    After I perform cold boot, the 2 cameras run with the AI "separately" okay.

    Now, please help me to make it work concurrently due to our UI cannot set Both cameras.

    Thanks.

    BR Rio

  • Issue has been resolved. Will close this post.