您尚未登录。

楼主 #1 2021-04-24 15:18:20

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

5.2内核,启动SPI屏幕(ili9341)失败

内核版本:zero-5.2.y

按照晕哥写的教程,一步一步操作。
https://whycan.com/t_576.html#p1579

内核启动log中显示如下:

[    1.052704] fbtft_of_value: buswidth = 8
[    1.056628] fbtft_of_value: debug = 0
[    1.060326] fbtft_of_value: rotate = 270
[    1.064244] fbtft_of_value: fps = 10
[    1.068691] fb_ili9341 spi0.0: Failed to request reset-gpios GPIO:-2
[    1.075218] fb_ili9341: probe of spi0.0 failed with error -2

是不是zero-5.2.y的内核太新了,改了什么东西,导致按照上面的流程操作后,启动失败。

离线

#2 2021-04-24 15:22:25

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

获取dtb 里面 reset 引脚错误

linux错误代码: https://mariadb.com/kb/en/operating-system-error-codes/





离线

楼主 #3 2021-04-24 15:42:22

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

获取dtb 里面 reset 引脚错误

linux错误代码: https://mariadb.com/kb/en/operating-system-error-codes/

sun8i-v3.dtsi下的pio节点

		pio: pinctrl@1c20800 {
			compatible = "allwinner,sun8i-v3s-pinctrl";
			reg = <0x01c20800 0x400>;
			interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
			clock-names = "apb", "hosc", "losc";
			gpio-controller;
			#gpio-cells = <3>;
			interrupt-controller;
			#interrupt-cells = <3>;

			emac_rgmii_pins: emac-rgmii-pins {
				pins = "PD0", "PD1", "PD2", "PD3", "PD4",
				       "PD5", "PD7", "PD8", "PD9", "PD10",
				       "PD12", "PD13", "PD15", "PD16", "PD17";
				function = "emac";
				drive-strength = <40>;
			};

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

			pwm0_pins: pwm0 {
				pins = "PB4";
				function = "pwm0";
			};

			uart0_pb_pins: uart0-pb-pins {
				pins = "PB8", "PB9";
				function = "uart0";
			};

			lcd_rgb666_pins_a: lcd-rgb666-pe {
				pins = "PE0", "PE1", "PE2", "PE3", "PE4", "PE5",
				       "PE6", "PE7", "PE8", "PE9", "PE10", "PE11",
				       "PE12", "PE13", "PE14", "PE15", "PE16", "PE17",
				       "PE18", "PE19", "PE23", "PE24";
				function = "lcd";
			};

			mmc0_pins: mmc0-pins {
				pins = "PF0", "PF1", "PF2", "PF3",
				       "PF4", "PF5";
				function = "mmc0";
				drive-strength = <30>;
				bias-pull-up;
			};

			mmc1_pins: mmc1-pins {
				pins = "PG0", "PG1", "PG2", "PG3",
				       "PG4", "PG5";
				function = "mmc1";
				drive-strength = <30>;
				bias-pull-up;
			};

			spi0_pins: spi0-pins {
				pins = "PC0", "PC1", "PC2", "PC3";
				function = "spi0";
			};

			pwm1_pins: pwm1 {
				pins = "PB5";
				function = "pwm1";
			};

		csi1_8bit: csi1-8bit@0 {
       			pins 	 = "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15";
       			bias-disable;
       			function = "csi";
			};

		csi1_clk: csi1-clk@0 {
			pins = "PE0","PE2","PE3";
			bias-disable;
			function = "csi";
		};

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

		i2c1_pins: i2c1 {
			pins = "PE21", "PE22";
			function = "i2c1";
		};

		};

sun8i-v3s-licheepi-zero.dts下的spi节点

163 &spi0 {
164      status = "okay";
165      ili9341@0 {
166             compatible = "ilitek,ili9341";
167             reg = <0>;
168             spi-max-frequency = <15000000>;
169             rotate = <270>;
170             bgr;
171             fps = <10>;
172             buswidth = <8>;
173             reset-gpios = <&pio 1 7 GPIO_ACTIVE_LOW>;
174             dc-gpios = <&pio 1 5 GPIO_ACTIVE_LOW>;
175            debug = <0>;
176       };
177 };

173 reset-gpios = <&pio 1 7 GPIO_ACTIVE_LOW>; 指的是PB7,是i2c0的SDA引脚,讲道理是可以获取到这个引脚的。配置教程上面也说了,SPI屏幕的复位引脚可以直接接电源的,所以不接PB7也可以。所以我不清楚为什么会获取dtb里面 reset 引脚发生错误

离线

#4 2021-04-24 15:55:12

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

你的i2c0使能了吗?也是用pb7?





离线

楼主 #5 2021-04-24 15:58:35

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

你的i2c0使能了吗?也是用pb7?

没动过i2c0的设备树代码。

在sun8i-v3s-licheepi-zero.dts中有i2c0这个节点

111 &i2c0 {
112     status = "okay";
113     ns2009: ns2009@48 {
114         compatible = "nsiway,ns2009";
115         reg = <0x48>;
116     };
117 };

离线

#6 2021-04-24 17:03:17

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

当然要动啊,删除或者改


status = "disabled";





离线

楼主 #7 2021-04-24 17:31:40

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

当然要动啊,删除或者改


status = "disabled";

修改后还是报原来的错误。

[    1.176248] fbtft_of_value: buswidth = 8
[    1.180222] fbtft_of_value: debug = 0
[    1.183881] fbtft_of_value: rotate = 270
[    1.187798] fbtft_of_value: fps = 10
[    1.192082] fb_ili9341 spi0.0: Failed to request reset-gpios GPIO:-2
[    1.198681] fb_ili9341: probe of spi0.0 failed with error -2

下面我重新贴下几个文件的相关代码。

sun8i-v3s-licheepi-zero.dts文件

183 &spi0 {
184       status = "okay";
185       ili9341@0 {
186              compatible = "ilitek,ili9341";
187              reg = <0>;
188              spi-max-frequency = <15000000>;
189              rotate = <270>;
190              bgr;
191              fps = <10>;
192              buswidth = <8>;
193              reset-gpios = <&pio 1 7 GPIO_ACTIVE_LOW>;
194              dc-gpios = <&pio 1 5 GPIO_ACTIVE_LOW>;
195              debug = <0>;
196       };
197 };

sun8i-v3s.dtsi文件

521         i2c0: i2c@1c2ac00 {
522             compatible = "allwinner,sun6i-a31-i2c";
523             reg = <0x01c2ac00 0x400>;
524             interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
525             clocks = <&ccu CLK_BUS_I2C0>;
526             resets = <&ccu RST_BUS_I2C0>;
527             pinctrl-names = "default";
528             pinctrl-0 = <&i2c0_pins>;
529             status = "eabled";
530             #address-cells = <1>;
531             #size-cells = <0>;
532         };

离线

#8 2021-04-24 17:39:08

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

没理由,只能怀疑你改错了文件,或者dtb没有起作用。





离线

楼主 #9 2021-04-24 17:45:19

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

当然要动啊,删除或者改


status = "disabled";


我刚刚在内核4.13.16版本上,按照教程一步步操作,发现没有遇到在5.2版本上的错误。
下面是运行成功的log,但是屏幕并没有亮起来。

[    1.244305] fbtft_of_value: buswidth = 8
[    1.248267] fbtft_of_value: debug = 0
[    1.251925] fbtft_of_value: rotate = 270
[    1.255841] fbtft_of_value: fps = 10
[    1.304740] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.314784] mmc0: new high speed SDHC card at address 1234
[    1.320956] mmcblk0: mmc0:1234 SA08G 7.21 GiB
[    1.327049]  mmcblk0: p1 p2
[    1.609569] Console: switching to colour frame buffer device 40x30
[    1.616454] graphics fb0: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=10, spi32766.0 at 15 MHz

使用下面的命令,并没有发现屏幕出现变化

cat /dev/urandom > /dev/fb0
cat /dev/zero > /dev/fb0

离线

楼主 #10 2021-04-24 17:46:57

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

没理由,只能怀疑你改错了文件,或者dtb没有起作用。

我百度了下那错误,找到这个帖子,但是我看不懂。晕哥可以看下它写的内容
https://blog.csdn.net/qulang000/article/details/114686525

离线

楼主 #11 2021-04-24 21:04:08

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

无痕 说:
哇酷小二 说:

没理由,只能怀疑你改错了文件,或者dtb没有起作用。

我百度了下那错误,找到这个帖子,但是我看不懂。晕哥可以看下它写的内容
https://blog.csdn.net/qulang000/article/details/114686525


按照里面的操作,修改bug引脚相关代码后,还是报同样的错误。

离线

#12 2021-04-25 11:02:36

阿黄
会员
注册时间: 2018-10-03
已发帖子: 299
积分: 134

Re: 5.2内核,启动SPI屏幕(ili9341)失败

贴出你相关的几个完整设备树文件吧

离线

楼主 #13 2021-04-25 20:55:39

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

阿黄 说:

贴出你相关的几个完整设备树文件吧

完整的设备树文件如下

sun8i-v3s.dtsi

/*
 * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/sun8i-v3s-ccu.h>
#include <dt-bindings/reset/sun8i-v3s-ccu.h>

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	interrupt-parent = <&gic>;

	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";
		//};
	};

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu@0 {
			compatible = "arm,cortex-a7";
			device_type = "cpu";
			reg = <0>;
			clocks = <&ccu CLK_CPU>;
		};
	};

	de: display-engine {
		compatible = "allwinner,sun8i-v3s-display-engine";
		allwinner,pipelines = <&mixer0>;
		status = "disabled";
	};

	timer {
		compatible = "arm,armv7-timer";
		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
	};

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

		osc24M: osc24M_clk {
			#clock-cells = <0>;
			compatible = "fixed-clock";
			clock-frequency = <24000000>;
			clock-output-names = "osc24M";
		};

		osc32k: osc32k_clk {
			#clock-cells = <0>;
			compatible = "fixed-clock";
			clock-frequency = <32768>;
			clock-output-names = "osc32k";
		};
	};

	soc {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		display_clocks: clock@1000000 {
			compatible = "allwinner,sun8i-v3s-de2-clk";
			reg = <0x01000000 0x100000>;
			clocks = <&ccu CLK_DE>,
				 <&ccu CLK_BUS_DE>;
			clock-names = "mod",
				      "bus";
			resets = <&ccu RST_BUS_DE>;
			#clock-cells = <1>;
			#reset-cells = <1>;
		};

		mixer0: mixer@1100000 {
			compatible = "allwinner,sun8i-v3s-de2-mixer";
			reg = <0x01100000 0x100000>;
			clocks = <&display_clocks 0>,
				 <&display_clocks 6>;
			clock-names = "bus",
				      "mod";
			resets = <&display_clocks 0>;
			assigned-clocks = <&display_clocks 6>;
			assigned-clock-rates = <150000000>;

			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				mixer0_out: port@1 {
					reg = <1>;

					mixer0_out_tcon0: endpoint {
						remote-endpoint = <&tcon0_in_mixer0>;
					};
				};
			};
		};

		syscon: syscon@1c00000 {
			compatible = "allwinner,sun8i-v3s-system-controller",
				"syscon";
			reg = <0x01c00000 0x1000>;
		};

		tcon0: lcd-controller@1c0c000 {
			compatible = "allwinner,sun8i-v3s-tcon";
			reg = <0x01c0c000 0x1000>;
			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_TCON0>,
				 <&ccu CLK_TCON0>;
			clock-names = "ahb",
				      "tcon-ch0";
			clock-output-names = "tcon-pixel-clock";
			#clock-cells = <0>;
			resets = <&ccu RST_BUS_TCON0>;
			reset-names = "lcd";
			status = "disabled";

			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				tcon0_in: port@0 {
					reg = <0>;

					tcon0_in_mixer0: endpoint {
						remote-endpoint = <&mixer0_out_tcon0>;
					};
				};

				tcon0_out: port@1 {
					#address-cells = <1>;
					#size-cells = <0>;
					reg = <1>;
				};
			};
		};

		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>;
		};

		mmc0: mmc@1c0f000 {
			compatible = "allwinner,sun7i-a20-mmc";
			reg = <0x01c0f000 0x1000>;
			clocks = <&ccu CLK_BUS_MMC0>,
				 <&ccu CLK_MMC0>,
				 <&ccu CLK_MMC0_OUTPUT>,
				 <&ccu CLK_MMC0_SAMPLE>;
			clock-names = "ahb",
				      "mmc",
				      "output",
				      "sample";
			resets = <&ccu RST_BUS_MMC0>;
			reset-names = "ahb";
			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&mmc0_pins>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
		};

		mmc1: mmc@1c10000 {
			compatible = "allwinner,sun7i-a20-mmc";
			reg = <0x01c10000 0x1000>;
			clocks = <&ccu CLK_BUS_MMC1>,
				 <&ccu CLK_MMC1>,
				 <&ccu CLK_MMC1_OUTPUT>,
				 <&ccu CLK_MMC1_SAMPLE>;
			clock-names = "ahb",
				      "mmc",
				      "output",
				      "sample";
			resets = <&ccu RST_BUS_MMC1>;
			reset-names = "ahb";
			interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&mmc1_pins>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
		};

		mmc2: mmc@1c11000 {
			compatible = "allwinner,sun7i-a20-mmc";
			reg = <0x01c11000 0x1000>;
			clocks = <&ccu CLK_BUS_MMC2>,
				 <&ccu CLK_MMC2>,
				 <&ccu CLK_MMC2_OUTPUT>,
				 <&ccu CLK_MMC2_SAMPLE>;
			clock-names = "ahb",
				      "mmc",
				      "output",
				      "sample";
			resets = <&ccu RST_BUS_MMC2>;
			reset-names = "ahb";
			interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
		};

		usb_otg: usb@1c19000 {
			compatible = "allwinner,sun8i-h3-musb";
			reg = <0x01c19000 0x0400>;
			clocks = <&ccu CLK_BUS_OTG>;
			resets = <&ccu RST_BUS_OTG>;
			interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "mc";
			phys = <&usbphy 0>;
			phy-names = "usb";
			extcon = <&usbphy 0>;
			status = "disabled";
		};

		usbphy: phy@1c19400 {
			compatible = "allwinner,sun8i-v3s-usb-phy";
			reg = <0x01c19400 0x2c>,
			      <0x01c1a800 0x4>;
			reg-names = "phy_ctrl",
				    "pmu0";
			clocks = <&ccu CLK_USB_PHY0>;
			clock-names = "usb0_phy";
			resets = <&ccu RST_USB_PHY0>;
			reset-names = "usb0_reset";
			status = "disabled";
			#phy-cells = <1>;
		};

		ehci0: usb@01c1a000 {
			compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci";
			reg = <0x01c1a000 0x100>;
			interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
			resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
			status = "disabled";
		};

		ohci0: usb@01c1a400 {
			compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci";
			reg = <0x01c1a400 0x100>;
			interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
				 <&ccu CLK_USB_OHCI0>;
			resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
			status = "disabled";
		};

		ccu: clock@1c20000 {
			compatible = "allwinner,sun8i-v3s-ccu";
			reg = <0x01c20000 0x400>;
			clocks = <&osc24M>, <&osc32k>;
			clock-names = "hosc", "losc";
			#clock-cells = <1>;
			#reset-cells = <1>;
		};

		rtc: rtc@1c20400 {
			compatible = "allwinner,sun6i-a31-rtc";
			reg = <0x01c20400 0x54>;
			interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
		};

		csi1: csi@1cb4000 {
			compatible = "allwinner,sun8i-v3s-csi";
			reg = <0x01cb4000 0x1000>;
			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 = "disabled";
		};

		pio: pinctrl@1c20800 {
			compatible = "allwinner,sun8i-v3s-pinctrl";
			reg = <0x01c20800 0x400>;
			interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
			clock-names = "apb", "hosc", "losc";
			gpio-controller;
			#gpio-cells = <3>;
			interrupt-controller;
			#interrupt-cells = <3>;

			emac_rgmii_pins: emac-rgmii-pins {
				pins = "PD0", "PD1", "PD2", "PD3", "PD4",
				       "PD5", "PD7", "PD8", "PD9", "PD10",
				       "PD12", "PD13", "PD15", "PD16", "PD17";
				function = "emac";
				drive-strength = <40>;
			};

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

			pwm0_pins: pwm0 {
				pins = "PB4";
				function = "pwm0";
			};

			uart0_pb_pins: uart0-pb-pins {
				pins = "PB8", "PB9";
				function = "uart0";
			};

			lcd_rgb666_pins_a: lcd-rgb666-pe {
				pins = "PE0", "PE1", "PE2", "PE3", "PE4", "PE5",
				       "PE6", "PE7", "PE8", "PE9", "PE10", "PE11",
				       "PE12", "PE13", "PE14", "PE15", "PE16", "PE17",
				       "PE18", "PE19", "PE23", "PE24";
				function = "lcd";
			};

			mmc0_pins: mmc0-pins {
				pins = "PF0", "PF1", "PF2", "PF3",
				       "PF4", "PF5";
				function = "mmc0";
				drive-strength = <30>;
				bias-pull-up;
			};

			mmc1_pins: mmc1-pins {
				pins = "PG0", "PG1", "PG2", "PG3",
				       "PG4", "PG5";
				function = "mmc1";
				drive-strength = <30>;
				bias-pull-up;
			};

			spi0_pins: spi0-pins {
				pins = "PC0", "PC1", "PC2", "PC3";
				function = "spi0";
			};

			pwm1_pins: pwm1 {
				pins = "PB5";
				function = "pwm1";
			};

		csi1_8bit: csi1-8bit@0 {
       			pins 	 = "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15";
       			bias-disable;
       			function = "csi";
			};

		csi1_clk: csi1-clk@0 {
			pins = "PE0","PE2","PE3";
			bias-disable;
			function = "csi";
		};

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

		i2c1_pins: i2c1 {
			pins = "PE21", "PE22";
			function = "i2c1";
		};




		};


		timer@1c20c00 {
			compatible = "allwinner,sun4i-a10-timer";
			reg = <0x01c20c00 0xa0>;
			interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&osc24M>;
		};

		wdt0: watchdog@1c20ca0 {
			compatible = "allwinner,sun6i-a31-wdt";
			reg = <0x01c20ca0 0x20>;
			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
		};

		pwm: pwm@1c21400 {
			compatible = "allwinner,sun8i-v3s-pwm",
				     "allwinner,sun7i-a20-pwm";
			reg = <0x01c21400 0x400>;
			clocks = <&osc24M>;
			#pwm-cells = <3>;
			status = "disabled";
		};

		lradc: lradc@1c22800 {
			compatible = "allwinner,sun4i-a10-lradc-keys";
			reg = <0x01c22800 0x400>;
			interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
			status = "disabled";
		};

		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";
		};

		codec_analog: codec-analog@01c23000 {
			compatible = "allwinner,sun8i-v3s-codec-analog";
			reg = <0x01c23000 0x4>;
		};

		uart0: serial@1c28000 {
			compatible = "snps,dw-apb-uart";
			reg = <0x01c28000 0x400>;
			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
			reg-shift = <2>;
			reg-io-width = <4>;
			clocks = <&ccu CLK_BUS_UART0>;
			resets = <&ccu RST_BUS_UART0>;
			status = "disabled";
		};

		uart1: serial@1c28400 {
			compatible = "snps,dw-apb-uart";
			reg = <0x01c28400 0x400>;
			interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
			reg-shift = <2>;
			reg-io-width = <4>;
			clocks = <&ccu CLK_BUS_UART1>;
			resets = <&ccu RST_BUS_UART1>;
			status = "disabled";
		};

		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>;
			status = "disabled";
		};

		i2c0: i2c@1c2ac00 {
			compatible = "allwinner,sun6i-a31-i2c";
			reg = <0x01c2ac00 0x400>;
			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_I2C0>;
			resets = <&ccu RST_BUS_I2C0>;
			pinctrl-names = "default";
			pinctrl-0 = <&i2c0_pins>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		i2c1: i2c@1c2b000 {
			compatible = "allwinner,sun6i-a31-i2c";
			reg = <0x01c2b000 0x400>;
			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_I2C1>;
			resets = <&ccu RST_BUS_I2C1>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
		};

		emac: ethernet@1c30000 {
			compatible = "allwinner,sun8i-h3-emac";
			syscon = <&syscon>;
			reg = <0x01c30000 0x10000>;
			interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "macirq";
			resets = <&ccu RST_BUS_EMAC>;
			reset-names = "stmmaceth";
			clocks = <&ccu CLK_BUS_EMAC>;
			clock-names = "stmmaceth";
			status = "disabled";

			mdio: mdio {
				#address-cells = <1>;
				#size-cells = <0>;
				compatible = "snps,dwmac-mdio";
			};

			mdio-mux {
				compatible = "allwinner,sun8i-h3-mdio-mux";
				#address-cells = <1>;
				#size-cells = <0>;

				mdio-parent-bus = <&mdio>;
				/* Only one MDIO is usable at the time */
				internal_mdio: mdio@1 {
					compatible = "allwinner,sun8i-h3-mdio-internal";
					reg = <1>;
					#address-cells = <1>;
					#size-cells = <0>;

					int_mii_phy: ethernet-phy@1 {
						compatible = "ethernet-phy-ieee802.3-c22";
						reg = <1>;
						clocks = <&ccu CLK_BUS_EPHY>;
						resets = <&ccu RST_BUS_EPHY>;
					};
				};

				external_mdio: mdio@2 {
					reg = <2>;
					#address-cells = <1>;
					#size-cells = <0>;
				};
			};
		};

		spi0: spi@1c68000 {
			compatible = "allwinner,sun8i-h3-spi";
			reg = <0x01c68000 0x1000>;
			interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
			clock-names = "ahb", "mod";
			pinctrl-names = "default";
			pinctrl-0 = <&spi0_pins>;
			resets = <&ccu RST_BUS_SPI0>;
			status = "enabled";
			#address-cells = <1>;
			#size-cells = <0>;
		};

		gic: interrupt-controller@1c81000 {
			compatible = "arm,gic-400";
			reg = <0x01c81000 0x1000>,
			      <0x01c82000 0x1000>,
			      <0x01c84000 0x2000>,
			      <0x01c86000 0x2000>;
			interrupt-controller;
			#interrupt-cells = <3>;
			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
		};
	};
};

sun8i-v3s-licheepi-zero.dts:

/*
 * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

/dts-v1/;
#include "sun8i-v3s.dtsi"
#include "sunxi-common-regulators.dtsi"

/ {
	model = "Lichee Pi Zero";
	compatible = "licheepi,licheepi-zero", "allwinner,sun8i-v3s";

	aliases {
		serial0 = &uart0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};
	
	pir{
		label = "licheepi:blue:usr";
		gpio-pir = <&pio 6 5 GPIO_ACTIVE_HIGH>; /* PG5 */
	};

	door_magnet{
		label = "licheepi:blue:usr";
		gpio-door_magnet = <&pio 6 4 GPIO_ACTIVE_HIGH>; /* PG4 */
	};

	leds {
		compatible = "gpio-leds";

		blue_led {
			label = "licheepi:blue:usr";
			gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
		};

		green_led {
			label = "licheepi:green:usr";
			gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
			default-state = "on";
		};

		red_led {
			label = "licheepi:red:usr";
			gpios = <&pio 6 2 GPIO_ACTIVE_LOW>; /* PG2 */
		};
	};

	door_key{
		compatible = "door_key";
		key-gpio = <&pio 6 3 GPIO_ACTIVE_LOW>;
	};

	lcd_key{
		compatible = "lcd_key";
		key-gpio = <&pio 6 2 GPIO_ACTIVE_LOW>;
	};
};
&ehci0 {
	status = "okay";
};

&mmc0 {
	broken-cd;
	bus-width = <4>;
	vmmc-supply = <&reg_vcc3v3>;
	status = "okay";
};


&i2c0 {
	status = "okay";
	
	ns2009: ns2009@48 {
		compatible = "nsiway,ns2009";
		reg = <0x48>;
	};
};

&ohci0 {
	status = "okay";
};

&uart0 {
	pinctrl-0 = <&uart0_pb_pins>;
	pinctrl-names = "default";
	status = "okay";
};

&usb_otg {
	dr_mode = "otg";
	status = "okay";
};

&usbphy {
	usb0_id_det-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
	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";
	status = "okay";

	
	ov2640: camera@30 {
		compatible = "ovti,ov2640";
		reg = <0x30>;
		pinctrl-names = "default";
		pinctrl-0 = <&csi1_mclk>;
		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>;
			};
		};
	};
};

&spi0 {
      status = "okay";
      ili9341@0 {
             compatible = "ilitek,ili9341";
             reg = <0>;
             spi-max-frequency = <15000000>;
             rotate = <270>;
             bgr;
             fps = <10>;
             buswidth = <8>;
             reset-gpios = <&pio 1 7 GPIO_ACTIVE_LOW>;
             dc-gpios = <&pio 1 5 GPIO_ACTIVE_LOW>;
             debug = <0>;	 
      };
};

离线

#14 2021-04-25 23:46:21

阿黄
会员
注册时间: 2018-10-03
已发帖子: 299
积分: 134

Re: 5.2内核,启动SPI屏幕(ili9341)失败

&i2c0 {
    status = "disable";
   
    ns2009: ns2009@48 {
        compatible = "nsiway,ns2009";
        reg = <0x48>;
    };
};

离线

楼主 #15 2021-04-26 23:23:20

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

阿黄 说:

&i2c0 {
    status = "disable";
   
    ns2009: ns2009@48 {
        compatible = "nsiway,ns2009";
        reg = <0x48>;
    };
};

改了之后还是报下面的错误

[    1.165724] fbtft_of_value: buswidth = 8
[    1.169696] fbtft_of_value: debug = 0
[    1.173355] fbtft_of_value: rotate = 270
[    1.177272] fbtft_of_value: fps = 10
[    1.181547] fb_ili9341 spi0.0: Failed to request reset-gpios GPIO:-2
[    1.188150] fb_ili9341: probe of spi0.0 failed with error -2

离线

#16 2021-04-27 08:24:38

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

无痕 说:
哇酷小二 说:

没理由,只能怀疑你改错了文件,或者dtb没有起作用。

我百度了下那错误,找到这个帖子,但是我看不懂。晕哥可以看下它写的内容
https://blog.csdn.net/qulang000/article/details/114686525

都按这个改了?如果也改了,把of获取reset gpio那一段屏蔽起来,看看能不能获取dc gpio.





离线

#17 2021-04-27 13:15:46

心情复杂
会员
注册时间: 2019-12-15
已发帖子: 37
积分: 30

Re: 5.2内核,启动SPI屏幕(ili9341)失败

我在5.7改了fbtft-core.c 的 fbtft_request_one_gpio  fbtft_reset 函数 能用 你可以试试

static int fbtft_request_one_gpio(struct fbtft_par *par,
				  const char *name, int index,
				  struct gpio_desc **gpiop)
{
    struct device *dev = par->info->device;
    struct device_node *node = dev->of_node;
    int gpio, flags, ret = 0;
    enum of_gpio_flags of_flags;
	char gpio_names[32];

	sprintf(gpio_names, "%s-gpios", name);
    if (of_find_property(node, gpio_names, NULL)) {
        gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
        if (gpio == -ENOENT)
            return 0;
        if (gpio == -EPROBE_DEFER)
            return gpio;
        if (gpio < 0) {
            dev_err(dev,
                "failed to get '%s' from DT\n", gpio_names);
            return gpio;
        }

         //active low translates to initially low 
        flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                            GPIOF_OUT_INIT_HIGH;
        ret = devm_gpio_request_one(dev, gpio, flags,
                        dev->driver->name);
        if (ret) {
            dev_err(dev,
                "gpio_request_one('%s'=%d) failed with %d\n",
                gpio_names, gpio, ret);
            return ret;
        }

        *gpiop = gpio_to_desc(gpio);
        fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' = GPIO%d\n",
                            __func__, gpio_names, gpio);
    }
    return ret;
}

static void fbtft_reset(struct fbtft_par *par)
{
	if (!par->gpio.reset)
		return;
	fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);
	gpiod_set_value_cansleep(par->gpio.reset, 1);
	usleep_range(20, 40);
	gpiod_set_value_cansleep(par->gpio.reset, 0);
	msleep(120);
	gpiod_set_value_cansleep(par->gpio.reset, 1);
	msleep(10);
}

离线

楼主 #18 2021-04-27 22:17:10

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

心情复杂 说:

我在5.7改了fbtft-core.c 的 fbtft_request_one_gpio  fbtft_reset 函数 能用 你可以试试

static int fbtft_request_one_gpio(struct fbtft_par *par,
				  const char *name, int index,
				  struct gpio_desc **gpiop)
{
    struct device *dev = par->info->device;
    struct device_node *node = dev->of_node;
    int gpio, flags, ret = 0;
    enum of_gpio_flags of_flags;
	char gpio_names[32];

	sprintf(gpio_names, "%s-gpios", name);
    if (of_find_property(node, gpio_names, NULL)) {
        gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
        if (gpio == -ENOENT)
            return 0;
        if (gpio == -EPROBE_DEFER)
            return gpio;
        if (gpio < 0) {
            dev_err(dev,
                "failed to get '%s' from DT\n", gpio_names);
            return gpio;
        }

         //active low translates to initially low 
        flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                            GPIOF_OUT_INIT_HIGH;
        ret = devm_gpio_request_one(dev, gpio, flags,
                        dev->driver->name);
        if (ret) {
            dev_err(dev,
                "gpio_request_one('%s'=%d) failed with %d\n",
                gpio_names, gpio, ret);
            return ret;
        }

        *gpiop = gpio_to_desc(gpio);
        fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' = GPIO%d\n",
                            __func__, gpio_names, gpio);
    }
    return ret;
}

static void fbtft_reset(struct fbtft_par *par)
{
	if (!par->gpio.reset)
		return;
	fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);
	gpiod_set_value_cansleep(par->gpio.reset, 1);
	usleep_range(20, 40);
	gpiod_set_value_cansleep(par->gpio.reset, 0);
	msleep(120);
	gpiod_set_value_cansleep(par->gpio.reset, 1);
	msleep(10);
}

我按照你贴出来的代码修改后,编译内核的时候报下面的错误,我是不是需要在头文件那里添加什么呀?

  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      drivers/staging/fbtft/fbtft-core.o
drivers/staging/fbtft/fbtft-core.c: In function ‘fbtft_request_one_gpio’:
drivers/staging/fbtft/fbtft-core.c:102:24: error: storage size of ‘of_flags’ isn’t known
     enum of_gpio_flags of_flags;
                        ^
drivers/staging/fbtft/fbtft-core.c:107:9: error: implicit declaration of function ‘of_get_named_gpio_flags’ [-Werror=implicit-function-declaration]
         gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
         ^
drivers/staging/fbtft/fbtft-core.c:119:29: error: ‘OF_GPIO_ACTIVE_LOW’ undeclared (first use in this function)
         flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                             ^
drivers/staging/fbtft/fbtft-core.c:119:29: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/fbtft/fbtft-core.c:119:51: error: ‘GPIOF_OUT_INIT_LOW’ undeclared (first use in this function)
         flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                                                   ^
drivers/staging/fbtft/fbtft-core.c:120:29: error: ‘GPIOF_OUT_INIT_HIGH’ undeclared (first use in this function)
                             GPIOF_OUT_INIT_HIGH;
                             ^
drivers/staging/fbtft/fbtft-core.c:121:9: error: implicit declaration of function ‘devm_gpio_request_one’ [-Werror=implicit-function-declaration]
         ret = devm_gpio_request_one(dev, gpio, flags,
         ^
drivers/staging/fbtft/fbtft-core.c:102:24: warning: unused variable ‘of_flags’ [-Wunused-variable]
     enum of_gpio_flags of_flags;
                        ^
cc1: some warnings being treated as errors
scripts/Makefile.build:278: recipe for target 'drivers/staging/fbtft/fbtft-core.o' failed
make[3]: *** [drivers/staging/fbtft/fbtft-core.o] Error 1
scripts/Makefile.build:498: recipe for target 'drivers/staging/fbtft' failed
make[2]: *** [drivers/staging/fbtft] Error 2
make[2]: *** Waiting for unfinished jobs....
scripts/Makefile.build:498: recipe for target 'drivers/staging' failed
make[1]: *** [drivers/staging] Error 2
Makefile:1077: recipe for target 'drivers' failed
make: *** [drivers] Error 2

离线

楼主 #19 2021-04-27 22:27:40

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:
无痕 说:
哇酷小二 说:

没理由,只能怀疑你改错了文件,或者dtb没有起作用。

我百度了下那错误,找到这个帖子,但是我看不懂。晕哥可以看下它写的内容
https://blog.csdn.net/qulang000/article/details/114686525

都按这个改了?如果也改了,把of获取reset gpio那一段屏蔽起来,看看能不能获取dc gpio.

屏蔽掉reset引脚后,就报dc-gpio没找到哈哈哈

[    1.165822] fbtft_of_value: buswidth = 8
[    1.169792] fbtft_of_value: debug = 0
[    1.173452] fbtft_of_value: rotate = 270
[    1.177369] fbtft_of_value: fps = 10
[    1.181647] fb_ili9341 spi0.0: Failed to request dc-gpios GPIO:-2
[    1.187902] fb_ili9341: probe of spi0.0 failed with error -2

离线

楼主 #20 2021-04-27 22:38:55

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

无痕 说:
心情复杂 说:

我在5.7改了fbtft-core.c 的 fbtft_request_one_gpio  fbtft_reset 函数 能用 你可以试试

static int fbtft_request_one_gpio(struct fbtft_par *par,
				  const char *name, int index,
				  struct gpio_desc **gpiop)
{
    struct device *dev = par->info->device;
    struct device_node *node = dev->of_node;
    int gpio, flags, ret = 0;
    enum of_gpio_flags of_flags;
	char gpio_names[32];

	sprintf(gpio_names, "%s-gpios", name);
    if (of_find_property(node, gpio_names, NULL)) {
        gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
        if (gpio == -ENOENT)
            return 0;
        if (gpio == -EPROBE_DEFER)
            return gpio;
        if (gpio < 0) {
            dev_err(dev,
                "failed to get '%s' from DT\n", gpio_names);
            return gpio;
        }

         //active low translates to initially low 
        flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                            GPIOF_OUT_INIT_HIGH;
        ret = devm_gpio_request_one(dev, gpio, flags,
                        dev->driver->name);
        if (ret) {
            dev_err(dev,
                "gpio_request_one('%s'=%d) failed with %d\n",
                gpio_names, gpio, ret);
            return ret;
        }

        *gpiop = gpio_to_desc(gpio);
        fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' = GPIO%d\n",
                            __func__, gpio_names, gpio);
    }
    return ret;
}

static void fbtft_reset(struct fbtft_par *par)
{
	if (!par->gpio.reset)
		return;
	fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);
	gpiod_set_value_cansleep(par->gpio.reset, 1);
	usleep_range(20, 40);
	gpiod_set_value_cansleep(par->gpio.reset, 0);
	msleep(120);
	gpiod_set_value_cansleep(par->gpio.reset, 1);
	msleep(10);
}

我按照你贴出来的代码修改后,编译内核的时候报下面的错误,我是不是需要在头文件那里添加什么呀?

  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      drivers/staging/fbtft/fbtft-core.o
drivers/staging/fbtft/fbtft-core.c: In function ‘fbtft_request_one_gpio’:
drivers/staging/fbtft/fbtft-core.c:102:24: error: storage size of ‘of_flags’ isn’t known
     enum of_gpio_flags of_flags;
                        ^
drivers/staging/fbtft/fbtft-core.c:107:9: error: implicit declaration of function ‘of_get_named_gpio_flags’ [-Werror=implicit-function-declaration]
         gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
         ^
drivers/staging/fbtft/fbtft-core.c:119:29: error: ‘OF_GPIO_ACTIVE_LOW’ undeclared (first use in this function)
         flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                             ^
drivers/staging/fbtft/fbtft-core.c:119:29: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/fbtft/fbtft-core.c:119:51: error: ‘GPIOF_OUT_INIT_LOW’ undeclared (first use in this function)
         flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
                                                   ^
drivers/staging/fbtft/fbtft-core.c:120:29: error: ‘GPIOF_OUT_INIT_HIGH’ undeclared (first use in this function)
                             GPIOF_OUT_INIT_HIGH;
                             ^
drivers/staging/fbtft/fbtft-core.c:121:9: error: implicit declaration of function ‘devm_gpio_request_one’ [-Werror=implicit-function-declaration]
         ret = devm_gpio_request_one(dev, gpio, flags,
         ^
drivers/staging/fbtft/fbtft-core.c:102:24: warning: unused variable ‘of_flags’ [-Wunused-variable]
     enum of_gpio_flags of_flags;
                        ^
cc1: some warnings being treated as errors
scripts/Makefile.build:278: recipe for target 'drivers/staging/fbtft/fbtft-core.o' failed
make[3]: *** [drivers/staging/fbtft/fbtft-core.o] Error 1
scripts/Makefile.build:498: recipe for target 'drivers/staging/fbtft' failed
make[2]: *** [drivers/staging/fbtft] Error 2
make[2]: *** Waiting for unfinished jobs....
scripts/Makefile.build:498: recipe for target 'drivers/staging' failed
make[1]: *** [drivers/staging] Error 2
Makefile:1077: recipe for target 'drivers' failed
make: *** [drivers] Error 2

在该文件添加下面这个头文件后,编译就不报错了
#include <linux/of_gpio.h>

离线

楼主 #21 2021-04-28 00:17:40

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

reset GPIO能申请到了,但是dc引脚又出问题了,报下面的错误。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

追log追到这里,原因是par->gpio.dc = 0导致下面的if条件成立。这问题奇奇怪怪的。

1173     if (pdata->display.buswidth != 9 &&  par->startbyte == 0 &&
1174         !par->gpio.dc) {
1175         printk ("@ pdata->display.buswidth = %d\n", pdata->display.buswidth);
1176         printk ("@ par->gpio.dc = %d\n", par->gpio.dc);
1177         dev_err(par->info->device,
1178             "Missing info about 'dc' gpio. Aborting.\n");
1179         return -EINVAL;
1180     }

另外我今晚跟着教程走,在4.17的内核中能够成功驱动手上的屏幕,所以屏幕是正常的。
注意屏幕上的LED引脚要接3.3V

离线

#22 2021-04-28 13:37:17

心情复杂
会员
注册时间: 2019-12-15
已发帖子: 37
积分: 30

Re: 5.2内核,启动SPI屏幕(ili9341)失败

无痕 说:

reset GPIO能申请到了,但是dc引脚又出问题了,报下面的错误。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

追log追到这里,原因是par->gpio.dc = 0导致下面的if条件成立。这问题奇奇怪怪的。

1173     if (pdata->display.buswidth != 9 &&  par->startbyte == 0 &&
1174         !par->gpio.dc) {
1175         printk ("@ pdata->display.buswidth = %d\n", pdata->display.buswidth);
1176         printk ("@ par->gpio.dc = %d\n", par->gpio.dc);
1177         dev_err(par->info->device,
1178             "Missing info about 'dc' gpio. Aborting.\n");
1179         return -EINVAL;
1180     }

另外我今晚跟着教程走,在4.17的内核中能够成功驱动手上的屏幕,所以屏幕是正常的。
注意屏幕上的LED引脚要接3.3V

你这不明显是DC申请不到吗? 可以在 fbtft_request_one_gpio 添加点打印函数 看看?

离线

楼主 #23 2021-04-28 15:38:55

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

心情复杂 说:
无痕 说:

reset GPIO能申请到了,但是dc引脚又出问题了,报下面的错误。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

追log追到这里,原因是par->gpio.dc = 0导致下面的if条件成立。这问题奇奇怪怪的。

1173     if (pdata->display.buswidth != 9 &&  par->startbyte == 0 &&
1174         !par->gpio.dc) {
1175         printk ("@ pdata->display.buswidth = %d\n", pdata->display.buswidth);
1176         printk ("@ par->gpio.dc = %d\n", par->gpio.dc);
1177         dev_err(par->info->device,
1178             "Missing info about 'dc' gpio. Aborting.\n");
1179         return -EINVAL;
1180     }

另外我今晚跟着教程走,在4.17的内核中能够成功驱动手上的屏幕,所以屏幕是正常的。
注意屏幕上的LED引脚要接3.3V

你这不明显是DC申请不到吗? 可以在 fbtft_request_one_gpio 添加点打印函数 看看?

如果dc申请不到的话,不应该是报类似下面的错误吗?

[    1.181547] fb_ili9341 spi0.0: Failed to request reset-gpios GPIO:-2

应该是报[    1.181547] fb_ili9341 spi0.0: Failed to request dc-gpios GPIO:-2

我感觉不是dc申请不到哈。不过晚点,我会按照你说,把那个地方打印出来看看。

离线

楼主 #24 2021-04-28 21:01:49

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

心情复杂 说:
无痕 说:

reset GPIO能申请到了,但是dc引脚又出问题了,报下面的错误。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

追log追到这里,原因是par->gpio.dc = 0导致下面的if条件成立。这问题奇奇怪怪的。

1173     if (pdata->display.buswidth != 9 &&  par->startbyte == 0 &&
1174         !par->gpio.dc) {
1175         printk ("@ pdata->display.buswidth = %d\n", pdata->display.buswidth);
1176         printk ("@ par->gpio.dc = %d\n", par->gpio.dc);
1177         dev_err(par->info->device,
1178             "Missing info about 'dc' gpio. Aborting.\n");
1179         return -EINVAL;
1180     }

另外我今晚跟着教程走,在4.17的内核中能够成功驱动手上的屏幕,所以屏幕是正常的。
注意屏幕上的LED引脚要接3.3V

你这不明显是DC申请不到吗? 可以在 fbtft_request_one_gpio 添加点打印函数 看看?

感谢大佬指点,按照你的指示,在fbtft_request_one_gpio加打印函数调试,发现问题,现在已经解决,屏幕已经点亮。

离线

楼主 #25 2021-04-28 21:10:45

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

昨天调试后报下面这个错误,根据楼上大佬说的是IO没有申请成功,让我在fbtft_request_one_gpio加打印函数看看,我照做了(一定要勤动手),结果真的发现问题。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

fbtft_request_one_gpio加入打印函数后的代码,关键的打印函数在108行。

5 static int fbtft_request_one_gpio(struct fbtft_par *par,
  76                   const char *name, int index,
  77                   struct gpio_desc **gpiop)
  78 {
  79 /*
  80     struct device *dev = par->info->device;
  81     struct device_node *node = dev->of_node;
  82     int ret = 0;
  83 
  84     if (of_find_property(node, name, NULL)) {
  85         *gpiop = devm_gpiod_get_index(dev, dev->driver->name, index,
  86                           GPIOD_OUT_HIGH);
  87         if (IS_ERR(*gpiop)) {
  88             ret = PTR_ERR(*gpiop);
  89             dev_err(dev,
  90                 "Failed to request %s GPIO:%d\n", name, ret);
  91             return ret;
  92         }
  93         fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
  94                   __func__, name);
  95     }
  96 
  97     return ret;
  98 */
  99 
 100     struct device *dev = par->info->device;
 101     struct device_node *node = dev->of_node;
 102     int gpio, flags, ret = 0;
 103     enum of_gpio_flags of_flags;
 104     char gpio_names[32];

 106     sprintf(gpio_names, "%s-gpios", name);
 108     printk("@ gpio_names = %s\n", gpio_names);
 109     if (of_find_property(node, gpio_names, NULL)) {
 110         gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
 111         printk ("@ gpio = %d | ENOENT = %d | EPROBE_DEFER = %d  \n", gpio, ENOENT, EPROBE_DEFER);
 112         if (gpio == -ENOENT)
 113             return 0;
 114         if (gpio == -EPROBE_DEFER)
 115             return gpio;
 116         if (gpio < 0) {
 117             dev_err(dev,
 118                 "failed to get '%s' from DT\n", gpio_names);
 119             return gpio;
 120         }
 121 
 122          //active low translates to initially low 
 123         flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
 124                             GPIOF_OUT_INIT_HIGH;
 125         ret = devm_gpio_request_one(dev, gpio, flags,
 126                         dev->driver->name);
 127         if (ret) {
 128             dev_err(dev,
 129                 "gpio_request_one('%s'=%d) failed with %d\n",
 130                 gpio_names, gpio, ret);
 131             return ret;
 132         }
 133 
 134         *gpiop = gpio_to_desc(gpio);
 135         fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' = GPIO%d\n",
 136                             __func__, gpio_names, gpio);
 137     }
 138     return ret;
 139 }

内核启动后输出的如下内容

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173480] fbtft_of_value: rotate = 90
[    1.177309] fbtft_of_value: fps = 30
[    1.181541] @ gpio_names = reset-gpios-gpios
[    1.185883] @ gpio_names = dc-gpios-gpios
[    1.189960] @ gpio_names = rd-gpios-gpios
[    1.193969] @ gpio_names = wr-gpios-gpios
[    1.197999] @ gpio_names = cs-gpios-gpios
[    1.202004] @ gpio_names = latch-gpios-gpios
[    1.206267] @ gpio_names = db-gpios-gpios
[    1.210286] @ gpio_names = led-gpios-gpios
[    1.214377] @ gpio_names = aux-gpios-gpios
[    1.218478] @ gpio_names = db-gpios-gpios
[    1.222481] @ gpio_names = led-gpios-gpios
[    1.226570] @ gpio_names = aux-gpios-gpios
[    1.230668] @ gpio_names = db-gpios-gpios
[    1.234671] @ gpio_names = led-gpios-gpios
[    1.238770] @ gpio_names = aux-gpios-gpios
[    1.242859] @ gpio_names = db-gpios-gpios
[    1.246861] @ gpio_names = led-gpios-gpios
[    1.250961] @ gpio_names = aux-gpios-gpios
[    1.255049] @ gpio_names = db-gpios-gpios
[    1.259062] @ gpio_names = led-gpios-gpios
[    1.263151] @ gpio_names = aux-gpios-gpios
[    1.267239] @ gpio_names = db-gpios-gpios
[    1.271251] @ gpio_names = led-gpios-gpios
[    1.275340] @ gpio_names = aux-gpios-gpios
[    1.279440] @ gpio_names = db-gpios-gpios
[    1.283443] @ gpio_names = led-gpios-gpios
[    1.287531] @ gpio_names = aux-gpios-gpios
[    1.291630] @ gpio_names = db-gpios-gpios
[    1.295632] @ gpio_names = led-gpios-gpios
[    1.299731] @ gpio_names = aux-gpios-gpios
[    1.303821] @ gpio_names = db-gpios-gpios
[    1.307823] @ gpio_names = led-gpios-gpios
[    1.311921] @ gpio_names = aux-gpios-gpios
[    1.316010] @ gpio_names = db-gpios-gpios
[    1.320022] @ gpio_names = led-gpios-gpios
[    1.324111] @ gpio_names = aux-gpios-gpios
[    1.328210] @ gpio_names = db-gpios-gpios
[    1.332213] @ gpio_names = led-gpios-gpios
[    1.336302] @ gpio_names = aux-gpios-gpios
[    1.340400] @ gpio_names = db-gpios-gpios
[    1.344403] @ gpio_names = led-gpios-gpios
[    1.348502] @ gpio_names = aux-gpios-gpios
[    1.352591] @ gpio_names = db-gpios-gpios
[    1.356593] @ gpio_names = led-gpios-gpios
[    1.360693] @ gpio_names = aux-gpios-gpios
[    1.364781] @ gpio_names = db-gpios-gpios
[    1.368794] @ gpio_names = led-gpios-gpios
[    1.372884] @ gpio_names = aux-gpios-gpios
[    1.376973] @ gpio_names = db-gpios-gpios
[    1.380985] @ gpio_names = led-gpios-gpios
[    1.385065] @ gpio_names = aux-gpios-gpios
[    1.389165] @ gpio_names = db-gpios-gpios
[    1.393167] @ gpio_names = led-gpios-gpios
[    1.397255] @ gpio_names = aux-gpios-gpios
[    1.401356] @ pdata->display.buswidth = 8
[    1.405358] @ par->gpio.dc = 0
[    1.408425] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting. @xkt
[    1.415483] fb_ili9341: probe of spi0.0 failed with error -22

我是输出设备树中IO口的名称,发现reset和dc引脚的名称为:reset-gpios-gpios dc-gpios-gpios。跟设备树上的节点名称不一样,所以真如楼上大佬说的,是引脚没有申请成功!所以只需要把驱动和设备树的引脚名称修改为一致就好了。有多种修改方法。

离线

#26 2021-04-28 21:12:28

心情复杂
会员
注册时间: 2019-12-15
已发帖子: 37
积分: 30

Re: 5.2内核,启动SPI屏幕(ili9341)失败

无痕 说:
心情复杂 说:
无痕 说:

reset GPIO能申请到了,但是dc引脚又出问题了,报下面的错误。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

追log追到这里,原因是par->gpio.dc = 0导致下面的if条件成立。这问题奇奇怪怪的。

1173     if (pdata->display.buswidth != 9 &&  par->startbyte == 0 &&
1174         !par->gpio.dc) {
1175         printk ("@ pdata->display.buswidth = %d\n", pdata->display.buswidth);
1176         printk ("@ par->gpio.dc = %d\n", par->gpio.dc);
1177         dev_err(par->info->device,
1178             "Missing info about 'dc' gpio. Aborting.\n");
1179         return -EINVAL;
1180     }

另外我今晚跟着教程走,在4.17的内核中能够成功驱动手上的屏幕,所以屏幕是正常的。
注意屏幕上的LED引脚要接3.3V

你这不明显是DC申请不到吗? 可以在 fbtft_request_one_gpio 添加点打印函数 看看?

感谢大佬指点,按照你的指示,在fbtft_request_one_gpio加打印函数调试,发现问题,现在已经解决,屏幕已经点亮。

大佬不敢当 roll 我也是个小菜鸡
啥问题 ? 可以分享上来下,让大家学习下。

离线

楼主 #27 2021-04-28 23:35:49

无痕
会员
注册时间: 2021-02-04
已发帖子: 28
积分: 10

Re: 5.2内核,启动SPI屏幕(ili9341)失败

心情复杂 说:
无痕 说:
心情复杂 说:

你这不明显是DC申请不到吗? 可以在 fbtft_request_one_gpio 添加点打印函数 看看?

感谢大佬指点,按照你的指示,在fbtft_request_one_gpio加打印函数调试,发现问题,现在已经解决,屏幕已经点亮。

大佬不敢当 roll 我也是个小菜鸡
啥问题 ? 可以分享上来下,让大家学习下。


问题描述已经发在楼上了哈哈

最近编辑记录 无痕 (2021-04-28 23:36:22)

离线

#28 2021-05-03 18:07:02

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 5.2内核,启动SPI屏幕(ili9341)失败

、、大佬们 如果配置spi屏 只有黑屏怎么办呀  spi总线需要上拉吗  还有是需要关闭内核的什么配置吗

离线

#29 2021-05-03 18:12:59

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

酷酷酷 说:

、、大佬们 如果配置spi屏 只有黑屏怎么办呀  spi总线需要上拉吗  还有是需要关闭内核的什么配置吗

有背光吗?

cat /dev/urandom > /dev/fb0





离线

#30 2021-05-03 18:15:52

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:
酷酷酷 说:

、、大佬们 如果配置spi屏 只有黑屏怎么办呀  spi总线需要上拉吗  还有是需要关闭内核的什么配置吗

有背光吗?

cat /dev/urandom > /dev/fb0

有背光 是黑色的 屏幕大小已经初始化了
用那个代码报错为cat: write error: No space left on device
报错以后 然后就从黑屏变成花屏了

最近编辑记录 酷酷酷 (2021-05-03 18:25:36)

离线

#31 2021-05-03 18:30:41

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

那就可以用了,fbv,fbset都可以测试,在buildroot里面有。





离线

#32 2021-05-03 18:34:26

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

那就可以用了,fbv,fbset都可以测试,在buildroot里面有。

但是为什么没有串口的输出呢 需在内核关掉什么东西吗

离线

#33 2021-05-03 18:38:56

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

需要输出什么?





离线

#34 2021-05-03 18:39:21

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

需要输出什么?

就是控制台的输出呀

离线

#35 2021-05-03 18:45:02

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

酷酷酷 说:
哇酷小二 说:

需要输出什么?

就是控制台的输出呀

这个问题问得很好,可是我不知道怎么回答。





离线

#36 2021-05-03 18:47:39

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:
酷酷酷 说:
哇酷小二 说:

需要输出什么?

就是控制台的输出呀

这个问题问得很好,可是我不知道怎么回答。

太难了吧  他们说是默认的hdmi是开着的 但是我不知道是不是这样子的

离线

#37 2021-05-03 20:52:01

酷酷酷
会员
注册时间: 2021-04-13
已发帖子: 48
积分: 45

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:
酷酷酷 说:
哇酷小二 说:

需要输出什么?

就是控制台的输出呀

这个问题问得很好,可是我不知道怎么回答。

老哥你那有编译好的fbv的库吗 这个太难编译了

离线

#38 2021-05-03 21:38:34

树先生
会员
注册时间: 2021-03-04
已发帖子: 18
积分: 11.5

Re: 5.2内核,启动SPI屏幕(ili9341)失败

我之前用5.2内核驱动ST7789也出现这个错误,网上没有找到相关的解答就换了4.13的内核,mark一下,回去试试

无痕 说:

昨天调试后报下面这个错误,根据楼上大佬说的是IO没有申请成功,让我在fbtft_request_one_gpio加打印函数看看,我照做了(一定要勤动手),结果真的发现问题。

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173478] fbtft_of_value: rotate = 270
[    1.177395] fbtft_of_value: fps = 10
[    1.181682] @ pdata->display.buswidth = 8
[    1.185755] @ par->gpio.dc = 0
[    1.188882] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting.

fbtft_request_one_gpio加入打印函数后的代码,关键的打印函数在108行。

5 static int fbtft_request_one_gpio(struct fbtft_par *par,
  76                   const char *name, int index,
  77                   struct gpio_desc **gpiop)
  78 {
  79 /*
  80     struct device *dev = par->info->device;
  81     struct device_node *node = dev->of_node;
  82     int ret = 0;
  83 
  84     if (of_find_property(node, name, NULL)) {
  85         *gpiop = devm_gpiod_get_index(dev, dev->driver->name, index,
  86                           GPIOD_OUT_HIGH);
  87         if (IS_ERR(*gpiop)) {
  88             ret = PTR_ERR(*gpiop);
  89             dev_err(dev,
  90                 "Failed to request %s GPIO:%d\n", name, ret);
  91             return ret;
  92         }
  93         fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
  94                   __func__, name);
  95     }
  96 
  97     return ret;
  98 */
  99 
 100     struct device *dev = par->info->device;
 101     struct device_node *node = dev->of_node;
 102     int gpio, flags, ret = 0;
 103     enum of_gpio_flags of_flags;
 104     char gpio_names[32];

 106     sprintf(gpio_names, "%s-gpios", name);
 108     printk("@ gpio_names = %s\n", gpio_names);
 109     if (of_find_property(node, gpio_names, NULL)) {
 110         gpio = of_get_named_gpio_flags(node, gpio_names, index, &of_flags);
 111         printk ("@ gpio = %d | ENOENT = %d | EPROBE_DEFER = %d  \n", gpio, ENOENT, EPROBE_DEFER);
 112         if (gpio == -ENOENT)
 113             return 0;
 114         if (gpio == -EPROBE_DEFER)
 115             return gpio;
 116         if (gpio < 0) {
 117             dev_err(dev,
 118                 "failed to get '%s' from DT\n", gpio_names);
 119             return gpio;
 120         }
 121 
 122          //active low translates to initially low 
 123         flags = (of_flags & OF_GPIO_ACTIVE_LOW) ? GPIOF_OUT_INIT_LOW :
 124                             GPIOF_OUT_INIT_HIGH;
 125         ret = devm_gpio_request_one(dev, gpio, flags,
 126                         dev->driver->name);
 127         if (ret) {
 128             dev_err(dev,
 129                 "gpio_request_one('%s'=%d) failed with %d\n",
 130                 gpio_names, gpio, ret);
 131             return ret;
 132         }
 133 
 134         *gpiop = gpio_to_desc(gpio);
 135         fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' = GPIO%d\n",
 136                             __func__, gpio_names, gpio);
 137     }
 138     return ret;
 139 }

内核启动后输出的如下内容

[    1.165851] fbtft_of_value: buswidth = 8
[    1.169818] fbtft_of_value: debug = 0
[    1.173480] fbtft_of_value: rotate = 90
[    1.177309] fbtft_of_value: fps = 30
[    1.181541] @ gpio_names = reset-gpios-gpios
[    1.185883] @ gpio_names = dc-gpios-gpios
[    1.189960] @ gpio_names = rd-gpios-gpios
[    1.193969] @ gpio_names = wr-gpios-gpios
[    1.197999] @ gpio_names = cs-gpios-gpios
[    1.202004] @ gpio_names = latch-gpios-gpios
[    1.206267] @ gpio_names = db-gpios-gpios
[    1.210286] @ gpio_names = led-gpios-gpios
[    1.214377] @ gpio_names = aux-gpios-gpios
[    1.218478] @ gpio_names = db-gpios-gpios
[    1.222481] @ gpio_names = led-gpios-gpios
[    1.226570] @ gpio_names = aux-gpios-gpios
[    1.230668] @ gpio_names = db-gpios-gpios
[    1.234671] @ gpio_names = led-gpios-gpios
[    1.238770] @ gpio_names = aux-gpios-gpios
[    1.242859] @ gpio_names = db-gpios-gpios
[    1.246861] @ gpio_names = led-gpios-gpios
[    1.250961] @ gpio_names = aux-gpios-gpios
[    1.255049] @ gpio_names = db-gpios-gpios
[    1.259062] @ gpio_names = led-gpios-gpios
[    1.263151] @ gpio_names = aux-gpios-gpios
[    1.267239] @ gpio_names = db-gpios-gpios
[    1.271251] @ gpio_names = led-gpios-gpios
[    1.275340] @ gpio_names = aux-gpios-gpios
[    1.279440] @ gpio_names = db-gpios-gpios
[    1.283443] @ gpio_names = led-gpios-gpios
[    1.287531] @ gpio_names = aux-gpios-gpios
[    1.291630] @ gpio_names = db-gpios-gpios
[    1.295632] @ gpio_names = led-gpios-gpios
[    1.299731] @ gpio_names = aux-gpios-gpios
[    1.303821] @ gpio_names = db-gpios-gpios
[    1.307823] @ gpio_names = led-gpios-gpios
[    1.311921] @ gpio_names = aux-gpios-gpios
[    1.316010] @ gpio_names = db-gpios-gpios
[    1.320022] @ gpio_names = led-gpios-gpios
[    1.324111] @ gpio_names = aux-gpios-gpios
[    1.328210] @ gpio_names = db-gpios-gpios
[    1.332213] @ gpio_names = led-gpios-gpios
[    1.336302] @ gpio_names = aux-gpios-gpios
[    1.340400] @ gpio_names = db-gpios-gpios
[    1.344403] @ gpio_names = led-gpios-gpios
[    1.348502] @ gpio_names = aux-gpios-gpios
[    1.352591] @ gpio_names = db-gpios-gpios
[    1.356593] @ gpio_names = led-gpios-gpios
[    1.360693] @ gpio_names = aux-gpios-gpios
[    1.364781] @ gpio_names = db-gpios-gpios
[    1.368794] @ gpio_names = led-gpios-gpios
[    1.372884] @ gpio_names = aux-gpios-gpios
[    1.376973] @ gpio_names = db-gpios-gpios
[    1.380985] @ gpio_names = led-gpios-gpios
[    1.385065] @ gpio_names = aux-gpios-gpios
[    1.389165] @ gpio_names = db-gpios-gpios
[    1.393167] @ gpio_names = led-gpios-gpios
[    1.397255] @ gpio_names = aux-gpios-gpios
[    1.401356] @ pdata->display.buswidth = 8
[    1.405358] @ par->gpio.dc = 0
[    1.408425] fb_ili9341 spi0.0: Missing info about 'dc' gpio. Aborting. @xkt
[    1.415483] fb_ili9341: probe of spi0.0 failed with error -22

我是输出设备树中IO口的名称,发现reset和dc引脚的名称为:reset-gpios-gpios dc-gpios-gpios。跟设备树上的节点名称不一样,所以真如楼上大佬说的,是引脚没有申请成功!所以只需要把驱动和设备树的引脚名称修改为一致就好了。有多种修改方法。

离线

#39 2021-09-06 18:37:12

liefyuan
会员
注册时间: 2021-05-30
已发帖子: 69
积分: 95

Re: 5.2内核,启动SPI屏幕(ili9341)失败

大佬们,某宝上买了一款ili9341的屏幕240x320没有CS引脚,shell里面可以显示fb0但是屏幕是一片白色的?测试也没有反应,上电也没有打印信息,该怎么办?

离线

#40 2021-11-20 22:10:26

树莓学LINUX
会员
注册时间: 2021-10-28
已发帖子: 95
积分: 105
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

酷酷酷 说:
哇酷小二 说:
酷酷酷 说:

就是控制台的输出呀

这个问题问得很好,可是我不知道怎么回答。

太难了吧  他们说是默认的hdmi是开着的 但是我不知道是不是这样子的

如果是串口可以登录,应该是因为没有打开双端显示,意味着屏幕默认没有开启登录,可以开启双端显示,右上角有解决办法

离线

#41 2021-12-09 20:32:20

inner
会员
注册时间: 2021-11-09
已发帖子: 21
积分: 6

Re: 5.2内核,启动SPI屏幕(ili9341)失败

请问这样是初始化成功了吗
6

离线

#42 2022-07-30 23:48:27

tevada2010
会员
注册时间: 2022-07-23
已发帖子: 54
积分: 69

Re: 5.2内核,启动SPI屏幕(ili9341)失败

我已经完成了每一步 为什么显示器不显示?

https://whycan.com/t_6413.html

294852832_573954257546892_1233592662052268409_n.jpg294726111_1099367357681843_8528158930884724977_n.jpg

U-Boot 2017.01-rc2-00073-gdd6e8740dc-dirty (Jul 31 2022 - 11:52:11 +0700) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: unrecognized JEDEC id bytes: 00, c2, 12
*** Warning - spi_flash_probe() failed, using default environment

