您尚未登录。

楼主 # 2022-06-16 11:31:33

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

咨询下给位大佬一个zero摄像头的问题

我是用5.10的linux
在配置的时候只要勾选了,
> Device Drivers > Multimedia support > Media drivers > V4L platform devices
    <*>   Allwinner V3s Camera Sensor Interface driver
启动的时候就没有显示了,第一个界面可以看到logo ,然后第二个界面就不行了,慢慢的屏幕就变黑了,这个是什么原因呢

离线

楼主 #1 2022-06-21 12:10:58

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

Re: 咨询下给位大佬一个zero摄像头的问题

我是这样配置的
## 修改显示屏驱动方式
```
    // chosen {
    //     #address-cells = <1>;
    //     #size-cells = <1>;
    //     ranges;

    //     framebuffer-lcd {
    //         compatible = "allwinner,simple-framebuffer",
    //                  "simple-framebuffer";
    //         allwinner,pipeline = "mixer0-lcd0";
    //         clocks = <&display_clocks CLK_MIXER0>,
    //              <&ccu CLK_TCON0>;
    //         status = "disabled";
    //     };
    // };

    chosen {
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;

        simplefb_lcd: framebuffer@0 {
            compatible = "allwinner,simple-framebuffer",
                     "simple-framebuffer";
            allwinner,pipeline = "de0-lcd0";
            clocks = <&ccu CLK_BUS_TCON0>, <&display_clocks 0>,
                 <&display_clocks 6>, <&ccu CLK_TCON0>;
            status = "disabled";
        };
    };
```
## 驱动摄像头
### sun8i-v3s.dtsi
```
            /omit-if-no-ref/
            csi1_mclk_pin: csi1-mclk-pin {
                pins = "PE1";
                function = "csi";
            };

            //增加//////////////////////////////////
            csi1_clk: csi1-clk@0 {
                pins = "PE0","PE2","PE3";
                bias-disable;
                function = "csi";
            };
            csi1_8bit: csi1-8bit@0 {
                pins      = "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15";
                bias-disable;
                function = "csi";
            };

            csi1_mclk: csi1-mclk@0 {
                pins = "PE1";
                bias-disable;
                function = "csi";
            };
            //////////////////////////////////////

            i2c0_pins: i2c0-pins {
                pins = "PB6", "PB7";
                function = "i2c0";
            };

            /omit-if-no-ref/
            i2c1_pe_pins: i2c1-pe-pins {
                pins = "PE21", "PE22";
                function = "i2c1";
            };

            //增加//////////////////////////////////
            i2c1_pins: i2c1-pins {
                pins = "PE21", "PE22";
                function = "i2c1";
            };
            //////////////////////////////////////


        uart2: serial@1c28800 {
            compatible = "snps,dw-apb-uart";
            reg = <0x01c28800 0x400>;
            interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
            reg-shift = <2>;
            reg-io-width = <4>;
            clocks = <&ccu CLK_BUS_UART2>;
            resets = <&ccu RST_BUS_UART2>;
            pinctrl-0 = <&uart2_pins>;
            pinctrl-names = "default";
            status = "disabled";
        };

        //增加//////////////////////////////////
        dma: dma-controller@01c02000 {
            compatible = "allwinner,sun8i-v3s-dma";
            reg = <0x01c02000 0x1000>;
            interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&ccu CLK_BUS_DMA>;
            resets = <&ccu RST_BUS_DMA>;
            #dma-cells = <1>;
        };
        codec_analog: codec-analog@01c23000 {
            compatible = "allwinner,sun8i-v3s-codec-analog";
            reg = <0x01c23000 0x4>;
        };
        codec: codec@01c22c00 {
            #sound-dai-cells = <0>;
            compatible = "allwinner,sun8i-v3s-codec";
            reg = <0x01c22c00 0x400>;
            interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
            clock-names = "apb", "codec";
            resets = <&ccu RST_BUS_CODEC>;
            dmas = <&dma 15>, <&dma 15>;
            dma-names = "rx", "tx";
            allwinner,codec-analog-controls = <&codec_analog>;
            status = "disabled";
        };
        //////////////////////////////////////




        csi1: camera@1cb4000 {
            compatible = "allwinner,sun8i-v3s-csi";
            reg = <0x01cb4000 0x3000>;
            interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&ccu CLK_BUS_CSI>,
                 <&ccu CLK_CSI1_SCLK>,
                 <&ccu CLK_DRAM_CSI>;
            clock-names = "bus", "mod", "ram";
            resets = <&ccu RST_BUS_CSI>;
            status = "okay";  // "disabled"修改为"okay"
        };
```
### sun8i-v3s-licheepi-zero-dock.dts
```
&mmc1 {
    broken-cd;
    bus-width = <4>;
    vmmc-supply = <&reg_vcc3v3>;
    status = "okay";
};
//增加----------------------------------------------------------------
&csi1 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&csi1_clk &csi1_8bit>;

    port {
        csi1_ep: endpoint {
        remote-endpoint = <&ov2640_0>;
        hsync-active = <0>;
        vsync-active = <0>;
        bus-width = <10>;
            pclk-sample = <1>;
        };
    };

};
&i2c1 {
        pinctrl-0 = <&i2c1_pins>;
        pinctrl-names = "default";
        clock-frequency = <400000>;
        status = "okay";
   
    ov2640: camera@30 {
        compatible = "ovti,ov2640";
        reg = <0x30>;
        pinctrl-names = "default";
        pinctrl-0 = <&csi1_mclk_pin>;
        clocks = <&ccu CLK_CSI1_MCLK>;
        clock-names = "xvclk";
        assigned-clocks = <&ccu CLK_CSI1_MCLK>;
        assigned-clock-rates = <24000000>;
        port {
            ov2640_0: endpoint {
                remote-endpoint = <&csi1_ep>;
                bus-width = <10>;
            };
        };
    };
};
&codec {
    allwinner,audio-routing =
        "Headphone", "HP",
        "Headphone", "HPCOM",
        "MIC1", "Mic",
        "Mic",  "HBIAS";
    status = "okay";
};
//----------------------------------------------------------------
```
### 修改配置文件
```
> Device Drivers > Multimedia support > Media device types
    [ *] Platform-specific devices

> Device Drivers > Multimedia support > Media drivers > V4L platform devices
    <*>   Video Multiplexer
    <*>   Allwinner V3s Camera Sensor Interface driver

> Device Drivers > Multimedia support > Media drivers > Memory-to-memory multimedia devices
    <*>   Deinterlace
    <*>   Allwinner Deinterlace
    <*>   Allwinner DE2 rotation driver

> Device Drivers > Multimedia support > Media ancillary drivers > Camera sensor devices
    {*} OmniVision OV2640 sensor support
    <*> OmniVision OV7670 sensor support
```

离线

楼主 #2 2022-06-21 12:11:29

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

Re: 咨询下给位大佬一个zero摄像头的问题

这样配置对不对呢?

离线

楼主 #3 2022-06-27 11:47:56

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

Re: 咨询下给位大佬一个zero摄像头的问题

荔枝派zero + 底板的 是不是dvp摄像头和显示屏不能共用呢?

离线

楼主 #6 2022-06-27 12:39:19

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

Re: 咨询下给位大佬一个zero摄像头的问题

荔枝派nano可以同时使用摄像头和显示屏吗

离线

楼主 #8 2022-06-27 13:01:13

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

Re: 咨询下给位大佬一个zero摄像头的问题

哇酷小二 说:
xwings 说:

荔枝派nano可以同时使用摄像头和显示屏吗

F1C芯片可以,但是荔枝派nano可能不行。

芒果派的tiny200开发板可以同时用。

好的 ,感谢 smile

离线

楼主 #10 2022-06-28 23:22:45

xwings
会员
注册时间: 2022-06-07
已发帖子: 10
积分: 10

Re: 咨询下给位大佬一个zero摄像头的问题

还没有研究原理图,是不是脚复用的问题...

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn