notro / fbtft

Linux Framebuffer drivers for small TFT LCD display modules. Development has moved to https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing
1.85k stars 494 forks source link

Ada Fruit 2.8 #205

Closed steveuw closed 9 years ago

steveuw commented 9 years ago

Hi,

Sorry if I have posted to the wrong location.

I have an AdaFruit 2.8 (http://www.adafruit.com/product/1601) that I am trying to use with a BeagleBoneBlack.

I have followed the instructions from https://learn.adafruit.com/downloads/pdf/user-space-spi-tft-python-library-ili9341-2-8.pdf and have managed to get the the ILI9341 python library working with their cat and line drawing examples.

However I wanted to get the FBTFT working. /dev/fb0 is registered, hower when the module starts I seem to get diagonal dots on the screen. However the size reported by dmesg appears to be correct. Do you have any ideas what I am doing wrong?

Regards,

Steve.

Snip from dmesg is:

[ 123.359415] bone-capemgr bone_capemgr.9: part_number 'BB-ILI9341', version 'N/A' [ 123.359493] bone-capemgr bone_capemgr.9: slot #9: generic override [ 123.359511] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 9 [ 123.359529] bone-capemgr bone_capemgr.9: slot #9: 'Override Board Name,00A0,Override Manuf,BB-ILI9341' [ 123.359636] bone-capemgr bone_capemgr.9: slot #9: Requesting part number/version based 'BB-ILI9341-00A0.dtbo [ 123.359653] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware 'BB-ILI9341-00A0.dtbo' for board-name 'Override Board Name', version '00A0' [ 123.362260] bone-capemgr bone_capemgr.9: slot #9: dtbo 'BB-ILI9341-00A0.dtbo' loaded; converting to live tree [ 123.363348] bone-capemgr bone_capemgr.9: slot #9: #5 overlays [ 123.368996] of_get_named_gpio_flags exited with status 113 [ 123.369018] of_get_named_gpio_flags exited with status 7 [ 123.392091] edma-dma-engine edma-dma-engine.0: allocated channel for 0:43 [ 123.392153] edma-dma-engine edma-dma-engine.0: allocated channel for 0:42 [ 123.392354] fbtft_of_value: regwidth = 8 [ 123.392367] fbtft_of_value: buswidth = 8 [ 123.392377] fbtft_of_value: rotate = 90 [ 123.392387] fbtft_of_value: fps = 25 [ 123.392619] of_get_named_gpio_flags exited with status 38 [ 123.392649] of_get_named_gpio_flags exited with status 28 [ 123.750376] Console: switching to colour frame buffer device 80x40 [ 123.755284] graphics fb0: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB DMA buffer memory, fps=25, spi2.0 at 50 MHz [ 123.755974] fbtft_of_value: regwidth = 8 [ 123.755989] fbtft_of_value: buswidth = 8 [ 123.756000] fbtft_of_value: rotate = 90 [ 123.756009] fbtft_of_value: fps = 25 [ 123.756252] of_get_named_gpio_flags exited with status 38 [ 123.756267] gpio_request: gpio-38 (fb_ili9341) status -16

From the python script, my LCD is set up as: DC = 'P9_12' RST = 'P9_10'

My DTO file is (which I used to test the python script (with compatable set to "spidev") is: exclusive-use = /* the pin header uses / "P9.31", / spi1sclk / "P9.29", /_ spi1d0 MISO / "P9.30", /_ spi1d1 MOSI / "P9.42", /_ spi1cs1 / "P8.45", /_ gpio26 - reset / "P9.12", /_ gpio128 - dc / "P9.14", / backlight / "P9.11", /_ gpio0_31 touch irq */ "spi1";

    fragment@0 {
            target = <&am33xx_pinmux>;
            __overlay__ {
                    bb_spi1_pins: pinmux_bb_spi1_pins {
                            pinctrl-single,pins = <
                                    0x190 0x13      /* P9.31 = mcasp0_aclkx.spi1_sclk, OUTPUT_PULLUP | MODE3 */
                                    0x194 0x13      /* P9.29 = mcasp0_fsx.spi1_d0, OUTPUT_PULLUP | MODE3 */
                                    0x198 0x33      /* p9.30 = mcasp0_axr0.spi1_d1, INPUT_PULLUP | MODE3 */
                                    0x19c 0x13      /* p9.29 = mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */
                                    0x164 0x12      /* p9.42 = eCAP0_in_PWM0_out.spi1_cs1 OUTPUT_PULLUP | MODE2 */
                            >;
                    };

                    lcd_ctrl_pinmux: lcd_ctrl_pins {
                            pinctrl-single,pins = <
                                    0x078 0x17      /* P9.12 gpio1_28  OUTPUT_PULLUP | MODE7 */
                                    0x0a4 0x17      /* P8.45 gpio2_6  OUTPUT_PULLUP | MODE7 */
                                    0x070 0x37      /* P9.11 gpio0_31  INPUT_PULLUP  | MODE7 */
                            >;
                    };
            };
    };

    fragment@1 {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    status = "okay";
                    pinctrl-names = "default";
                    pinctrl-0 = <&bb_spi1_pins>;
                    ti,pindir-d0-out-d1-in = <1>;
                    cs-gpios         = <&gpio4 17 0>,<&gpio1 7 0>;

            lcd@0{

                            #address-cells = <1>;
                            #size-cells = <0>;
                            rotate=<90>;
                            bgr;
                            fps=<25>;
                            compatible = "ilitek,ili9341";
                            spi-max-frequency = <50000000>;
                            reg = <0>;
                            regwidth=<8>;
                            buswidth=<8>;
                            verbose=<3>;
                            reset-gpios = <&gpio2 6 0>;
                            dc-gpios = <&gpio1 28 0>;
                    };
            };
    };

    fragment@2 {
            target = <&epwmss1>;
            __overlay__ {
                    status = "okay";
            };
    };

    fragment@3 {
            target = <&ehrpwm1>;
            __overlay__ {
                    status = "okay";
            };
    };

    fragment@4 {
            target = <&ocp>;
                __overlay__ {
                        backlight {
                                    status = "okay";
                             };
               };
    };

};

notro commented 9 years ago

Try ili9340 Adafruit uses fb_ili9340 with it's default init sequence: https://github.com/adafruit/adafruit-rpi-fbtft/blob/master/fbtft_device.c#L363 I use fb_ili9341 with a custom init sequence: https://github.com/notro/fbtft/blob/master/fbtft_device.c#L157 DT: https://github.com/notro/fbtft/blob/master/dts/rpi.dts#L292

notro commented 9 years ago

Closing issue since there has been no activity for more than 2 months. Reopen if needed.