RPi Cam V2 (Sony IMX219) w/ Edge AI Demos

Hello,

I was hoping to try out some of the Edge AI demos and I have a V2 RPi camera (IMX219) + BB AI-64, which is the one supported in the Edge AI docs: [Getting Started — BeagleBoard Documentation](https://AI-64- EdgeAI -Getting Started)

I know these are mostly sources from TI’s Edge AI docs buts I’m stuck at the first step of enabling the camera. This is the note at the link above:
To be updated By default IMX219 is disabled. After connecting the camera you can enable it by specifying the dtb overlay file in/run/media/mmcblk0p1/uenv.txt as below,

I do not have a /media/ folder in /run/, is there another way I should be enabling the imx219 camera overlay?

(I also have the V1 camera)

Sorry, haven’t gotten this finished in our image… i also have the camera, need to personally plug it in and see what’s what…

Regards,

Is this something we can help accelerate or is there a roadmap for when we could expect the inclusion of the driver in a AI-64 image?

Best, Mat

timelines! hah!

debian@BeagleBone:/opt/source/dtb-5.10-ti$ dmesg | grep imx
[   10.284494] imx219 6-0010: supply VANA not found, using dummy regulator
[   10.291266] imx219 6-0010: supply VDIG not found, using dummy regulator
[   10.297941] imx219 6-0010: supply VDDL not found, using dummy regulator
[   10.395822] imx219 6-0010: failed to read chip id 219
[   10.468943] imx219: probe of 6-0010 failed with error -5

yeah, working on it…

Hehe sorry about the timeline ask, I’m projecting my terrible work habits and forgetting the generosity.
I feel helpless and I want to unleash the true power of this beautiful board! :nerd_face:

For my personal curiosity, is it a question of adapting/compiling TI’s IMX219 example driver in the kernel and testing?

Right now, i’m torn between… the cable being wrong, or bad…

debian@BeagleBone:/opt/source/dtb-5.10-ti$ ls -lha /dev/bone/i2c/csi0 
lrwxrwxrwx 1 root root 11 Aug  7 13:25 /dev/bone/i2c/csi0 -> ../../i2c-6
debian@BeagleBone:/opt/source/dtb-5.10-ti$ sudo i2cdetect -y -r 6
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Update: further… progress, it’s loaded… :wink: and it shows up…

git clone -b v5.10.x-ti-unified https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git
cd ./BeagleBoard-DeviceTrees/
make
sudo make install_arm64

Then in /boot/firmware/extlinux/extlinux.conf

fdtoverlays /overlays/BBAI64-CSI0-imx219.dtbo

BUT… yeah it needs magic to use it… /dev/video2 is not giving me the data…

sudo ./init_script.sh 
CSI Camera 0 detected
    device = /dev/video2
    name = imx219 6-0010
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = 2
    isp_required = yes

Regards,

Hi Robert,

Thanks for giving it a try last weekend.
Could you lead me in the right direction as to what the “magic” necessary would be?

I’m going to work on this more tomorrow… (and enable the 2nd channel…)

Regards,

1 Like

Nice, if you get anywhere and have progress to share I have two IMX219 modules here to test.

Best, Mat

Pushed… Commits · v5.10.x-ti-unified · BeagleBoard.org / BeagleBoard-DeviceTrees · GitLab

debian@BeagleBone:/opt/source/dtb-5.10-ti$ dmesg | grep imx
[    9.734750] imx219 4-0010: supply VANA not found, using dummy regulator
[    9.741556] imx219 4-0010: supply VDIG not found, using dummy regulator
[    9.748236] imx219 4-0010: supply VDDL not found, using dummy regulator
[    9.969642] imx219 6-0010: supply VANA not found, using dummy regulator
[    9.976433] imx219 6-0010: supply VDIG not found, using dummy regulator
[    9.983083] imx219 6-0010: supply VDDL not found, using dummy regulator
debian@BeagleBone:/opt/source/dtb-5.10-ti$ sudo /opt/edge_ai_apps/init_script.sh 
CSI Camera 0 detected
    device = /dev/video2
    name = imx219 6-0010
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = 2
    isp_required = yes
CSI Camera 1 detected
    device = /dev/video18
    name = imx219 4-0010
    format = [fmt:SRGGB8_1X8/1920x1080]
    subdev_id = 5
    isp_required = yes
git clone -b v5.10.x-ti-unified https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git
cd ./BeagleBoard-DeviceTrees/
make
sudo make install_arm64
fdtoverlays /overlays/BBAI64-CSI0-imx219.dtbo /overlays/BBAI64-CSI1-imx219.dtbo

Regards,

2 Likes

Thanks, I connected my official RPi V2 NoIR camera to port CSI0 and it was detected via the edge ai init scripts after following your instructions.

I appreciate the quick turn around and effort, will be having fun with this over the weekend.

Mat

Quick follow-up as I’ve been trying to test some of the Edge AI apps and was wondering if you’ve been able to run one of the Python examples?

After running the init_script.sh the camera is seen although I see the following two messages before detecting my camera on CSI0:

  • line 120: ntpd: command not found
  • line 124: /usr/lib/python3.8/site-packages/dlr/counter/ccm_config.json: No Such file or directory

I then try to run one of the python examples from /opt/edge_ai_apps/apps_python:
sudo ./app_edgeai.py …/configs/rpiV2_cam_example.yaml

The error I’m getting is:
“Error - libdlr.so: cannot open shared object file: No such file or directory”

Are you able to get this example running? I just flashed my AI-64 w/ latest Nov 1st flasher w/ Edge AI apps. I also followed the AI-64 update procedure.

Best, Mat

Run:

sudo apt update
sudo apt upgrade

It should upgrade the ti-edgeai-apps-src-8.2 package.

Then,

sudo /opt/edge_ai_apps/init_script.sh

Will work…

Now beyond that… There still be dragon’s, and i haven’t got an image of the imx yet…

Regards,

That did the trick, I can run the Edge AI demos now although only the video/image sources seem to function.

I cannot get an image either through the IMX219 example although it kids now.

1 Like

I’ve been following this thread, but just wanted to pop in to say – I’m also interested in CSI camera support, and have one of these cameras.