0

I'm trying to communicate with a 128x64 screen on SPI (GFX-hat pimori). It seems that the device /dev/spi* does not exist, I looked at how to do it on the net, but the device refuses to be created.

Do you have an idea of the problem ?

> uname -a
Linux framboise 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Li                                         nux

> ls /dev/spi*
ls: impossible d'accéder à '/dev/spi*': Aucun fichier ou dossier de ce type (No such file or directory)

> lsmod | grep spi
spi_bcm2835            20480  0
spi_bcm2835aux         16384  0
spi_gpio               16384  0
spi_bitbang            16384  1 spi_gpio
spidev                 20480  0

> grep spi /boot/config.txt
dtparam=spi=on

> gpio readall

     +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+
     | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
     +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
     |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
     |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5v      |     |     |
     |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
     |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT5 | TxD     | 15  | 14  |
     |     |     |      0v |      |   |  9 || 10 | 1 | ALT5 | RxD     | 16  | 15  |
     |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
     |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
     |  22 |   3 | GPIO. 3 |  OUT | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
     |     |     |    3.3v |      |   | 17 || 18 | 1 | OUT  | GPIO. 5 | 5   | 24  |
     |  10 |  12 |    MOSI | ALT0 | 0 | 19 || 20 |   |      | 0v      |     |     |
     |   9 |  13 |    MISO | ALT0 | 0 | 21 || 22 | 1 | OUT  | GPIO. 6 | 6   | 25  |
     |  11 |  14 |    SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT  | CE0     | 10  | 8   |
     |     |     |      0v |      |   | 25 || 26 | 1 | OUT  | CE1     | 11  | 7   |
     |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
     |   5 |  21 | GPIO.21 |  OUT | 0 | 29 || 30 |   |      | 0v      |     |     |
     |   6 |  22 | GPIO.22 |  OUT | 0 | 31 || 32 | 0 | OUT  | GPIO.26 | 26  | 12  |
     |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
     |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 1 | IN   | GPIO.27 | 27  | 16  |
     |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
     |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
     +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
     | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
     +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+


> grep spi /var/log/kern.log
May 24 14:20:53 framboise kernel: [   11.645367] ads7846 spi0.1: spi0.1 supply vcc not found, using dummy regulator
May 24 14:20:53 framboise kernel: [   11.645473] ads7846 spi0.1: Linked as a consumer to regulator.0
May 24 14:20:53 framboise kernel: [   11.645942] ads7846 spi0.1: touchscreen, irq 166
May 24 14:20:53 framboise kernel: [   11.648139] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input7
May 24 14:20:53 framboise kernel: [   12.453427] graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 4 KiB buffer memory, fps=33, spi0.0 at 16 MHz

> grep spi /var/log/syslog
May 24 11:38:35 framboise systemd-modules-load[110]: Inserted module 'spidev'
May 24 11:38:35 framboise systemd-modules-load[110]: Inserted module 'spi_gpio'
May 24 11:38:35 framboise systemd-modules-load[110]: Inserted module 'spi_bcm2835aux'
May 24 11:38:35 framboise kernel: [    7.730249] ads7846 spi0.1: spi0.1 supply vcc not found, using dummy regulator
May 24 11:38:35 framboise kernel: [    7.730646] ads7846 spi0.1: Linked as a consumer to regulator.0
May 24 11:38:35 framboise kernel: [    7.737989] ads7846 spi0.1: touchscreen, irq 166
May 24 11:38:35 framboise kernel: [    7.743270] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input7
May 24 11:38:35 framboise kernel: [    8.535664] graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 4 KiB buffer memory, fps=33, spi0.0 at 16 MHz
May 24 11:38:37 framboise raspi-config[341]: Checking if shift key is held down: No. Switching to ondemand scaling governor.
remic
  • 11
  • 1
  • 1
  • 3
    Try asking a question about what you are trying to do rather than your assumed solution. – Milliways May 24 '19 at 13:25
  • But there is an installation guide. Did you follow that? https://github.com/pimoroni/gfx-hat/ – tlfong01 May 24 '19 at 14:13
  • lsmod shows no modules. But if you know which kernel module to use, you can build it and load it yourself. But it is very messy. You might like to see how I try to build and load a similar graphics LCD SPI kernel module. https://raspberrypi.stackexchange.com/questions/98549/lcd-tft-screen-2-8-ili9341-spi-connect – tlfong01 May 24 '19 at 14:33
  • To reiterate @Milliways point. Some of these devices do their configuration with device tree and no /dev/spi devices needs to be created for their proper operation. – joan May 24 '19 at 14:47
  • Next time, please prefix your commands with LC_ALL=C. Not everyone here is fluent in French. – Dmitry Grigoryev Oct 20 '20 at 09:46

1 Answers1

1

Question

Rpi to 128x64 screen on SPI (GFX-hat pimori)

Device /dev/spi* does not exist

Answer

The ad says it is Rpi plug and play, with a python library, and there is an installation guide.

The installation is simple - use either one of the following two terminal commands.

curl https://get.pimoroni.com/gfxhat | bash

sudo pip3 install gfxhat

And the python demo programs is your home directory.

/home/pi/Pimoroni/gfxhat/

References

Pimoroni GFX HAT - 128x64 LCD Display - RGB Backlight and 6 Touch Button $25

GFX HAT - 128x64 LCD Display with RGB Backlight and Touch Buttons - £21.50

Showing all GFX HAT - 128x64 LCD Display with RGB Backlight and Touch Buttons projects

New Products 9/19/18 Featuring Adafruit #NeoTrellis #RGB Driver #PCB! @adafruit #adafruit

Installation Guide and Python library for the Pimoroni GFX HAT

Description

Pimoroni GFX HAT is a 2.15" monochrome graphics LCD Display with RGB Backlight and 6 capactive Touch Buttons.

Python library Comes fully assembled, plug and play right onto your Raspberry Pi

Rpi Config File (general) - elinux

R-Pi configuration file (HDMI etc) - elinux

grep spi /boot/config.txt

dtparam=spi=on

gpio readall

vcgencmd get_config - lists a specific config value. E.g.

vcgencmd get_config arm_freq vcgencmd get_config int - lists all the integer config options that are set (non-zero) vcgencmd get_config str lists all the string config options that are set (non-null)

tlfong01
  • 4,665
  • 3
  • 10
  • 24