i.MX93 read camera using AP1302 + AR1335

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX93 read camera using AP1302 + AR1335

84 Views
TUANLAM95
Contributor I

Hello,

I am working with the i.MX93 to read a camera using the AP1302 ISP and the AR1335 sensor. I am using the imx-image-core, and here is my device tree:

ap1302: ap1302_mipi@3c {

compatible = "onsemi,ap1302";

#address-cells = <1>;

#size-cells = <0>;

reg = <0x3c>;

reset-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;

standby-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;

clocks = <&ap1302_clk>;

DVDD-supply   = <&reg_dvdd_1v2>;

VDDIO-supply  = <&reg_vddio_1v8>;

AVDD-supply   = <&reg_avdd_2v8>;

status = "okay";

sensors {

#address-cells = <1>;

#size-cells = <0>;

            onnn,model = "onnn,ar1335";

            sensor,resolution = <3840 2160>;

            sensor,format = <0x300a>; // MEDIA_BUS_FMT_SGRBG10_1X10

sensor@0 {

reg = <0>;

status = "okay";

                sip = <0xf36c>;

vdd-supply = <&reg_dvdd_1v2>;

vddio-supply = <&reg_dvdd_1v2>;

vaa-supply = <&reg_avdd_2v8>;

};

};

ports {

reg = <0>;

port@0 {

ar1335_mipi_ep: endpoint {

remote-endpoint = <&mipi_csi_ep>;

                                       data-lanes = <1 2 3 4>;

};

};

};

 

};

 

&cameradev {

status = "okay";

};

 

&isi_0 {

status = "okay";

 

cap_device {

status = "okay";

};

};

 

&mipi_csi {

#address-cells = <1>;

#size-cells = <0>;

status = "okay";

 

port@0 {

reg = <0>;

mipi_csi_ep: endpoint {

remote-endpoint = <&ar1335_mipi_ep>;

data-lanes = <1 2 3 4>;

};

};

};

 

cameradev: camera {

compatible = "fsl,mxc-md", "simple-bus";

#address-cells = <1>;

#size-cells = <1>;

ranges;

status = "disabled";

 

isi_0: isi@4ae40000{

compatible = "fsl,imx93-isi", "fsl,imx8-isi";

reg = <0x4ae40000 0x10000>;

interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>;

clocks = <&clk IMX93_CLK_ISI_GATE>,

<&clk IMX93_CLK_MEDIA_AXI>;

clock-names = "per", "axi";

assigned-clocks = <&clk IMX93_CLK_MEDIA_AXI>,

  <&clk IMX93_CLK_MEDIA_APB>;

assigned-clock-parents = <&clk IMX93_CLK_SYS_PLL_PFD1>,

<&clk IMX93_CLK_SYS_PLL_PFD1_DIV2>;

assigned-clock-rates = <400000000>, <133333333>;

interface = <2 0 2>;

no-reset-control;

power-domains = <&media_blk_ctrl IMX93_MEDIABLK_PD_ISI>;

gasket = <&media_blk_ctrl>;

status = "disabled";

 

cap_device {

compatible = "imx-isi-capture";

status = "disabled";

};

};

 

mipi_csi: csi@4ae00000 {

compatible = "fsl,dwc-mipi-csi2-host";

reg = <0x4ae00000 0x10000>;

interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;

clocks = <&clk IMX93_CLK_MIPI_CSI_GATE>,

<&clk IMX93_CLK_CAM_PIX>,

<&clk IMX93_CLK_MIPI_PHY_CFG>;

clock-names = "clk_core", "clk_pixel", "phy_cfg";

assigned-clocks = <&clk IMX93_CLK_CAM_PIX>,

  <&clk IMX93_CLK_MIPI_PHY_CFG>;

assigned-clock-parents = <&clk IMX93_CLK_VIDEO_PLL>,

<&clk IMX93_CLK_24M>;

assigned-clock-rates = <140000000>, <24000000>;

gasket = <&media_blk_ctrl>;

power-domains = <&media_blk_ctrl IMX93_MEDIABLK_PD_MIPI_CSI>;

status = "disabled";

};

 

parallel_csi: pcsi@4ac10070 {

compatible = "fsl,imx93-parallel-csi";

reg = <0x4ac10070 0x10>;

clocks = <&clk IMX93_CLK_MIPI_CSI_GATE>,

<&clk IMX93_CLK_MEDIA_APB>;

clock-names = "pixel", "ipg";

assigned-clocks = <&clk IMX93_CLK_CAM_PIX>;

assigned-clock-parents = <&clk IMX93_CLK_VIDEO_PLL>;

assigned-clock-rates = <140000000>;

pi_gpr = <&media_blk_ctrl>;

power-domains = <&media_blk_ctrl IMX93_MEDIABLK_PD_MIPI_CSI>;

status = "disabled";

};

};

Here is my log:

root@imx93evk:~# dmesg | grep -E 'ap1302|mx8-img-md'

[ 1.933992] ap1302_mipi 2-003c: AP1302 Chip ID is 0x265

[ 1.939282] ap1302_mipi 2-003c: Direct firmware load for imx/camera/ap1302.fw failed with error -2 [ 1.941955] ap1302_mipi 2-003c: AP1302 is found

[ 1.948287] ap1302_mipi 2-003c: Falling back to sysfs fallback for: imx/camera/ap1302.fw

[ 1.992892] mx8-img-md: Registered mxc_isi.0.capture as /dev/video0

[ 2.077440] mx8-img-md: Registered mxc_isi.0.capture as /dev/video0 [ 2.083876] mxc-md 42800000.bus:camera: Entity type for entity ap1302_mipi 2-003c was not initialized!

[ 2.098878] mx8-img-md: Registered sensor subdevice: ap1302_mipi 2-003c (1)

[ 2.112324] mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]

[ 2.118959] mx8-img-md: created link [mxc-mipi-csi2.0] => [mxc_isi.0]

[ 2.125397] mx8-img-md: created link [ap1302_mipi 2-003c] => [mxc-mipi-csi2.0]

[ 8.726263] ap1302_mipi 2-003c: Load firmware successfully.

However, when I run the command:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,framerate=15/1 ! videoconvert ! pngenc snapshot=true ! filesink location=TestPNG.png

The result is that the file TestPNG.png has no data.

Please help me resolve this issue.

0 Kudos
2 Replies

40 Views
joanxie
NXP TechSupport
NXP TechSupport

what board do you use? nxp board or your own board? did you try the demo images?

https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux-for...

0 Kudos

38 Views
TUANLAM95
Contributor I

Our company's board design is based on the I.MX93-EVK kit to use imx-image-core. Below are the adjustments I made in the project:

  • Modified the source code ap1302.c
    • Configured the control pins according to my hardware: RESET (ACTIVE LOW)
    • Removed the checksum verification line in the ap1302_fw_handler function -> Without this line, the code reports an error "checksum does not match. T:0xFFFF F: 0x0000"
  • Modified the configuration in the device tree as described above
  • I can send you our hardware schematic if needed!
0 Kudos