Getting LVGL working on Pico Mini B

  • We have tested controlling the Pico LCD 1.3 using the framebuffer on the Pico Mini B. According to the information you've provided, it appears that the chip select 0 pin is occupied. Please check whether the settings in the device tree are correct.
  • Hi Crocodile,
    Crocodile wrote: 2024-08-09 2:11 We have tested controlling the Pico LCD 1.3 using the framebuffer on the Pico Mini B. According to the information you've provided, it appears that the chip select 0 pin is occupied. Please check whether the settings in the device tree are correct.
    this is the content of my rv1103g-luckfox-pico-mini-b.dts:

    Code: Select all

    /dts-v1/;
    
    #include "rv1103.dtsi"
    #include "rv1106-evb.dtsi"
    #include "rv1103-luckfox-pico-ipc.dtsi"
    
    / {
    	model = "Luckfox Pico Mini B";
    	compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1103";
    };
    
    /**********SFC**********/
    &sfc {
    	status = "okay";
    	flash@0 {
    		compatible = "spi-nand";
    		reg = <0>;
    		spi-max-frequency = <75000000>;
    		spi-rx-bus-width = <4>;
    		spi-tx-bus-width = <1>;
    	};
    };
    
    /**********SDMMC**********/
    &sdmmc {
    	max-frequency = <50000000>;
    	no-sdio;
    	no-mmc;
    	bus-width = <4>;
    	cap-mmc-highspeed;
    	cap-sd-highspeed;
    	disable-wp;
    	pinctrl-names = "default";
    	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
    	status = "okay";
    };
    
    /**********ETH**********/
    &gmac {
    	status = "disabled";
    };
    
    /**********USB**********/
    &usbdrd_dwc3 {
    	status = "okay";
    	dr_mode = "peripheral";
    };
    
    /**********SPI**********/
    /* SPI0_M0 */
    /*
    &spi0 {
    	status = "disabled";
    	spidev@0 {
    		spi-max-frequency = <50000000>;
    	};
    };
    */
    /**********spi**********/
    /{
    	/*LCD_CS -- USE MISO*/
        gpio1pc3:gpio1pc3 {
            compatible = "regulator-fixed";
            pinctrl-names = "default";
            pinctrl-0 = <&gpio1_pc3>;
            regulator-name = "gpio1_pc3";
            regulator-always-on;
        };
    
    	/*LCD_BL*/
    	gpio0pa4:gpio0pa4 {
    		compatible = "regulator-fixed";
    		pinctrl-names = "default";
    		pinctrl-0 = <&gpio0_pa4>;
    		regulator-name = "gpio0_pa4";
    		regulator-always-on;
    	};
    
    	/*LCD_DC*/
        gpio1pd0:gpio1pd0 {
            compatible = "regulator-fixed";
            pinctrl-names = "default";
            pinctrl-0 = <&gpio1_pd0>;
            regulator-name = "gpio1_pd0";
            regulator-always-on;
        };
    
    	/*LCD_RES*/
        gpio1pd1:gpio1pd1 {
            compatible = "regulator-fixed";
            pinctrl-names = "default";
            pinctrl-0 = <&gpio1_pd1>;
            regulator-name = "gpio1_pd1";
            regulator-always-on;
        };
    };
    
    &pinctrl {
    	/*LCD_CS -- USE MISO*/
        gpio1-pc3 {
            gpio1_pc3:gpio1-pc3 {
                rockchip,pins = <1 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
            };
        };
    
    	/*LCD_BL*/
    	gpio0-pa4 {
    		gpio0_pa4:gpio0-pa4 {
    			rockchip,pins =	<0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
    		};
    	};
    
    	/*LCD_DC*/
        gpio1-pd0 {
            gpio1_pd0:gpio1-pd0 {
                rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
            };
        };
    
    	/*LCD_RES*/
        gpio1-pd1 {
            gpio1_pd1:gpio1-pd1 {
                rockchip,pins = <1 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
            };
        };
    
        spi0 {
            /omit-if-no-ref/
            spi0m0_pins: spi0m0-pins {
                rockchip,pins =
                    /* spi0_clk_m0 */
                    <1 RK_PC1 4 &pcfg_pull_none>,
                    /* spie_miso_m0 */
                    /* <1 RK_PC3 6 &pcfg_pull_none>, */	// 先不动,还用uart4作为bl
                    /* spi_mosi_m0 */
                    <1 RK_PC2 6 &pcfg_pull_none>;
            };
        };
    };
    
    &spi0 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi0m0_pins>;
    	
    
    	lcd: lcd@0{						
    		status = "okay";
    		compatible = "sitronix,st7735";
    		reg = <0>;					
    
    		spi-max-frequency = <6000000>;
    		spi-cpol;
    		spi-cpha;
    		rotate = <0>;
    		fps = <30>;
    		rgb;
    		buswidth = <8>;
    
    		cs = <&gpio1 RK_PC3 GPIO_ACTIVE_LOW>;		//spi0_miso
    		led = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;		//BL
    		dc = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;		//DC
    		reset = <&gpio1 RK_PD1 GPIO_ACTIVE_LOW>;	//RES
    
    		debug = <0x7>;
    	};
    };
    
    /**********I2C**********/
    /* I2C3_M1 */
    &i2c3 {
    	status = "disabled";
    	clock-frequency = <100000>;
    };
    
    /**********UART**********/
    /* UART3_M1 */
    &uart3 {
    	status = "disabled";
    };
    
    /* UART4_M1 */
    &uart4 {
    	status = "disabled";
    };
    
    /**********PWM**********/
    /* PWM1_M0 */
    &pwm1 {
    	status = "disabled";
    };
    
    it looks correct to me unless im missing something.
  • Hello, please try to comment out the entire spi0 node in the rv1103-luckfox-pico-ipc.dtsi file, as the settings of the two SPI interfaces are conflicting with each other.
  • Crocodile wrote: 2024-08-10 2:17 Hello, please try to comment out the entire spi0 node in the rv1103-luckfox-pico-ipc.dtsi file, as the settings of the two SPI interfaces are conflicting with each other.
    It worked :), thanks for the help, i got /dev/fb0 file and i get "noise" on the screen if i run: cat /dev/urandom > /dev/fb0

    I just noticed that in the wiki is indicated to "Comment out the original SPI0 configuration first" but i tought it was the one in the mini B dts.