I am getting "FATAL: Module ads7846_device not found." #260

Ferite opened this Issue Apr 2, 2015 · 6 comments


None yet

3 participants

Ferite commented Apr 2, 2015


I have installed a HY28A display to my Raspberry Pi B+, and I am having problems getting the Touchpanel to work. As the TFT worked without problems with the standard Foundation image, I just compiled the touch driver (runned make in the ads7846_device directory) and then installed them.

As I have not clear how installed then I just copied the resulting ads7846_device.ko in /lib/modules/3.18.0-trunk-rpi/kernel, and then runned $depmod in that directory. Then I tried to run the instruction in https://github.com/notro/fbtft/wiki/Touchpanel:

$sudo modprobe ads7846
Seems to work ok.

$sudo modprobe ads7846_device
Produces "FATAL: Module ads7846_device not found."

If I run:


I get ads7846 listed (not ads7846_device, off course) .

If I run:

$dmesg | grep -i ads7846

I don't get any message.

I hope I can get some help about what I am doing wrong.


notro commented Apr 2, 2015

The latest kernel doesn't have ads7846_device anymore. The same can be achieved with a Device Tree overlay. Lookup ads7846-overlay in /boot/overlays/README
I'll make a note on that wiki page.

Ferite commented Apr 8, 2015

Hi Notro.

I have the TS working now, by loading ads7846-overlay.dtb. The only issue I still having is that in order to avoid having the X axe inverted, I have to to execute the comand:

$ DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 0

It works ok if I run this command from a terminal within the session. However if I add this line to /etc/X11/xinit/xinitrc (before $. /etc/X11/Xsession), it has no effect.

Where else can I place this command?.

Thanks again for your help, and all the work you have put on fbtft.

notro commented Apr 8, 2015

Try /etc/xdg/lxsession/LXDE-pi/autostart

You can also use xinput-calibrator: https://github.com/notro/fbtft/wiki/FBTFT-on-Raspian#x-windows-touch-calibration


Hi folks,
I have a new Waveshare 4 inch Spotpear

Screen works fine but can't get the touch bit working.
things done so far

end of config.txt:

dtoverlay=ads7846,cs=1, penirq=17, speed=500000, swapxy=0, pmax=255, xohms=100, xmin=200, xmax=3900, ymin=200, ymax=3900, verbose=3

end of /etc/modules:

flexfb nobacklight width=480 height=320 regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3
fbtft_device debug=3 rotate=0 name=flexfb speed=16000000 gpios=reset:25,dc:24

[ 11.743981] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
[ 11.746435] bcm2708_spi bcm2708_spi.0: SPI Controller running in dma mode
[ 11.905681] bcm2708_i2c_init_pinmode(1,2)
[ 11.908042] bcm2708_i2c_init_pinmode(1,3)
[ 11.914519] bcm2708_i2c bcm2708_i2c.1: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100000)
[ 12.083345] i2c /dev entries driver
[ 12.172550] pcm512x 1-004d: Failed to reset device: -5
[ 12.175001] pcm512x: probe of 1-004d failed with error -5
[ 12.243136] pcm512x 1-004c: Failed to reset device: -5
[ 12.245665] pcm512x: probe of 1-004c failed with error -5
[ 12.298376] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.314008] flexfb: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.437981] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 12.447194] fbtft_device: SPI devices registered:
[ 12.449740] fbtft_device: spidev spi0.0 500kHz 8 bits mode=0x00
[ 12.452155] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 12.454812] fbtft_device: 'fb' Platform devices registered:
[ 12.457070] fbtft_device: bcm2708_fb id=-1 pdata? no
[ 12.459400] fbtft_device: Deleting spi0.0
[ 12.465511] flexfb spi0.0: fbtft_request_gpios: 'reset' = GPIO25
[ 12.467805] flexfb spi0.0: fbtft_request_gpios: 'dc' = GPIO24
[ 12.469956] flexfb spi0.0: flexfb_verify_gpios_dc()
[ 12.472058] flexfb spi0.0: fbtft_init_display()
[ 12.492581] flexfb spi0.0: fbtft_reset()
[ 12.629637] flexfb spi0.0: init: write(0xB0) 0x00
[ 12.631890] flexfb spi0.0: init: write(0x11)
[ 12.634065] flexfb spi0.0: init: mdelay(250)
[ 12.885821] flexfb spi0.0: init: write(0x3A) 0x55
[ 12.887928] flexfb spi0.0: init: write(0xC2) 0x44
[ 12.889989] flexfb spi0.0: init: write(0xC5) 0x00 0x00 0x00 0x00
[ 12.892078] flexfb spi0.0: init: write(0xE0) 0x0F 0x1F 0x1C 0x0C 0x0F 0x08 0x48 0x98 0x37 0x0A 0x13 0x04 0x11 0x0D 0x00
[ 12.895954] flexfb spi0.0: init: write(0xE1) 0x0F 0x32 0x2E 0x0B 0x0D 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
[ 12.899769] flexfb spi0.0: init: write(0xE2) 0x0F 0x32 0x2E 0x0B 0x0D 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
[ 12.903676] flexfb spi0.0: init: write(0x36) 0x28
[ 12.905705] flexfb spi0.0: init: write(0x11)
[ 12.907583] flexfb spi0.0: init: write(0x29)
[ 13.078578] flexfb spi0.0: Display update: 1772 kB/s (169.165 ms), fps=0 (0.000 ms)
[ 13.159816] graphics fb1: flexfb frame buffer, 480x320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=50, spi0.0 at 16 MHz
[ 13.164313] fbtft_device: GPIOS used by 'flexfb':
[ 13.165935] fbtft_device: 'reset' = GPIO25
[ 13.167631] fbtft_device: 'dc' = GPIO24
[ 13.169160] fbtft_device: SPI devices registered:
[ 13.170941] fbtft_device: spidev spi0.1 500kHz 8 bits mode=0x00
[ 13.174404] fbtft_device: flexfb spi0.0 16000kHz 8 bits mode=0x00
[ 22.983120] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 24.524072] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 33.812581] Adding 102396k swap on /var/swap. Priority:-1 extents:2 across:2134012k SSFS

$sudo vcdbg log msg

001068.180: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbtft_device.custom fbtft_device.name=flexfb fbtft_device.gpios=dc:24,reset:25 fbtft_device.bgr=1 fbtft_device.speed=16000000 fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo dma.dmachans=0x7f35 console=tty1 consoleblank=0 fbtft_device.fps=50 fbtft_device.rotate=0

001069.109: Loading 'kernel.img' from SD card
001301.938: Kernel trailer DTOK property says yes
001302.148: Loading 'ads7846-overlay.dtb' from SD card
001310.954: dtparam: spi=on
001311.235: Unknown param 'spi' - ignored
001311.259: dtparam: i2c_arm=on
001311.539: Unknown param 'i2c_arm' - ignored
001319.096: Loaded overlay 'ads7846'
001324.610: dterror: can't find symbol 'spi0'
001324.627: dtoverlay_merge_overlay('ads7846') failed - err -1
001326.027: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
002728.924: vchiq_core: vchiq_init_state: slot_zero = 0x57800000, is_master = 1
002733.202: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
002737.890: gpioman: gpioman_get_pin_num: pin LEDS_RUNNING not defined
002737.918: gpioman: gpioman_get_pin_num: pin LEDS_NAND_ACTIVITY not defined
002737.942: gpioman: gpioman_get_pin_num: pin LEDS_USB_ACTIVITY not defined
002737.964: gpioman: gpioman_get_pin_num: pin LEDS_FATAL_ERROR not defined
002737.984: gpioman: gpioman_get_pin_num: pin LEDS_APP_OK not defined
002738.004: gpioman: gpioman_get_pin_num: pin LEDS_APP_FAILED not defined
002738.026: gpioman: gpioman_get_pin_num: pin LEDS_HDCP_AUTH not defined
002738.047: gpioman: gpioman_get_pin_num: pin LEDS_HDCP_UNAUTH not defined
002738.067: gpioman: gpioman_get_pin_num: pin LEDS_HDMI_ON not defined
002738.087: gpioman: gpioman_get_pin_num: pin LEDS_DVI_ON not defined
002738.109: gpioman: gpioman_get_pin_num: pin LEDS_HDMI_HPD_UP not defined
002738.131: gpioman: gpioman_get_pin_num: pin LEDS_REMOTE_CONTROL not defined
002738.154: gpioman: gpioman_get_pin_num: pin LEDS_ARM_CONTROLLED not defined

so it looks like the message dtoverlay_merge_overlay('ads7846') failed - err -1 is failing and there also is another error line in there:
dterror: can't find symbol 'spi0'

I don't know what to try next although lsmod does show the module is loaded it just isn't being used by anything and there is no INPUT driver and no touch control.

Module Size Used by
ads7846 10632 0
fbtft_device 34613 0
flexfb 14438 2
fbtft 34450 2 flexfb,fbtft_device
syscopyarea 3153 1 fbtft
sysfillrect 3584 1 fbtft
sysimgblt 2278 1 fbtft
fb_sys_fops 1565 1 fbtft
snd_soc_wm8804 8225 0
snd_soc_pcm512x_i2c 2130 0
snd_soc_tas5713 5866 0
snd_soc_pcm512x 8508 1 snd_soc_pcm512x_i2c
regmap_spi 2307 1 snd_soc_wm8804
regmap_i2c 2944 3 snd_soc_wm8804,snd_soc_pcm512x_i2c,snd_soc_tas5713
i2c_dev 6713 0
i2c_bcm2708 6200 0
spi_bcm2708 8684 0
snd_bcm2835 21157 0
snd_soc_bcm2708_i2s 7515 0
regmap_mmio 3548 1 snd_soc_bcm2708_i2s
snd_soc_core 174135 4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_tas5713,snd_soc_bcm2708_i2s
snd_compress 8714 1 snd_soc_core
snd_pcm_dmaengine 5850 1 snd_soc_core
snd_pcm 90786 4 snd_bcm2835,snd_soc_wm8804,snd_soc_core,snd_pcm_dmaengine
snd_seq 61089 0
snd_seq_device 7205 1 snd_seq
snd_timer 22990 2 snd_pcm,snd_seq
evdev 11020 4
snd 66285 7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress

Any help greatly received


Ferite commented Apr 13, 2015

Hi John. I am not very advanced fbtft or Linux user but here are my recomendations:

  • Begin with a clean RPi fundation image on your SD.
  • From the .dts Generate the .dtb file. The .dts is here:


the instructions for compiling the dtb are here:


  • Copy the resulting .dtb to /boot/overlays
  • Add to /boot/config.txt the dtoverlay (dtoverlay=ads7846,cs=1...) line.
  • My config.txt only has uncommented "dtparam=spi=on" and "dtoverlay" lines.

Thanks for the reply
Downloaded the compiler and compiled from source..
all was still the same :-(
It turns out I needed to comment out the line "device_tree=ads7846-overlay.dtb" in my config.txt file.
I also put in "dtdebug=1" in the config.txt file this gives a load of debug info when you run $sudo vcdbg log msg.


dtoverlay=ads7846,cs=1, penirq=17, speed=500000, swapxy, pmax=255, xohms=100, xmin=200, xmax=3900, ymin=200, ymax=3900

Anyway all working now

@notro notro closed this Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment