This article provides information on how to start working with the CSI Camera Set 5MP AR0521 Color, which includes how to set up the hardware (wiring), install, and configure the necessary drivers for a touch demo.
All the products can be ordered online in the Toradex Webshop.
This topic provides pin connection details regarding connecting the CSI Camera Set 5MP AR0521 Color to the carrier boards.
Note: The flat ribbon cable, used to connect the carrier board and the camera adaptor is very fragile. If your camera does not work, make sure to test the cable connections on the flat cable.
Please refer to the below instructions for connecting the display to your specific carrier board.
See the picture below for the direct connection from the camera to the Ixora board. Make sure to connect the pin 1 side of the CSI camera to the respective pin 1 of the carrier board (MIPI-CSI Connector X28).
Connect the camera to the Verdin Development Board as indicated in the figure below. The MIPI-CSI Camera Interface is on connector X47. Make sure to connect the pin 1 side of the CSI camera to the respective pin 1 of the carrier board.
Connect the camera to the Dahlia Board, as indicated in the figure below. The MIPI-CSI Camera Interface is on connector X16.
Warning: Picture still to be provided.
The camera works both with the Toradex BSP Layers and Reference Images for Yocto Project and Torizon. The camera device driver and device tree are integrated into the Toradex BSP Layers and the binaries are deployed to the reference images. The next sections explain how to use the camera.
Note: e-con Systems and Toradex are working on a Partner Demo Container for a great out-of-the-box experience. Subscribe to our developer website updates or contact our sales team to stay up-to-date.
Using Toradex Easy Installer, install pre-build TorizonCore image (Toradex Download Links (Torizon, Linux BSP, WinCE and Partner Demos)) on the board.
To apply and deploy the Device Tree Overlay you need to follow one of the approaches on Device Tree Overlays on Torizon. You have to enable the device tree overlay
apalis-imx8_ar0521_overlay.dtbo (if you are using and Apalis module).
Note: Suggestion: use the Approach 1: Applying a Device Tree and Device Tree Overlays to a Custom Image Using the Build Command
After applying the device tree overlay, reboot the board and check if the driver is properly installed.
# dmesg | grep ar0521 [ 3.077064] ar0521 5-0042: Current Firmware Version - (1150CU96RKV1901110d381894XXXXXXX) [ 8.047832] mx8-img-md: Registered sensor subdevice: ar0521 5-0042 (1) [ 8.047864] mx8-img-md: created link [ar0521 5-0042] => [mxc-mipi-csi2.1]
To start the camera usage, you first need to build a container with GStreamer and V4L2-utils. So, it's recommended to follow the steps:
The following Dockefile is an example of a one that can be used to fulfill the requirements:
Then, build it and push:
$ docker build -f Dockerfile -t <your-dockerhub-username>/<Dockerfile-name> . $ docker push <your-dockerhub-username>/<Dockerfile-name>
After these steps, you can start properly working on your device. So, make sure that there is no container running on Torizon by stopping them all.
# docker stop $(docker ps -a -q) d942c0b4c5f1 3bff2f66a8d8 61dab378a9eb f8eca0e69f26 1455a33e6d78 cd529e7f036d
Because the camera application container also needs a Weston container running at the same time, launch the Weston container.
# docker run -e ACCEPT_FSL_EULA=1 -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \ -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \ --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \ --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \ torizon/weston-vivante:$CT_TAG_WESTON_VIVANTE --developer weston-launch \ --tty=/dev/tty7 --user=torizon # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 473d395c761d torizon/weston-vivante:2 "/usr/bin/entry.sh -…" 7 seconds ago Up 5 seconds weston
Now pull the container from your Dockerhub account and then, finally, launch the container where you going to run the pipeline.
# docker pull <your-dockerhub-username>/<Dockerfile-name> # docker run --rm -it --privileged \ -v /tmp:/tmp \ -v /var/run/dbus:/var/run/dbus \ -v /dev/galcore:/dev/galcore \ --device /dev/video0 \ --device-cgroup-rule='c 199:* rmw' \ <your-dockerhub-username>/<Dockerfile-name>
Here are some considerations:
/dev/video0. If you are not sure which device is a camera capture device, pass under the argument
--deviceall the devices available to be used.
<your-dockerhub-username>/<Dockerfile-name>with your container.
Then, once you are inside the container, enable the streaming by running a Gstreamer pipeline on the terminal:
## gst-launch-1.0 v4l2src device='/dev/video0' ! "video/x-raw, format=RGB16, framerate=30/1, width=1920, height=1080" ! fpsdisplaysink video-sink=waylandsink text-overlay=false sync=false -v