How to load linux kernel module for fusion_F0710A driver on Colibri iMX6?

I’m trying to use the capacitive display with an iMX6DL module and Colibri eval board. I have followed the instructions on the Build U-Boot and Linux Kernel and Capacitive Multi-Touch Display (Linux) pages and have been able to load the display from boot.

I now need to to add touch capabilities.

I have tried to load the driver using the modprobe instruction as explained here, but I can’t seem to get it to do anything.

I have opened the touchscreen location and tried the modprobe fusion_F0710A command but I get no response. It just skips to next line with a prompt - no error or anything. I’m guessing that I should expect a response like the one that is shown in the instructions (see below).

[  104.658457] fusion_F0710A 0-0010: Touchscreen registered with bus id (0) with slave address 0x10
[  104.689688] fusion_F0710A 0-0010: version product 70Z7(1)
[  104.695219] fusion_F0710A 0-0010: version id 1.4(1)
[  104.700991] fusion_F0710A 0-0010: version series (1110191)
[  104.712672] input: fusion_F0710A as /devices/virtual/input/input0

I can browse to the /lib/modules/uname -r/kernel/drivers/input/touchscreen/ location and see that the fusion_F0710A.ko file exists.

Any thoughts?

Thank you.

Hi

You somehow do not talk about the device tree in your explanations.

Max

Hi Max,

You are correct. Sorry.

I already edited the device tree per the instructions you linked. It was the only way I could get the display to show anything.

My only issue now is that I can’t use the touch.

Scott

I am using video=mxcfb0:dev=lcd,FusionF07A for my display mode.

Attached is the custom device tree that I used. I changed lines 23 (#define PCAP) and lines 100/101 under the backlight section.

imx6dl-colibri-my-carrier.dts

Hi

My guess is that you mixed up something with the HW connection to the touch controller, (TOUCH_I2C_SCL_3.3V), TOUCH_I2C_SDA_3.3V, TOUCH_INT_3.3V, TOUCH_RESET_3.3V)


When doing the modprobe I would at least expect some output in the kernel log.

E.g. on a system with correctly connected touch screen I expect that dmesg has something like the following at the end after the module got inserted:

root@colibri-imx6:~# dmesg
...
[ 1076.558936] fusion_F0710A 2-0010: Touchscreen registered with bus id (2) with slave address 0x10
[ 1076.560735] fusion_F0710A 2-0010: version product 10Z8(0)
[ 1076.560767] fusion_F0710A 2-0010: version id 1.4(1)
[ 1076.560786] fusion_F0710A 2-0010: version series (1106011)
[ 1076.572691] input: fusion_F0710A as /devices/virtual/input/input5

And that what I expect if no touch screen is connected:

root@colibri-imx6:~# dmesg
...
[  313.005468] fusion_F0710A 2-0010: Touchscreen registered with bus id (2) with slave address 0x10
[  313.005730] fusion_F0710A 2-0010: query failed: -5
[  313.007347] fusion_F0710A: probe of 2-0010 failed with error -5

You could also check with the I2C tools if you can see the touch controller:

root@colibri-imx6:~# rmmod fusion_F0710A
root@colibri-imx6:~# i2cdetect 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

root@colibri-imx6:~# i2cdump -r 0-0x10 2 0x10
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2, address 0x10, mode byte
Probe range limited to 0x00-0x10.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 01 00 80 04 b6 01 10 00 00 00 00 00 00 00 16 0a    ?.?????.......??
10: 00

If the above looks good I2C is connected correctly and likely the reset line also.
So you could reinsert the kernel module and check for interrupts:

root@colibri-imx6:~# modprobe fusion_F0710A                                     
root@colibri-imx6:~# cat /proc/interrupts | grep fusion                         
 42:          0  gpio-mxc   9 Edge      fusion-f0710a                           
root@colibri-imx6:~# # touch the display                                        
root@colibri-imx6:~# cat /proc/interrupts | grep fusion                         
 42:         33  gpio-mxc   9 Edge      fusion-f0710a                           

If the number of interrupts increases with the touch then the interrupt line is connected correctly.

Max

Hi Max,

Thanks for the detailed response.

No luck though. After verifying the HW touch connections, I tried modprobe fusion_F0710A and still get no response.

I also don’t see any reference to fusion_F0710A in the dmesg output. As expected, cat /proc/interrupts | grep fusion also doesn’t return a response.

I should have mentioned this earlier, but forgot. I am using image version 2.6, not 2.7. I didn’t use 2.7 because I came across a problem when trying to extract files. I will try 2.7 again later today and let you know how things go with it.

Scott

Hi Max,

Okay. Here is what I found.

I tried 2.7 on a new module and I’m still stuck in the same spot…can’t get the touch to work.

root@colibri-imx6:~# modprobe fustion_F0710A
modprobe: FATAL: Module fustion_F0710A not found in directory /lib/modules/4.1.35-dirty

I wasn’t getting response on the other module with 2.6.
I have also verified that the fusion_F0710A.ko file does exist.

root@colibri-imx6:~# i2cdetect 2                                                                             
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

root@colibri-imx6:~# i2cdump -r 0-0x10 2 0x10
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2, address 0x10, mode byte
Probe range limited to 0x00-0x10.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 01 00 98 00 93 0d 11 00 00 00 00 00 00 00 5a 9a    ?.?.???.......Z?
10: 00

I still don’t see any reference to fusion_F0710A in the dmesg output. I’m also still not getting any response with cat /proc/interrupts | grep fusion.

I’m clearly missing something somewhere, but I’m not sure what it might be.

Any other thoughts?

Scott B.

modprobe: FATAL: Module fustion_F0710A not found in directory /lib/modules/4.1.35-dirty

Why the -dirty here? Does that mean you are not using our demo image but rather compiled something on your own? If so I suspect you may have missed one or the other step about properly deploying them kernel modules as well.

Hi,

I’m not sure why it responded with -dirty in the path. My image is the standard demo. It’s not custom.

I don’t have access to the computer now, but the path is the same as what’s shown here.

/lib/modules/`uname -r`/kernel/drivers/input/touchscreen/

Regards,

Scott

Hi,

The actual folder is /lib/modules/4.1.35-v2.7b1+gc117783/kernel/drivers/input/touchscreen/.

What kernel version is shown on running “uname -a” ?

Linux colibri-imx6 4.1.35-dirty #2 SMP Thu Feb 23 15:33:41 EST 2017 armv7l GNU/Linux

Here are the commands I’m using to configure the device tree and create the build.

ToolChain

cd
wget -c https://releases.linaro.org/components/toolchain/binaries/5.2-2015.11-2/arm-linux-gnueabihf/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf.tar.xz
tar xvf gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf.tar.xz
ln -s gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf gcc-linaro

export ARCH=arm
export PATH=~/gcc-linaro/bin/:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-

wget http://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/Colibri_iMX6_LinuxImageV2.7Beta1_20170112.tar.bz2
sudo tar xjvf Colibri_iMX6_LinuxImageV2.7Beta1_20170112.tar.bz2
cd Colibri_iMX6_LinuxImageV2.7
./update.sh -o /media/chemtrac/UPDATE

sudo apt-get install device-tree-compiler

$ dtc -v
Version: DTC 1.3.0

sudo apt-get install u-boot-tools

U-BOOT

cd
git clone -b 2016.11-toradex git://git.toradex.com/u-boot-toradex.git
cd u-boot-toradex

make colibri_imx6_defconfig

make -j3 2>&1 | tee build.log

cp ~/u-boot-toradex-2016/SPL /media/chemtrac/UPDATE/colibri_imx6/
cp ~/u-boot-toradex-2016/u-boot.img /media/chemtrac/UPDATE/colibri_imx6/u-boot.imx-spl

Kernel Source

git clone -b toradex_4.1-2.0.x-imx git://git.toradex.com/linux-toradex.git
cd linux-toradex

make colibri_imx6_defconfig

make -j3 uImage LOADADDR=10008000 2>&1 | tee build.log
make imx6dl-colibri-eval-v3.dtb

make -j3 modules

Kernel Update

cd
cp ~/linux-toradex/arch/arm/boot/uImage /media/chemtrac/UPDATE/colibri_imx6
cp ~/linux-toradex/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb /media/chemtrac/UPDATE/colibri_imx6

From U-Boot
setenv fdt_file imx6dl-colibri-eval-v3.dtb
saveenv 

run setupdate
run update_kernel
run update_fdt
run update

From U-Boot (after flashing)
setenv vidargs ‘video=mxcfb0:dev=lcd,FusionF07A’
savee
print
reset

The above steps will show the display at the proper resolution on the capacitive display. I just can’t use the touch features.

BTW, I’m not sure if I needed to do anything with Kernel Module Deployment referenced here.

