SAMA5D31 LCD SPI ST7735S NOT WORK

Moderator: nferre

LAG
Posts: 7
Joined: Sun Aug 17, 2014 12:13 am

SAMA5D31 LCD SPI ST7735S NOT WORK

Thu Dec 31, 2015 3:19 am

Hi everyone...
As topic i have connect a tft module based to st7735s on spi port of cpu SAMA5D31 but not work.
I'm using kernel 4.2.6 with debian jessie rootfs. Into kernel i have compile fbtft driver with (*) for st7735r.
I have setting in dts:

Code: Select all

....
      spi0: spi@f0004000 {
        cs-gpios = <&pioD 13 0>;
        status = "okay";

        fb_st7735r@0 {
          compatible = "fb_st7735r";
          spi-max-frequency = <8000000>;     
          reg = <0>;
          debug = <7>;
          buswidth = <8>;
          reset-gpios = <&pioB 6 0>;
          dc-gpios = <&pioB 3 0>;
          /* led-gpios = <&pioB 7 0>; */ /* use for led on display (backlight) */
          width = <128>;
          height = <128>;
        };
      };
....
When power up board printk say:

Code: Select all

....
atmel_spi f0004000.spi: version: 0x213
atmel_spi f0004000.spi: Using dma0chan2 (tx) and dma0chan3 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller at 0xf0004000 (irq 26)
....
fbtft_of_value: width = 128
fbtft_of_value: height = 128
fbtft_of_value: regwidth = 8
fbtft_of_value: buswidth = 8
fbtft_of_value: debug = 7
fb_st7735r spi32766.0: fbtft_gamma_parse_str() str=
fb_st7735r spi32766.0: 0F 1A 0F 18 2F 28 20 22 1F 1B 23 37 00 07 02 10
0F 1B 0F 17 33 2C 29 2E 30 30 39 3F 00 07 03 10
fb_st7735r spi32766.0: fbtft_request_one_gpio: 'reset-gpios' = GPIO38
fb_st7735r spi32766.0: fbtft_request_one_gpio: 'dc-gpios' = GPIO35
fb_st7735r spi32766.0: fbtft_request_one_gpio: 'led-gpios' = GPIO39
fb_st7735r spi32766.0: fbtft_verify_gpios()
fb_st7735r spi32766.0: fbtft_init_display()
fb_st7735r spi32766.0: fbtft_reset()
....
Datasheet of display indicate pin to connect to cpu:

Code: Select all

          DISPLAY              SAMA5D31
------------------------|---------------------
01 - NC
02 - LED+      --------------> VCC
03 - LED-       --------------> PB7
04 - NC
05 - NC
06 - NC
07 - NC
08 - VDD        --------------> VCC
09 - GND        --------------> GND
10 - VDDI       --------------> VCC
11 - NC
12 - /CS         --------------> PD13
13 - IM2         --------------> GND
14 - SPI4W     --------------> VCC
15 - /RST        --------------> PB6
16 - /RD
17 - VDDI       --------------> VCC
18 - DB7
19 - DB6
20 - DB5
21 - DB4
22 - DB3
23 - DB2
24 - DB1
25 - DB0        --------------> PD11
26 - NWR/RNW     ----------> PB3
27 - RS/DNC   --------------> PD12
28 - ID
29 - NC
Follow connect scheme by datasheet.
Image
When try execute from console:

Code: Select all

fbi -d /dev/fb0 -T 1 logo.jpg
debug printk say:

Code: Select all

fb_st7735r spi32766.0: fbtft_update_display(start_line=0, end_line=127)
fb_st7735r spi32766.0: set_addr_win(xs=0, ys=0, xe=127, ye=127)
fb_st7735r spi32766.0: fbtft_write_reg8_bus8: 2a 00 00 00 7f
fb_st7735r spi32766.0: fbtft_write_spi(len=1): 2a
fb_st7735r spi32766.0: fbtft_write_spi(len=4): 00 00 00 7f
fb_st7735r spi32766.0: fbtft_write_reg8_bus8: 2b 00 00 00 7f
fb_st7735r spi32766.0: fbtft_write_spi(len=1): 2b
fb_st7735r spi32766.0: fbtft_write_spi(len=4): 00 00 00 7f
fb_st7735r spi32766.0: fbtft_write_reg8_bus8: 2c
fb_st7735r spi32766.0: fbtft_write_spi(len=1): 2c
fb_st7735r spi32766.0: fbtft_write_vmem16_bus8(offset=0, len=32768)
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 00 00 00 00 ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff ff ff ff ff ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff  ff ff ff ff ff ff f7 ff 96 96 13 67 ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 ff ff ff ff f7 ff 8d f4 13 67 03 a6  03 a6 03 a6 03 a6 03 a6 03 a6 03 a6 ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 e7 fe 7d b2 0b 67 03 a6 03 c7 03 87  13 67 86 13 cf 3b 18 e3 18 e3 18 e3 ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 ff ff ff ff f7 ff c7 5a 13 67 03 a6  03 a6 03 a6 03 a6 03 a6 03 87 0b 87 ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff  ff ff ff ff ff ff f7 ff e7 fe 54 8e ...
fb_st7735r spi32766.0: fbtft_write_spi(len=4096): 00 00 ff ff ff ff ff ff ff ff de db 63 2c 63 2c 63 2c 63 2c  84 10 c6 18 f7 be ff ff 63 2c 63 2c ...
fb_st7735r spi32766.0: Display update: 143 kB/s (221.822 ms), fps=0 (18589.997 ms)
but display still blank. Doesn't appear nothing

I just test wire and is all ok.
I think the problem is another but i don't know. :cry: :cry: :cry:

Whats wrong?
Any suggest is very appreciated.
Thank you.
blue_z
Location: USA
Posts: 1978
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D31 LCD SPI ST7735S NOT WORK

Thu Dec 31, 2015 10:18 pm

LAG wrote:As topic i have connect a tft module based to st7735s on spi port of cpu SAMA5D31 but not work.
You're dealing with too many unknowns at once.
You would probably save net time by verifying the hardware side by using a bare-metal program (derived from a SoftPack example) or a U-Boot "standalone" program.
All the DT and kernel analysis and tweaking is a waste of time & effort if you don't have proof that the HW is functional.

Regards
LAG
Posts: 7
Joined: Sun Aug 17, 2014 12:13 am

Re: SAMA5D31 LCD SPI ST7735S NOT WORK

Sat Jan 02, 2016 1:37 pm

Thank you for reply blue_z.
You are right. Today I have tested with oscilloscope and :shock: :shock: PIN MOSI of SAMA5D31 was broken :evil: .
When i have fixed this problem all work correctly.
Configuration is ok. Dts is ok.
And NOW all work properly. Display work successfully.

Thank you for suggest. :D :D

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 4 guests