savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

SainSmart ST7735 White Screen

Sat Jan 03, 2015 5:58 pm

I have a SainSmart ST7735 1.8" TFT hooked up to a Rasberry Pi A+. However, I can't get it to display. As near as I can tell the fbtft drivers are working. I have installed mplayer and when I execute this command it plays on the command line:
sudo mplayer -vo fbdev2:/dev/fb1 -x 128 -y 160 -zoom test.mov

I followed these steps after a clean NOOBS install:
Enter:
sudo raspi-config

This will "expand the file system". Apparently not necessary if you're running NOOBS.

Enter:
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

There's a line in here that refers to "fb0" - apparently the HDMI monitor - and should be changed to fb1.

Enter:
sudo nano /etc/modprobe.d/raspi-blacklist.conf

There is a line in this file that disables spi:
blacklist spi-bcm2708

Comment it out:
# blacklist spi-bcm2708

Enter:
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update

This will download and install the loadable drivers.

Enter:
sudo reboot

To load all the new drivers.

Enter:
sudo modprobe fbtft_device name=waveshare32b

To actually load the fbtft driver after the reboot.

Enter:
sudo modprobe spi-bcm2708

To load the spi driver.


I have the board connected according to this:
5V Power LITE
MISO
GPIO 11 (SCLK) SCL
GPIO 10 (MOSI) SDA
GPIO 8 (CE0) * CS
CARD_CS
GPIO 24 ** RS/DC
GPIO 25 ** RES
5V Power VCC
Ground GND

At this point I'm thinking its my connection but I'm not sure how to troubleshoot. Any suggestions are greatly appreciated.

Thanks!

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 6:00 pm

Whoops, I forgot to put the actual command I used to for the SainSmart:

sudo sudo modprobe fbtft_device name=sainsmart18 cs=1 speed=16000000 gpios=reset:18,dc:24

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 6:44 pm

savall21 wrote:Whoops, I forgot to put the actual command I used to for the SainSmart:

sudo sudo modprobe fbtft_device name=sainsmart18 cs=1 speed=16000000 gpios=reset:18,dc:24
I see two problems:
* you say you connected reset to GPIO25, but here you use GPIO18 (GPIO25 is the default for this device)
* in your first post you say you use CE0, but in the command you specify #1

Another thing: why do you specify the speed?

I would say you can simplify the modprobe command to:

Code: Select all

sudo modprobe fbtft_device name=sainsmart18
Gr.
Dirk.

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 6:53 pm

Good call. I will try that.

Thanks!!!

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 6:56 pm

I tried that still no luck. Do the connections look right?

Also are there any other ways of tracing errors?

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 6:58 pm

Here is what I get when I try mplayer:

[email protected] ~ $ sudo mplayer -vo fbdev2:/dev/fb1 -x 128 -y 160 -zoom test.movMPlayer svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing test.mov.
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb644dee8]multiple edit list entries, a/v desync might occur, patch welcome
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb644dee8]max_analyze_duration reached
[lavf] stream 0: video (cinepak), -vid 0
[lavf] stream 1: audio (pcm_u8), -aid 0, -alang eng
VIDEO: [cvid] 200x150 24bpp 600.000 fps 338.5 kbps (41.3 kbyte/s)
Clip info:
creation_time: 1994-10-18 09:10:35
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
Selected video codec: [ffcvid] vfm: ffmpeg (FFmpeg Cinepak Video)
==========================================================================
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 11114 Hz, 1 ch, u8, 0.0 kbit/0.00% (ratio: 0->11114)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
AO: [alsa] 11114Hz 1ch u8 (1 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
[swscaler @ 0x78eaa0] BICUBIC scaler, from yuv420p to rgb565le using C
VO: [fbdev2] 128x160 => 128x160 BGR 16-bit [zoom]
A: 15.2 V: 15.4 A-V: -0.199 ct: 0.012 0/ 0 0% 6% 0.1% 1 0

[AO_ALSA] alsa-lib: pcm_hw.c:616:(snd_pcm_hw_drain) SNDRV_PCM_IOCTL_DRAIN failed (-5): Input/output error

Exiting... (End of file)

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 7:04 pm

savall21 wrote:I tried that still no luck. Do the connections look right?

Also are there any other ways of tracing errors?
Just looking at the connections again...
Have a look at https://github.com/notro/fbtft/wiki/LCD ... insmart-18
Make sure you have the same device as linked to from there.
And check the connections (apparently this one needs 3.2V, not 5V)
And I assume you're connection to GPIOxx, not physical pin xx...

Gr
Dirk.

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 7:28 pm

That link to SainSmart doesn't work anymore. I did find the 1.8 on their site:

http://www.sainsmart.com/sainsmart-1-8- ... tmega.html

Its the only one they sell. Site says 5/3.3v.

Honestly, I'm open to recommendations on another screen thats easier to setup. I've only got $14 in this thing and I could return it.

Does it look like the software is setup correctly??

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 7:53 pm

Check the loaded modules with 'lsmod'. It should show 'fbtft_device and I would also expect 'fb_st7735r'.
You should also have a device (file) '/dev/fb1'.
Also check the messages for any errors.
Near the end of 'dmesg' (probably best viewed with 'less /var/log/dmesg') you should see something like this.
NB: this is for a different device, but maybe you can post lines starting with 'fbtft_device, plus a few extra, here)

Code: Select all

[   17.074211] fbtft_device:  SPI devices registered:
[   17.089680] fbtft_device:      spidev spi0.0 500kHz 8 bits mode=0x00
[   17.097496] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[   17.114133] fbtft_device:  'fb' Platform devices registered:
[   17.121407] fbtft_device:      bcm2708_fb id=-1 pdata? no
[   17.128203] fbtft_device: Deleting spi0.0
[   17.136621] fbtft_device:  GPIOS used by 'pitft':
[   17.159697] fbtft_device:    'dc' = GPIO25
[   17.165068] fbtft_device:  SPI devices registered:
[   17.174432] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[   17.182410] fbtft_device:      fb_ili9340 spi0.0 32000kHz 8 bits mode=0x00
[   17.351020] stmpe-spi spi0.1: stmpe610 detected, chip id: 0x811
[   17.583920] input: stmpe-ts as /devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/stmpe-ts.0/input/input2
[   17.722485] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 32 MHz
Gr.
Dirk.

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 8:05 pm

lsmod output

Code: Select all

Module                  Size  Used by
fb_st7735r              3674  0 
fbtft_device           34686  0 
fbtft                  30834  2 fb_st7735r,fbtft_device
syscopyarea             2999  1 fbtft
sysfillrect             3294  1 fbtft
sysimgblt               2124  1 fbtft
fb_sys_fops             1435  1 fbtft
snd_bcm2835            19496  0 
snd_soc_tas5713         5573  0 
snd_soc_bcm2708_i2s     6186  0 
regmap_mmio             2818  1 snd_soc_bcm2708_i2s
snd_soc_core          146249  2 snd_soc_tas5713,snd_soc_bcm2708_i2s
snd_compress           12594  1 snd_soc_core
regmap_i2c              1661  2 snd_soc_core,snd_soc_tas5713
snd_pcm_dmaengine       5505  1 snd_soc_core
regmap_spi              1913  1 snd_soc_core
snd_pcm                83853  3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
snd_page_alloc          5140  1 snd_pcm
snd_seq                55476  0 
snd_seq_device          6465  1 snd_seq
snd_timer              20981  2 snd_pcm,snd_seq
8192cu                550885  0 
leds_gpio               2079  0 
led_class               4373  1 leds_gpio
snd                    62252  7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
i2c_bcm2708             4943  0 
spi_bcm2708             8111  0 
dmesg (fbtft stuff at the end)

Code: Select all

[ 530.220283] fbtft_device:  SPI devices registered:
[  530.220332] fbtft_device:      spidev spi0.0 500kHz 8 bits mode=0x00
[  530.220348] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[  530.220360] fbtft_device:  'fb' Platform devices registered:
[  530.220390] fbtft_device:      bcm2708_fb id=-1 pdata? no
[  530.220491] fbtft_device: Deleting spi0.0
[  530.221036] fbtft_device:  GPIOS used by 'sainsmart18':
[  530.221061] fbtft_device:    'reset' = GPIO25
[  530.221072] fbtft_device:    'dc' = GPIO24
[  530.221080] fbtft_device:  SPI devices registered:
[  530.221093] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[  530.221106] fbtft_device:      fb_st7735r spi0.0 32000kHz 8 bits mode=0x00
[  531.157996] graphics fb1: fb_st7735r frame buffer, 128x160, 40 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 32 MHz
[ 3012.258734] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
code]

It looks like communication with the device to me.  I'm totally confused....

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 8:29 pm

It looks like communication with the device to me. I'm totally confused....
Another thing to check:
After you run 'sudo modprobe fbtft_device <etcetera>'
try to run

Code: Select all

con2fbmap 1 1
This should map the console (terminal) to /dev/fb1 (the framebuffer used for the sainsmart device)
Does it result in any output on the sainsmart?

Gr.
Dirk.

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 8:36 pm

No, none at all. I really appreciate you help. If the connection are correct do you think its the screen??

DirkS
Posts: 9804
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 9:13 pm

savall21 wrote:No, none at all. I really appreciate you help. If the connection are correct do you think its the screen??
Hard to say...

The driver itself should be mature enough by now. It was actually one of the first devices for which notro wrote the driver.
Out of ideas for the moment, but I'll let you know if I think of something.

One thing you could try (although I don't expect anything of it): try starting the GUI on the screen:

Code: Select all

FRAMEBUFFER=/dev/fb1 startx
Gr.
Dirk.

savall21
Posts: 11
Joined: Fri Jan 02, 2015 11:20 pm

Re: SainSmart ST7735 White Screen

Sat Jan 03, 2015 9:14 pm

Thanks for your time.

Yeah, I tried that. No luck.

Return to “Beginners”