Here is how I have the display wired from the adapter board to the Colibri Eval Board.

  • Adapter: X4/2 to Eval: X9/43
  • Adapter: X4/3 to Eval: JP24/3
  • Adapter: X4/4 to Eval: X9/49
  • Adapter: X4/6 to Eval: X9/48
  • Adapter: X4/7 to Eval: X9/47
  • Adapter: X4/8 to Eval: X10/27
  • Adapter: X4/9 to Eval: X10/28
  • Adapter: X4/10 to Eval: X10/50

Last thing. Would it be possible to send me a device tree file that shows exactly how it should be configured for a capacitive display with Colibri iMX6DL using a Colbri Eval Board?

Thanks.

Hi Max,

Do you have any additional thoughts as why I can’t get the touch to work? If you look above you can see which commands I used to configure the device tree.

Thanks.

Scott B.

Hi Scott

Kernel and Kernel Modules have a version which must exactly match.
uname -r shows that version.

By changing the kernel sources (e.g. the device-tree source files) you changed that version (the additional ‘-dirty’). By compiling and deploying only the kernel but not the modules the version between kernel and modules do not match anymore.

So you could:

  • Since you only changed device-tree files you could go back to your initial kernel binary and try again.
  • You could build additionally the modules and deploy them along with the new kernel.
  • You could also cheat and copy the kernel modules to a different path. For cases were you did not really change much that often works. However I do not advise doing so for production code.

depmod
...   could not open directory <missing dir> ...
cp -pPr <existing module dir> <missing dir>
depmod

e.g.

depmod
...   could not open directory /lib/modules/4.1.35-dirty ...
cp -pPr 4.1.35-v2.7b1+gc117783 /lib/modules/4.1.35-dirty
depmod

Max

Hi Max,

Thanks. You guided me in the right direction and I was able to get it working.

I used sudo -E make INSTALL_MOD_PATH=../Colibri_iMX6_LinuxImageV2.7/rootfs/ modules_install to compile the kernel module.

I then went back to the initial kernel binary and started over.

Everything works great now. I appreciate the patience.

Scott B.

Hi Max,

I was able to get it to work but sometimes it doesn’t.

I’m wondering if you can tell me exactly where I need to go back to in the Build U-Boot and Linux Kernel from Source Code page after I update the kernel module? Or, which instruction should I start with after I run the sudo -E make INSTALL_MOD_PATH=../Colibri_iMX6_LinuxImageV2.7/rootfs/ modules_install command?

Thanks.

Scott B.

Hi Scott

Note that your wording is a bit confusing.

  • You compile the kernel modules with make modules
  • You install the kernel modules to some arbitrary path with sudo -E make INSTALL_MOD_PATH=../Colibri_iMX6_LinuxImageV2.7/rootfs/ modules_install

As already said, if you’re only goal is to get our image working with the Fusion 7" touchscreen you do not need to recompile the kernel and the kernel modules. You only need to change/compile/deploy the device-tree.


Having said that here is my 2 cents on building and deploying the kernel in different phases in your development:

If you are in development mode with your one and only Colibri module:

  • build kernel/device-tree/modules
  • deploy kernel/device-tree/modules to the already flashed module
    scp arch/arm/boot/uImage root@192.168.10.2:/media/mmcblk0p1/
    scp arch/arm/boot/dts/ root@192.168.10.2:/media/mmcblk0p1/
    sudo -E make INSTALL_MOD_PATH=/ modules_install
    cd ; tar cjvf kernel-modules.tar.bz2 lib/modules/*
    scp kernel-modules.tar.bz2 root@192.168.10.2:
    On module
    cd /; tar xjvf /home/root/kernel-modules.tar.bz2
    depmod
    reboot

If you are in ‘test a few Colibri modules’ mode:

  • build kernel/modules/device-tree
  • deploy kernel/device-tree/modules into an unpacked image
    sudo cp arch/arm/boot/uImage …/Colibri_iMX6_LinuxImageV2.7/colibri-imx6_bin
    sudo cp arch/arm/boot/dts/ …/Colibri_iMX6_LinuxImageV2.7/colibri-imx6_bin
    sudo -E make INSTALL_MOD_PATH=…/Colibri_iMX6_LinuxImageV2.7/rootfs/ modules_install
  • recreate the update media and use this to flash your Colibri

If you’re in ‘prepare for production’ mode

  • integrate your changes into the openembedded kernel recipe
  • rebuild your image

Max