Skip to content

Instantly share code, notes, and snippets.

@macmata
Created December 14, 2015 03:53
Show Gist options
  • Save macmata/a4bbe4cefb0efd844483 to your computer and use it in GitHub Desktop.
Save macmata/a4bbe4cefb0efd844483 to your computer and use it in GitHub Desktop.
Waveshare-Raspberry-Resistive-Interface-Rapsberry-pi
http://www.wvshare.com/product/3.2inch-RPi-LCD-B.htm
http://www.amazon.com/Waveshare-Raspberry-Resistive-Interface-Rapsberry-pi/dp/B00N0SNVQE
I have found that the initialization string is very close to fb_ili9340 driver, so after few days of testing I found this configuration is pretty stable
1) Use FBTFT drivers built into the kernel
sudo REPO_URI=https://github.com/notro/rpi-firmware BRANCH=builtin rpi-update
sudo reboot
2) After rebooting, check that SPI was created
# dmesg | grep spi
Linux version 3.12.25+ (pi@raspi2) (gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) ) #1 PREEMPT Sat Aug 2 19:08:33 CEST 2014
bcm2708_spi bcm2708_spi.0: DMA channel 2 at address 0xf2007200 with irq 77
bcm2708_spi bcm2708_spi.0: DMA channel 4 at address 0xf2007400 with irq 20
bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
bcm2708_spi bcm2708_spi.0: SPI Controller running in dma mode
3) Add to /boot/cmdline.txt (in one line)
fbtft_device.custom
fbtft_device.name=fb_ili9340
fbtft_device.gpios=dc:22,reset:27
fbtft_device.bgr=1
fbtft_device.speed=48000000
4) To enable console on boot add to /boot/cmdline.txt
fbcon=map:10
fbcon=font:ProFont6x11
logo.nologo
5) Also may be useful to add
dma.dmachans=0x7f35
console=tty1
consoleblank=0
fbtft_device.fps=50
fbtft_device.rotate=270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment