Camera Config¶
The meta-mitysom-qc6490-5430-devkit/recipes-multimedia/camx/chicdk-kt recipe contains a camera firmware package built for the MitySOM-QC Development Kit camera configuration.
We cannot distribute the source, but the following process can be used to make your own custom camera firmware package. This information is mainly sourced from the Qualcomm Linux Camera Guide - Addendum, available to registered developers.
Getting Access and the Source¶
In order to rebuild the camera firmware, you will need to add the meta-qcom-extras layer to your yocto build.
Follow the instructions in the sections Getting Access, Getting the Source, and Prerequisites in Building_and_Customizing_firmware to get the proprietary source. For MitySOM-QC6490 Development Kit BSP 1.0, we used the above version of the Qualcom Linux Camera Guide - Addendum, and the r1.0_00376 release of QCM6490.LE.1.0 where the meta-qcom-extras layer resides.
Modifying and Building¶
Here is an example for adding an additional OV9281 camera sensor to the MitySOM-QC6490 Development Kit.
Overview:- Set up the Yocto Build
- Create a new camera module XML
- Add that camera module to the camera configuration XML
- Add a device tree node for the camera
Set up the Yocto Build¶
Follow the instructions at Building_and_Customizing_qcom-multimedia-image_with_Yocto to setup the Yocto build, with the following modifications to the "Building the Image" section:
- After you have acquired the extras layer, move it to {workspace}/layers/meta-qcom-extras
- Launch the QC yocto build docker
- Export a few extra variables before Source the environment setup script:
export FWZIP_PATH="../../../../meta-mitysom-qc6490-5430-devkit/recipes-firmware/firmware/firmware-qcom-bootbins"export CUST_ID=213195- Add meta-qom-extras:
export EXTRALAYERS="meta-qom-extras meta-mitysom-qc6490-5430-devkit meta-qcom-qim-product-sdk"
- Source the environment setup script:
MACHINE=qcs6490-mitysom-devkit DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment - Run
devtool modify chicdk-ktanddevtool modify cameradtband to get a working copy of the recipes and source atbuild-qcom-wayland/workspace/sources/
Create a new camera module XML¶
From here on, ${CAMX_CHICDK_PATH} refers to build-qcom-wayland/workspace/sources/chicdk-kt/qcom/proprietary/chi-cdk-kt/- Add an additional module XML at ${CAMX_CHICDK_PATH}/oem/qcom/module/
- You can copy cmk_ov9282_cam1.xml to make cmk_ov9282_cam2.xml
- Open the new cmk_ov9282_cam2.xml and change the cameraId tag to a unique number for this build. To see the existing cameras (and their Id tags) in this build check ${CAMX_CHICDK_PATH}/oem/qcom/multicamera/chimcxcameraconfig/configs/kodiak/kodiak_dc.xml
- Note: The cameraId tag in the sensor XML corresponds to the slotId tag in kodiak_dc.xml (not the cameraId tag, that is the CSI number)
- Ensure the value for the isComboMode tag in the sensor XML is 0
- The laneAssign tag says which MIPI lanes are used. It's a concatenation of the lane indices. Ex: For the 2 lane ov9282 it should be 0x10. For a 4 lane sensor like the imx577 it should be 0x3210
- Link to QC document where they discuss XML tags.
- Add another cmake file that calls out the new XML:
- Added ${CAMX_CHICDK_PATH}/oem/qcom/buildbins/build/linuxembedded/binary_yupik/com.qti.sensormodule.cmk_imx577_cam2.cmake
- Change the contents to reference cam2 in place of cam1.
- Add new sensor module to ${CAMX_CHICDK_PATH/oem/qcom/module/socid_sensorbin_map.xml
- Add this cmake file to the product.mk file that lists them all here: ${CAMX_CHICDK_PATH}/qcom/proprietary/configs/product.mk
Add that camera module to the camera configuration XML¶
- Update kodiak_dc.xml in build-qcom-wayland/workspace/sources/chicdk-kt/qcom/proprietary/chi-cdk-kt/oem/qcom/multicamera/chimcxcameraconfig/configs/kodiak/
- Add a new line entry for another ov9282
- Ex:
<PhysicalDevice name="RearPhysicalCam3" slotId="5" cameraId="3" sensorName="ov9282"/>
- Ex:
- The name must be unique (e.g. RearPhysicalCam3)
- Set cameraId to the next available number
- slotId must match the cameraId from the Module XML.
- Note: When using the camera with gstreamer, the qtiqmmfsrc Camera ID property (
camera=) enumerates from the first camera it probes successfully, not the slotId or cameraId. - Delete all the other XMLs in this directory to force this configuration to always be used.
Build and install chicdk-kt¶
- Do a clean build of chicdk-kt:
bitbake -fc cleanall chicdk-ktbitbake chicdk-kt
- Push the new ipk to the SOM, it should be at
build-qcom-wayland/tmp-glibc/deploy/ipk/qcm6490/chicdk-kt_1.0.qcom-r0_qcm6490.ipk - Install:
mount -o rw,remount /usr opkg --nodeps install {path_to}/chicdk-kt_1.0-r0_qcm6490.ipk --force-reinstall - Reboot SOM
Add a device tree node for the camera¶
- Navigate to build-qcom-wayland/workspace/sources/cameradtb/qcom/opensource/camera-devicetree/ and open mitysom-qc6490-devkit-camera-sensor.dtsi
- Copy an existing node for the ov9281, qcom,cam-sensorX
- X needs to match cameraId from the Module XML.
- If the new camera is going to connect to CSI0 or CSI1, paste the new node under &cam_cci0, if its CSI2-4, then it goes under &cam_cci1
- Update
cell-indexto match X from above. - Update
csiphy-sd-indexto match CSIx number the camera will be connected to. - Update
csi-master:- CSI0 and CSI2 use
csi-master = <0> - CSI1, CSI3, and CSI4 use
csi-master = <1>
- CSI0 and CSI2 use
- Ensure clock rates are correct, in this case it should be 24 MHz.
- To specify MCLK or EN or other CSI IO function, add/update the corresponding nodes in
mitysom-qc6490-devkit-camera.dtsiandmitysom-qc6490-devkit-camera-sensor.dtsi- Link to QC page where they discuss the relevant dt properties.
- build the modified cameradtb with
bitbake dtb-qcom-image - Follow the instructions here to flash the device tree.
Go to top