Introduction
This article documents the process on how to set up a PWM trigger with the Connect Tech Inc. JCB002 camera adapter board and E-con NileCAM21 GMSL2 cameras using the on board PWM of the AGX202/201.. For this document a Connect Tech Inc. Forge (AGX201) carrier board was used along with a NVIDIA® Jetson AGX Orin™ System on Chip (SoC).
Required Materials
Part | Description |
AGX201/AGX202 | Forge Carrier / Rogue for Orin Carrier |
AGX Orin | NVIDIA® Jetson AGX Orin™ SoC |
JCB002 | Connect Tech Inc. GMSL2 Camera Board |
E-con NileCAM21 | E-con NileCAM21 GMSL2 camera |
Quad Fakra Cable | GMSL2 1-to-4 Male-to-Female Fakra Cable |
System Setup
Hardware Setup
To stream the NileCAM21 cameras on an AGX201/AGX202 with PWM triggering a number of things need to be set up on the hardware side. Firstly, the AGX201 and AGX Orin™ module must be flashed with an appropriate BSP supporting E-con’s NileCAM21 camera. This can be downloaded from the Connect Tech Inc. website at https://connecttech.com/resource-center/l4t-board-support-packages/ under the NVIDIA Jetson AGX Orin section. The system must be flashed with a compatible BSP and the process for doing this can be found in a KDB article on the Connect Tech Inc. website at https://connecttech.com/resource-center/kdb373/. When flashing the system using the cti-flash.sh script select the JCB002 E-con NileCAM21 configuration in the CLI menu. Connect the E-con NileCAM21 cameras to the JCB002 using a Quad Fakra GMSL2 cable.
Software Setup
Once the hardware has been properly configured as outlined above, turn on the Jetson system and if not already done, go through the Ubuntu first time set up in order to have a fully bootable Jetson system. When the system has been fully set up and booted, run the command:
ls /dev/ | grep video
in order to ensure the E-con NileCAM21 camera is properly detected by the system. It should show up under the /dev/ directory as ‘video0’.
Before configuring the cameras you will need to install v4l-utils to properly set the camera’s properties. Run the commands ‘apt -y update’ and ‘apt -y install v4l-utils’ With v4l-utils installed, set the camera to frame sync mode by running the following command:
v4l2-ctl -c frame_sync_mode=1 -d /dev/videoX
Where X is the video devices for each of the NileCAM21 you have connected to the Orin carrier.
Once frame_sync_mode has been enabled for all the cameras in use that you want to be synchronized you’ll need to enable the PWM trigger broken out to the deserializers on the JCB002. TO do this go to the directory /sys/class/pwm/pwmchip3 and run the command echo 0 > export which will create the directory pwm0 in /sys/class/pwm/pwmchip3. This is the PWM devices that will be used to synchronize the cameras. Adjust the period and duty_cycle and enable the pwm by running the following commands:
echo 1000000 > period
echo 500000 > duty_cycle
echo 1 > enable
You can adjust the period and duty_cycle depending on your application’s requirements. With the PWM enabled the NileCAM21 can stream as normal using a simple gstreamer pipeline such as:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! xvimagesink
The camera will stream using the enabled PWM as its trigger source. This PWM is used by all the deserializers on the JCB002 and will be able to synchronize all the NileCAM21 devices connected to the system.
A list of all the properties of the connected camera(s) can be viewed by running the command:
v4l2-ctl -d /dev/video0 --all