In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000
Net:   No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot:  0 
reading zImage
4196800 bytes read in 232 ms (17.3 MiB/s)
reading sun8i-v3s-licheepi-zero-dock.dtb
12397 bytes read in 30 ms (403.3 KiB/s)
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42df9000, end 42dff06c ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-zero (tevada@T420s) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05)) #6 SMP Sun Jul 31 21:06:16 +07 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Zero with Dock
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 panic=5 mtdparts=spi32766.0:1M(uboot),64k(dtb),4M(kernel),-(rootfs) rootwait root=/dev/mmcblk0p2 earlyprintk rw  vt.global_cursor_default=0
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 55044K/65536K available (6144K kernel code, 301K rwdata, 1684K rodata, 1024K init, 254K bss, 10492K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x300/0x48c with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000019] Switching to timer-based delay loop, resolution 41ns
[    0.000210] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000451] Console: colour dummy device 80x30
[    0.000507] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000523] pid_max: default: 32768 minimum: 301
[    0.000686] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000703] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001507] CPU: Testing write buffer coherency: ok
[    0.002022] /cpus/cpu@0 missing clock-frequency property
[    0.002048] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002815] Setting up static identity map for 0x40100000 - 0x40100060
[    0.003022] rcu: Hierarchical SRCU implementation.
[    0.003567] smp: Bringing up secondary CPUs ...
[    0.003586] smp: Brought up 1 node, 1 CPU
[    0.003597] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003604] CPU: All CPU(s) started in SVC mode.
[    0.004683] devtmpfs: initialized
[    0.008173] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.008494] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008526] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.008770] pinctrl core: initialized pinctrl subsystem
[    0.009804] NET: Registered protocol family 16
[    0.010423] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.011687] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.011706] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.035081] SCSI subsystem initialized
[    0.035244] usbcore: registered new interface driver usbfs
[    0.035298] usbcore: registered new interface driver hub
[    0.035418] usbcore: registered new device driver usb
[    0.035651] mc: Linux media interface: v0.10
[    0.035692] videodev: Linux video capture interface: v2.00
[    0.035881] Advanced Linux Sound Architecture Driver Initialized.
[    0.037188] clocksource: Switched to clocksource arch_sys_counter
[    0.049291] NET: Registered protocol family 2
[    0.050120] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.050160] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.050185] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.050209] TCP: Hash tables configured (established 1024 bind 1024)
[    0.050354] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.050406] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.050700] NET: Registered protocol family 1
[    0.052563] Initialise system trusted keyrings
[    0.052935] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.090419] Key type asymmetric registered
[    0.090441] Asymmetric key parser 'x509' registered
[    0.090541] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.090553] io scheduler mq-deadline registered
[    0.090560] io scheduler kyber registered
[    0.091569] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.095297] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.164058] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.166389] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.167563] printk: console [ttyS0] disabled
[    0.187847] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[    0.702720] printk: console [ttyS0] enabled
[    0.731672] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.742960] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.749580] ehci-platform: EHCI generic platform driver
[    0.755100] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.760774] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.768731] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    0.797213] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.804423] hub 1-0:1.0: USB hub found
[    0.808377] hub 1-0:1.0: 1 port detected
[    0.812959] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.819279] ohci-platform: OHCI generic platform driver
[    0.824817] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.831558] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.839555] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    0.912278] hub 2-0:1.0: USB hub found
[    0.916125] hub 2-0:1.0: 1 port detected
[    0.923471] usbcore: registered new interface driver usb-storage
[    0.930748] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[    0.940032] sun6i-rtc 1c20400.rtc: registered as rtc0
[    0.945094] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.949816] i2c /dev entries driver
[    0.954200] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.962886] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    0.999313] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.006575] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.041672] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.049759] usbcore: registered new interface driver usbhid
[    1.055335] usbhid: USB HID core driver
[    1.059383] fbtft_of_value: buswidth = 8
[    1.063311] fbtft_of_value: debug = 0
[    1.066969] fbtft_of_value: rotate = 90
[    1.070841] fbtft_of_value: fps = 30
[    1.084058] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.095947] mmc0: new high speed SD card at address e624
[    1.103110] mmcblk0: mmc0:e624 SU02G 1.84 GiB 
[    1.108669] mmc1: queuing unknown CIS tuple 0x01 (3 bytes)
[    1.119178]  mmcblk0: p1 p2
[    1.125484] mmc1: queuing unknown CIS tuple 0x1a (5 bytes)
[    1.134200] mmc1: queuing unknown CIS tuple 0x1b (8 bytes)
[    1.141570] mmc1: queuing unknown CIS tuple 0x80 (1 bytes)
[    1.147100] mmc1: queuing unknown CIS tuple 0x81 (1 bytes)
[    1.152699] mmc1: queuing unknown CIS tuple 0x82 (1 bytes)
[    1.158256] mmc1: new high speed SDIO card at address 0001
[    1.364748] random: fast init done
[    1.400120] Console: switching to colour frame buffer device 40x30
[    1.407009] graphics fb0: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=33, spi0.0 at 48 MHz
[    1.420661] sun4i-codec 1c22c00.codec: ASoC: codec-analog@01c23000 not registered
[    1.428304] sun4i-codec 1c22c00.codec: Failed to register our card
[    1.435554] Initializing XFRM netlink socket
[    1.439995] NET: Registered protocol family 17
[    1.448384] Registering SWP/SWPB emulation handler
[    1.464852] Loading compiled-in X.509 certificates
[    1.480779] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.492236] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.498078] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.512457] random: crng init done
[    1.519802] hub 3-0:1.0: USB hub found
[    1.524108] hub 3-0:1.0: 1 port detected
[    1.530974] debugfs: Directory '1c22c00.codec' with parent 'V3s Audio Codec' already present!
[    1.539665] sun4i-codec 1c22c00.codec: ASoC: Failed to create component debugfs directory: -17
[    1.549756] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[    1.558304] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:05:48 UTC (348)
[    1.566671] vcc5v0: disabling
[    1.569728] ALSA device list:
[    1.572699]   #0: V3s Audio Codec
[    1.615172] EXT4-fs (mmcblk0p2): recovery complete
[    1.622057] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.630315] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.638526] devtmpfs: mounted
[    1.642696] Freeing unused kernel memory: 1024K
[    1.647461] Run /sbin/init as init process
[    1.745748] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: OK
Starting network: OK

Welcome to Buildroot for the LicheePi Zero
licheepi-zero login: 

最近编辑记录 tevada2010 (2022-07-31 22:23:13)

离线

#43 2022-08-01 11:10:08

tevada2010
会员
注册时间: 2022-07-23
已发帖子: 54
积分: 69

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

那就可以用了,fbv,fbset都可以测试,在buildroot里面有。

如何在 buildroot 中设置 fbv、fbset?

离线

#44 2022-08-01 11:25:14

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

tevada2010 说:
哇酷小二 说:

那就可以用了,fbv,fbset都可以测试,在buildroot里面有。

如何在 buildroot 中设置 fbv、fbset?

(V3s/V3x/S3/S3L/R11通吃)小智V3x开发板smallwitpi lite u-boot/linux/buildroot测试
https://whycan.com/t_7248.html





离线

#45 2022-08-01 19:42:35

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

tevada2010 说:
哇酷小二 说:

那就可以用了,fbv,fbset都可以测试,在buildroot里面有。

如何在 buildroot 中设置 fbv、fbset?

或者配置 fbtest,可以不用buildroot编译,用静态链接即可。





离线

#46 2022-08-01 19:43:54

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

或者红绿蓝三色测试


全志D1哪吒开发板 framebuffer 测试
https://bbs.aw-ol.com/topic/521





离线

#47 2022-08-01 20:03:33

tevada2010
会员
注册时间: 2022-07-23
已发帖子: 54
积分: 69

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

或者红绿蓝三色测试


全志D1哪吒开发板 framebuffer 测试
https://bbs.aw-ol.com/topic/521

我在 buildroot 设置了 fbv,但图像仍然没有显示在屏幕上。

7c3ae2692615c730b95be093f6cfbc13.png

离线

#48 2022-08-01 20:08:48

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

怎么执行的?





离线

#49 2022-08-01 20:23:20

tevada2010
会员
注册时间: 2022-07-23
已发帖子: 54
积分: 69

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:

怎么执行的?

LCD 屏幕上不显示图像。

离线

#50 2022-08-01 20:27:30

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: 5.2内核,启动SPI屏幕(ili9341)失败

tevada2010 说:
哇酷小二 说:

怎么执行的?

LCD 屏幕上不显示图像。

你得执行才行,不执行怎么显示呢?





离线

#51 2022-08-01 20:47:36

tevada2010
会员
注册时间: 2022-07-23
已发帖子: 54
积分: 69

Re: 5.2内核,启动SPI屏幕(ili9341)失败

哇酷小二 说:
tevada2010 说:
哇酷小二 说:

怎么执行的?

LCD 屏幕上不显示图像。

你得执行才行,不执行怎么显示呢?

fbv bb.jpg
我以前做这个命令,现在可以显示了。
295797684_1218701018704082_1983921625657657191_n.jpg


如果要显示引导映像,如下所示。 我该如何设置?
9e26c8e7c46319e83c14a660691ca535_4160x3120.jpeg

最近编辑记录 tevada2010 (2022-08-01 20:49:47)

离线

#52 2024-11-13 19:51:02

鄢家豪
会员
注册时间: 2024-11-13
已发帖子: 3
积分: 3

Re: 5.2内核,启动SPI屏幕(ili9341)失败

@无痕
这个pio怎么配置啊,我原先设备树中没有这个配置

离线

页脚

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

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