rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

CM3 and Display Touch I2C Controller

Mon Jan 27, 2020 1:45 pm

Hi,

I have a Yeebo LCD display (attached pdf datasheet). tha uses a DPI (Parallel Display Interface) of 50 pins and a CTP (capacitive touch panel) that uses a separate 6 pin interface as shown in this picture.
display_pinout.png
display_pinout.png (92.61 KiB) Viewed 971 times
The display works but we are having problems with the touch screen which seem not to work at all.

This is the pin hardware mapping connections we are trying to achieve :

Code: Select all

gpio 2  RST/WAKE
gpio 3  INT
gpio 28 TOUCH SDA
gpio 29 TOUCH SCL
This is the config.txt file we are using :

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=640
#framebuffer_height=360

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=1
hdmi_mode=31
#lcd 1,31
#HDMI 2,82

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=1200


dtparam=i2c_arm=on
dtparam=spi=off

#display dpi24
ignore_lcd=1
lcd_rotate=2
dtoverlay=dpi24
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=640
framebuffer_height=360
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87

dpi_output_format=0xfff007

dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 3

#I2C FOR TOUCH
#gpio=0,1=ip
gpio=28,29=a0
#DPI
gpio=0,1=a2		
gpio=4-27=a2
#UART1 FOR BT
gpio=40-41=a5
#SDIO FOR WIFI
gpio=34-39=a3
#UART0 FOR MCU
gpio=32-33=a3
gpio=30,31=op
#PWM FOR ADJ
#gpio=45=a0
#fix
gpio=45=ip

#Touch INT/RST
gpio=2,3=ip


# Uncomment some or all of these to enable the optional hardware interfaces
dtoverlay=midi-uart1
dtoverlay=uart1,txd1_pin=40
dtoverlay=uart1,rxd1_pin=41

dtoverlay=i2c0-bcm2708,pins_28_29
dtparam=i2c_vc=on
dtparam=uart0_arm=on
dtparam=uart1_arm=on
dtparam=sdio1_arm=on
dtparam=pwm1_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

#scaling_kernel=8
start_x=0
gpu_mem=256
##disable_camera_led=1
enable_uart=1

Code: Select all

> raspi-gpio get


BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=6 alt=2 func=PCLK
GPIO 1: level=1 fsel=6 alt=2 func=DE
GPIO 2: level=1 fsel=6 alt=2 func=LCD_VSYNC
GPIO 3: level=1 fsel=6 alt=2 func=LCD_HSYNC
GPIO 4: level=1 fsel=6 alt=2 func=DPI_D0
GPIO 5: level=0 fsel=6 alt=2 func=DPI_D1
GPIO 6: level=1 fsel=6 alt=2 func=DPI_D2
GPIO 7: level=1 fsel=6 alt=2 func=DPI_D3
GPIO 8: level=0 fsel=6 alt=2 func=DPI_D4
GPIO 9: level=0 fsel=6 alt=2 func=DPI_D5
GPIO 10: level=0 fsel=6 alt=2 func=DPI_D6
GPIO 11: level=0 fsel=6 alt=2 func=DPI_D7
GPIO 12: level=0 fsel=6 alt=2 func=DPI_D8
GPIO 13: level=0 fsel=6 alt=2 func=DPI_D9
GPIO 14: level=0 fsel=6 alt=2 func=DPI_D10
GPIO 15: level=0 fsel=6 alt=2 func=DPI_D11
GPIO 16: level=0 fsel=6 alt=2 func=DPI_D12
GPIO 17: level=0 fsel=6 alt=2 func=DPI_D13
GPIO 18: level=0 fsel=6 alt=2 func=DPI_D14
GPIO 19: level=0 fsel=6 alt=2 func=DPI_D15
GPIO 20: level=0 fsel=6 alt=2 func=DPI_D16
GPIO 21: level=0 fsel=6 alt=2 func=DPI_D17
GPIO 22: level=0 fsel=6 alt=2 func=DPI_D18
GPIO 23: level=0 fsel=6 alt=2 func=DPI_D19
GPIO 24: level=0 fsel=6 alt=2 func=DPI_D20
GPIO 25: level=1 fsel=6 alt=2 func=DPI_D21
GPIO 26: level=1 fsel=6 alt=2 func=DPI_D22
GPIO 27: level=0 fsel=6 alt=2 func=DPI_D23
BANK1 (GPIO 28 to 45):
GPIO 28: level=1 fsel=4 alt=0 func=SDA0
GPIO 29: level=1 fsel=4 alt=0 func=SCL0
GPIO 30: level=0 fsel=1 func=OUTPUT
GPIO 31: level=0 fsel=1 func=OUTPUT
GPIO 32: level=1 fsel=7 alt=3 func=TXD0
GPIO 33: level=0 fsel=7 alt=3 func=RXD0
GPIO 34: level=0 fsel=7 alt=3 func=SD1_CLK
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0
GPIO 37: level=0 fsel=7 alt=3 func=SD1_DAT1
GPIO 38: level=0 fsel=7 alt=3 func=SD1_DAT2
GPIO 39: level=0 fsel=7 alt=3 func=SD1_DAT3
GPIO 40: level=1 fsel=2 alt=5 func=TXD1
GPIO 41: level=0 fsel=2 alt=5 func=RXD1
GPIO 42: level=0 fsel=0 func=INPUT
GPIO 43: level=0 fsel=0 func=INPUT
GPIO 44: level=0 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3

Code: Select all

[email protected]:~ $ ls /dev/i2c*
/dev/i2c-0


[email protected]:~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I2c definition for pins 28,29 seems to be fine
GPIO 28: level=1 fsel=4 alt=0 func=SDA0
GPIO 29: level=1 fsel=4 alt=0 func=SCL0

I suspect the problem is in the pins 2,3
GPIO 2: level=1 fsel=6 alt=2 func=LCD_VSYNC
GPIO 3: level=1 fsel=6 alt=2 func=LCD_HSYNC

But I do not know how to fix it?

Can somebody please help me point me in the right direction?

Thank you.
Last edited by rlev on Tue Mar 03, 2020 11:36 am, edited 1 time in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2646
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: CM3 and Display Touch I2C Controller

Mon Jan 27, 2020 2:11 pm

You wrote:
gpio 28 TOUCH SDA
gpio 30 TOUCH SCL
I'm going to assume this is a typo and that GPIO29 is SCL, since everything else seems to fit. Also, there is no attachment.

I'm not a fan of all those gpio declarations in config.txt - they have their place sometimes, but I think you could get rid of most of them and let the kernel manage the pin configurations.

At a guess you have put dtoverlay=dpi24 before most of the gpio declarations in the hope that gpio=2,3=ip will override it, but this won't work for two reasons:
1. The overlay is applied by the firmware, but the pin configuration that it triggers is performed much later by the kernel, overwriting the changes by the firmware.
2. I can't see how the display could be expected to work without the LCD SYNC signals - what do you have connected to pins 10 & 11 of the display connector?

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Mon Jan 27, 2020 5:50 pm

@PhilE,

You are right was a typo. Correct pinout is

Code: Select all

gpio 2  To be used for LCD RST/WAKE 
gpio 3  To be use for LCD INT
gpio 28  SDA0
gpio 29  SCL0
Point 1
After dtoverlay=dpi24 is applied by the firmware.
How to make sure gpio=2,3=ip can no be overwritten by the kernel?

Point 2

Pins 10,11 of the LCD are connected as shown in this image.
lcd_pin_10_11.png
lcd_pin_10_11.png (26.25 KiB) Viewed 935 times
LCD Datasheet
http://s000.tinyupload.com/index.php?fi ... 7303738603

Thank you
Last edited by rlev on Tue Mar 03, 2020 11:55 am, edited 1 time in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2646
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: CM3 and Display Touch I2C Controller

Mon Jan 27, 2020 6:35 pm

How to make sure gpio=2,3=ip can no be overwritten by the kernel?
You would need a modified overlay that doesn't claim those pins. Alternatively, don't use the overlay and do it all using gpio declarations in config.txt.

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Wed Jan 29, 2020 2:13 am

PhilE,

I have modified the config.txt using gpio declaration :

Code: Select all

disable_overscan=1
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=31

arm_freq=1200

dtparam=i2c_arm=on
dtparam=spi=off
dtparam=i2c1=off

ignore_lcd=1
lcd_rotate=2
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=640
framebuffer_height=360
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0xfff007
dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 3


gpio=0=a2
gpio=1=a2
gpio=2=ip
gpio=3=ip

#dpi
gpio=4=a2
gpio=5=a2
gpio=6=a2
gpio=7=a2
gpio=8=a2
gpio=9=a2
gpio=10=a2
gpio=11=a2
gpio=12=a2
gpio=13=a2
gpio=14=a2
gpio=15=a2
gpio=16=a2
gpio=17=a2
gpio=18=a2
gpio=19=a2
gpio=20=a2
gpio=21=a2
gpio=22=a2
gpio=23=a2
gpio=24=a2
gpio=25=a2
gpio=26=a2
gpio=27=a2


#i2c for touch panel
gpio=28,29=a0

#uart0 for mcu
gpio=32-33=a3
gpio=30,31=op

#sdio for wifi
gpio=34-39=a3

#uart1 for BT
gpio=40-41=a2

gpio=45=ip


# Uncomment some or all of these to enable the optional hardware interfaces
dtoverlay=midi-uart1
dtoverlay=uart1,txd1_pin=40
dtoverlay=uart1,rxd1_pin=41

dtoverlay=i2c0-bcm2708,pins_28_29
dtparam=i2c_vc=on
dtparam=uart0_arm=on
dtparam=uart1_arm=on
dtparam=sdio1_arm=on
dtparam=pwm1_arm=on


dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

start_x=0
gpu_mem=256
enable_uart=1

Code: Select all

[email protected]:~ $ sudo raspi-gpio get
BANK0 (GPIO 0 to 27):
GPIO 0: level=0 fsel=6 alt=2 func=PCLK
GPIO 1: level=0 fsel=6 alt=2 func=DE
GPIO 2: level=1 fsel=0 func=INPUT
GPIO 3: level=1 fsel=0 func=INPUT
GPIO 4: level=1 fsel=6 alt=2 func=DPI_D0
GPIO 5: level=1 fsel=6 alt=2 func=DPI_D1
GPIO 6: level=0 fsel=6 alt=2 func=DPI_D2
GPIO 7: level=1 fsel=6 alt=2 func=DPI_D3
GPIO 8: level=1 fsel=6 alt=2 func=DPI_D4
GPIO 9: level=1 fsel=6 alt=2 func=DPI_D5
GPIO 10: level=1 fsel=6 alt=2 func=DPI_D6
GPIO 11: level=1 fsel=6 alt=2 func=DPI_D7
GPIO 12: level=0 fsel=6 alt=2 func=DPI_D8
GPIO 13: level=0 fsel=6 alt=2 func=DPI_D9
GPIO 14: level=0 fsel=0 func=INPUT
GPIO 15: level=0 fsel=6 alt=2 func=DPI_D11
GPIO 16: level=0 fsel=6 alt=2 func=DPI_D12
GPIO 17: level=1 fsel=6 alt=2 func=DPI_D13
GPIO 18: level=0 fsel=6 alt=2 func=DPI_D14
GPIO 19: level=1 fsel=6 alt=2 func=DPI_D15
GPIO 20: level=1 fsel=6 alt=2 func=DPI_D16
GPIO 21: level=1 fsel=6 alt=2 func=DPI_D17
GPIO 22: level=1 fsel=6 alt=2 func=DPI_D18
GPIO 23: level=1 fsel=6 alt=2 func=DPI_D19
GPIO 24: level=0 fsel=6 alt=2 func=DPI_D20
GPIO 25: level=1 fsel=6 alt=2 func=DPI_D21
GPIO 26: level=1 fsel=6 alt=2 func=DPI_D22
GPIO 27: level=1 fsel=6 alt=2 func=DPI_D23
BANK1 (GPIO 28 to 45):
GPIO 28: level=1 fsel=4 alt=0 func=SDA0
GPIO 29: level=1 fsel=4 alt=0 func=SCL0
GPIO 30: level=0 fsel=1 func=OUTPUT
GPIO 31: level=0 fsel=1 func=OUTPUT
GPIO 32: level=1 fsel=7 alt=3 func=TXD0
GPIO 33: level=0 fsel=7 alt=3 func=RXD0
GPIO 34: level=0 fsel=7 alt=3 func=SD1_CLK
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0
GPIO 37: level=0 fsel=7 alt=3 func=SD1_DAT1
GPIO 38: level=0 fsel=7 alt=3 func=SD1_DAT2
GPIO 39: level=0 fsel=7 alt=3 func=SD1_DAT3
GPIO 40: level=0 fsel=6 alt=2 func=-
GPIO 41: level=1 fsel=0 func=INPUT
GPIO 42: level=0 fsel=0 func=INPUT
GPIO 43: level=0 fsel=0 func=INPUT
GPIO 44: level=0 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3
But still no luck :(

The LCD's CTP (capacitive touch panel) use the ST1633I chip.
I am wondering if this chip is supported by Raspian?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8068
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 and Display Touch I2C Controller

Wed Jan 29, 2020 9:12 am

rlev wrote:
Wed Jan 29, 2020 2:13 am
But still no luck :(

The LCD's CTP (capacitive touch panel) use the ST1633I chip.
I am wondering if this chip is supported by Raspian?
https://github.com/raspberrypi/linux/bl ... n/st1232.c gained support for TS1633 in the 5.1 release.
The module TOUCHSCREEN_ST1232 isn't built by default in the Pi configs anyway, so you'd need a custom kernel build.

The example device tree bindings and datasheet say the default I2C address is 0x55, so until you get that being reported via i2cdetect there's not much point in worrying about drivers anyway.

What's your device on address 0x38? Something is being seen on i2c-0 via GPIOs 28&29.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8068
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 and Display Touch I2C Controller

Wed Jan 29, 2020 9:18 am

The Reset_N line on the touchpanel is an input to the panel. From what you've said you've connected it to GPIO2, and then defined that as an input on the Pi. Surely you want to define it as an output, and drive it low, otherwise it is going to be pulled high by the pull up resistor fitted on GPIO2 for I2C use, and that will hold the controller in reset.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Tue Mar 03, 2020 1:37 pm

Hi 6by9,

Thanks for your feedback.

The "0x38" value in below command refers to Sitronix I2C address of the st1633 chip

Code: Select all

[email protected]:~ $ sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
st1633_addr.png
st1633_addr.png (69.22 KiB) Viewed 563 times
In the Sitronix st1633 datasheet states that :

Code: Select all

RESET System reset signal input, active low
P10/INT INT : General GPIO / Indicate coordinate data ready
So I have pulled up GPIO02 as an output and pulled up.

Code: Select all

[email protected]:~ $ sudo cat /boot/config.txt
disable_overscan=1
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=31

arm_freq=1200

dtparam=i2c_arm=on
dtparam=spi=off
dtparam=i2c1=off

ignore_lcd=1
lcd_rotate=2
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=800
framebuffer_height=480
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0xfff007
dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 3


gpio=0=a2
gpio=1=a2
gpio=2=op,dh
gpio=3=ip

#dpi
gpio=4=a2
gpio=5=a2
gpio=6=a2
gpio=7=a2
gpio=8=a2
gpio=9=a2
gpio=10=a2
gpio=11=a2
gpio=12=a2
gpio=13=a2
gpio=14=a2
gpio=15=a2
gpio=16=a2
gpio=17=a2
gpio=18=a2
gpio=19=a2
gpio=20=a2
gpio=21=a2
gpio=22=a2
gpio=23=a2
gpio=24=a2
gpio=25=a2
gpio=26=a2
gpio=27=a2


#i2c for touch panel
gpio=28,29=a0

#uart0 for mcu
##gpio=32-33=a3
##gpio=30,31=op

#sdio for wifi
gpio=34-39=a3

#uart1 for BT
##gpio=40-43=a5

gpio=45=ip

# wifi
dtoverlay=sdio,sdio_overclock=25,gpios_34_39

#bluetooth
dtoverlay=cm-bt


# Uncomment some or all of these to enable the optional hardware interfaces
#dtoverlay=midi-uart1
#dtoverlay=uart1,txd1_pin=40
#dtoverlay=uart1,rxd1_pin=41

dtoverlay=i2c0-bcm2708,pins_28_29
dtparam=i2c_vc=on
dtparam=uart0_arm=on
##dtparam=uart1_arm=on
dtparam=sdio1_arm=on
#dtparam=pwm1_arm=on

dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

# BT
##dtoverlay=bt-uart1

start_x=0
gpu_mem=256
enable_uart=1

Code: Select all

[email protected]:~ $ sudo raspi-gpio get
BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=6 alt=2 func=PCLK
GPIO 1: level=0 fsel=6 alt=2 func=DE
GPIO 2: level=1 fsel=1 func=OUTPUT
GPIO 3: level=0 fsel=0 func=INPUT
GPIO 4: level=0 fsel=6 alt=2 func=DPI_D0
GPIO 5: level=0 fsel=6 alt=2 func=DPI_D1
GPIO 6: level=0 fsel=6 alt=2 func=DPI_D2
GPIO 7: level=0 fsel=6 alt=2 func=DPI_D3
GPIO 8: level=0 fsel=6 alt=2 func=DPI_D4
GPIO 9: level=1 fsel=6 alt=2 func=DPI_D5
GPIO 10: level=0 fsel=6 alt=2 func=DPI_D6
GPIO 11: level=0 fsel=6 alt=2 func=DPI_D7
GPIO 12: level=1 fsel=6 alt=2 func=DPI_D8
GPIO 13: level=0 fsel=6 alt=2 func=DPI_D9
GPIO 14: level=1 fsel=6 alt=2 func=DPI_D10
GPIO 15: level=0 fsel=6 alt=2 func=DPI_D11
GPIO 16: level=1 fsel=6 alt=2 func=DPI_D12
GPIO 17: level=0 fsel=6 alt=2 func=DPI_D13
GPIO 18: level=0 fsel=6 alt=2 func=DPI_D14
GPIO 19: level=0 fsel=6 alt=2 func=DPI_D15
GPIO 20: level=1 fsel=6 alt=2 func=DPI_D16
GPIO 21: level=0 fsel=6 alt=2 func=DPI_D17
GPIO 22: level=0 fsel=6 alt=2 func=DPI_D18
GPIO 23: level=1 fsel=6 alt=2 func=DPI_D19
GPIO 24: level=0 fsel=6 alt=2 func=DPI_D20
GPIO 25: level=1 fsel=6 alt=2 func=DPI_D21
GPIO 26: level=0 fsel=6 alt=2 func=DPI_D22
GPIO 27: level=0 fsel=6 alt=2 func=DPI_D23
BANK1 (GPIO 28 to 45):
GPIO 28: level=1 fsel=4 alt=0 func=SDA0
GPIO 29: level=1 fsel=4 alt=0 func=SCL0
GPIO 30: level=0 fsel=7 alt=3 func=CTS0
GPIO 31: level=0 fsel=7 alt=3 func=RTS0
GPIO 32: level=1 fsel=7 alt=3 func=TXD0
GPIO 33: level=1 fsel=7 alt=3 func=RXD0
GPIO 34: level=1 fsel=7 alt=3 func=SD1_CLK
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0
GPIO 37: level=1 fsel=7 alt=3 func=SD1_DAT1
GPIO 38: level=1 fsel=7 alt=3 func=SD1_DAT2
GPIO 39: level=1 fsel=7 alt=3 func=SD1_DAT3
GPIO 40: level=0 fsel=0 func=INPUT
GPIO 41: level=0 fsel=0 func=INPUT
GPIO 42: level=0 fsel=0 func=INPUT
GPIO 43: level=0 fsel=0 func=INPUT
GPIO 44: level=0 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3

Pin mapping I am using for the st1633 Touch Controller is :

Code: Select all

GPIO 02 ----- RST/WAKE  ( Output )
GPIO 03 ----- INT ( Input )
GPIO 28 ----- SDA0 
GPIO 29 ----- SCL0
I can compile the st1633.c driver and I can load it using "sudo insmod st1633.ko" but the touch screen still does not work :(

How can I debug the this kernel module?

I have added printk to the source driver code but "dmesg" does not shows anything regarding printk logs messages.

Thanks

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8068
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 and Display Touch I2C Controller

Tue Mar 03, 2020 2:48 pm

You haven't provided any configuration for the module via device tree. I'd already linked to the bindings documentation, so you need to create a device tree overlay. Something like the ilitek251x would probably make a suitable example seeing as it is also an I2C touchscreen controller. The gpio handle for the reset line is optional, so easiest to omit it to start with.

Device tree documentation is at https://www.raspberrypi.org/documentati ... ce-tree.md
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Thu Mar 05, 2020 11:51 am

6by9,

Based on the pins mapping I am using ( st1633 chip i2c address=0x38)

Code: Select all

GPIO 02 ----- RST/WAKE  ( Output )
GPIO 03 ----- INT ( Input )
GPIO 28 ----- SDA0 
GPIO 29 ----- SCL0
I have attempted to create a dts file, compiled and included it in the config.txt file

st1633-overlay.dts

Code: Select all

/dts-v1/;
/plugin/;

 / {
	compatible = "brcm,bcm2835";

 	[email protected] {
		target = <&gpio>;
		__overlay__ {		
			st1633_pins: st1633_pins {
				brcm,pins = <3>; // interrupt
				brcm,function = <0>; // in
				brcm,pull = <2>; // pull-up //
			};
		};
	};

 	[email protected] {
		target = <&i2c0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

 			st1633: [email protected] {
				compatible = "sitronix,st1633";
				reg = <0x38>;
				pinctrl-names = "default";
				pinctrl-0 = <&st1633_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <3 8>; // high-to-low edge triggered
				touchscreen-size-x = <800>;
				touchscreen-size-y = <480>;
			};
		};
	};

 	__overrides__ {
		interrupt = <&st1633_pins>,"brcm,pins:0",
			<&st1633>,"interrupts:0";
		sizex = <&st1633>,"touchscreen-size-x:0";
		sizey = <&st1633>,"touchscreen-size-y:0";
	};
};
config.txt

Code: Select all

disable_overscan=1
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=31

arm_freq=1200

dtparam=i2c_arm=on
dtparam=spi=off
dtparam=i2c1=off

ignore_lcd=1
lcd_rotate=2
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=800
framebuffer_height=480
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0xfff007
dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 3


gpio=0=a2
gpio=1=a2
gpio=2=op,dh
gpio=3=ip

#dpi
gpio=4=a2
gpio=5=a2
gpio=6=a2
gpio=7=a2
gpio=8=a2
gpio=9=a2
gpio=10=a2
gpio=11=a2
gpio=12=a2
gpio=13=a2
gpio=14=a2
gpio=15=a2
gpio=16=a2
gpio=17=a2
gpio=18=a2
gpio=19=a2
gpio=20=a2
gpio=21=a2
gpio=22=a2
gpio=23=a2
gpio=24=a2
gpio=25=a2
gpio=26=a2
gpio=27=a2


#i2c for touch panel
gpio=28,29=a0

#uart0 for mcu
##gpio=32-33=a3
##gpio=30,31=op

#sdio for wifi
gpio=34-39=a3

#uart1 for BT
##gpio=40-43=a5

gpio=45=ip

# wifi
dtoverlay=sdio,sdio_overclock=25,gpios_34_39

#bluetooth
dtoverlay=cm-bt


# Uncomment some or all of these to enable the optional hardware interfaces
#dtoverlay=midi-uart1
#dtoverlay=uart1,txd1_pin=40
#dtoverlay=uart1,rxd1_pin=41

dtoverlay=i2c0-bcm2708,pins_28_29

# touch screen
dtoverlay=st1633-overlay

dtparam=i2c_vc=on
dtparam=uart0_arm=on
##dtparam=uart1_arm=on
dtparam=sdio1_arm=on
#dtparam=pwm1_arm=on

dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

# BT
##dtoverlay=bt-uart1

start_x=0
gpu_mem=256
enable_uart=1

raspi-gpio get

Code: Select all

[email protected]:~/Downloads $ raspi-gpio get
BANK0 (GPIO 0 to 27):
GPIO 0: level=0 fsel=6 alt=2 func=PCLK
GPIO 1: level=1 fsel=6 alt=2 func=DE
GPIO 2: level=1 fsel=1 func=OUTPUT
GPIO 3: level=0 fsel=0 func=INPUT
GPIO 4: level=0 fsel=6 alt=2 func=DPI_D0
GPIO 5: level=0 fsel=6 alt=2 func=DPI_D1
GPIO 6: level=0 fsel=6 alt=2 func=DPI_D2
GPIO 7: level=1 fsel=6 alt=2 func=DPI_D3
GPIO 8: level=1 fsel=6 alt=2 func=DPI_D4
GPIO 9: level=0 fsel=6 alt=2 func=DPI_D5
GPIO 10: level=0 fsel=6 alt=2 func=DPI_D6
GPIO 11: level=0 fsel=6 alt=2 func=DPI_D7
GPIO 12: level=1 fsel=6 alt=2 func=DPI_D8
GPIO 13: level=0 fsel=6 alt=2 func=DPI_D9
GPIO 14: level=0 fsel=6 alt=2 func=DPI_D10
GPIO 15: level=0 fsel=6 alt=2 func=DPI_D11
GPIO 16: level=1 fsel=6 alt=2 func=DPI_D12
GPIO 17: level=1 fsel=6 alt=2 func=DPI_D13
GPIO 18: level=0 fsel=6 alt=2 func=DPI_D14
GPIO 19: level=0 fsel=6 alt=2 func=DPI_D15
GPIO 20: level=0 fsel=6 alt=2 func=DPI_D16
GPIO 21: level=1 fsel=6 alt=2 func=DPI_D17
GPIO 22: level=0 fsel=6 alt=2 func=DPI_D18
GPIO 23: level=0 fsel=6 alt=2 func=DPI_D19
GPIO 24: level=0 fsel=6 alt=2 func=DPI_D20
GPIO 25: level=1 fsel=6 alt=2 func=DPI_D21
GPIO 26: level=1 fsel=6 alt=2 func=DPI_D22
GPIO 27: level=0 fsel=6 alt=2 func=DPI_D23
BANK1 (GPIO 28 to 45):
GPIO 28: level=1 fsel=4 alt=0 func=SDA0
GPIO 29: level=1 fsel=4 alt=0 func=SCL0
GPIO 30: level=0 fsel=7 alt=3 func=CTS0
GPIO 31: level=1 fsel=7 alt=3 func=RTS0
GPIO 32: level=1 fsel=7 alt=3 func=TXD0
GPIO 33: level=1 fsel=7 alt=3 func=RXD0
GPIO 34: level=0 fsel=7 alt=3 func=SD1_CLK
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0
GPIO 37: level=1 fsel=7 alt=3 func=SD1_DAT1
GPIO 38: level=1 fsel=7 alt=3 func=SD1_DAT2
GPIO 39: level=1 fsel=7 alt=3 func=SD1_DAT3
GPIO 40: level=0 fsel=0 func=INPUT
GPIO 41: level=0 fsel=0 func=INPUT
GPIO 42: level=0 fsel=0 func=INPUT
GPIO 43: level=0 fsel=0 func=INPUT
GPIO 44: level=0 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3

dmesg

Code: Select all

st1633: loading out-of-tree module taints kernel.

But After loading the "st1633.ko" using "insmod" the touch screen still does not show any response when touched :(
logic_analyzer.png
logic_analyzer.png (80.94 KiB) Viewed 501 times
Using a logic analyzer shows :
GPIO 28 SCL0 I2C Clock - No activity
GPIO 29 SDA0 I2C Data - No activity
GPIO 02 RST/WAKE Reset, active LOW - Pulled up
GPIO 03 INT Indicates Coordinate Data Ready - Some activity

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Sat Mar 07, 2020 7:41 pm

Any hints on this touch screen overlay?

Thank you

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Sun Mar 08, 2020 12:14 pm

I have modified the overlay getting rid of the overrides part ( Not sure if needed ).
But still the touch screen does not respond :(.

Code: Select all


//   Device tree overlay for I2C connected sitronix st1633 touch controller
//   compile      : dtc [email protected] -I dts -O dtb -o st1633-overlay.dtbo st1633-overlay.dts
//   deploy       : sudo cp st1633-overlay.dtbo /boot/overlays
//   config.txt   : dtoverlay=st1633-overlay

/dts-v1/;
/plugin/;

 / {
	compatible = "brcm,bcm2835";

 	[email protected] {
		target = <&gpio>;
		__overlay__ {		
			st1633_pins: st1633_pins {
				brcm,pins = <3>; // interrupt
				brcm,function = <0>; // in
				brcm,pull = <2>; // pull-up //
			};
		};
	};

 	[email protected] {
		target = <&i2c0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

 			st1633: [email protected] {
				compatible = "sitronix,st1633";
				reg = <0x38>;
				pinctrl-names = "default";
				pinctrl-0 = <&st1633_pins>;
				interrupt-parent = <&gpio>;
				interrupts = <3 2>; /* rising edge */
				touchscreen-size-x = <800>;
				touchscreen-size-y = <480>;
				reset-gpios = <&gpio 2 1>; /* active low */
			};
		};
	};

};

Code: Select all

[email protected]:~/Downloads $ lsmod
Module                  Size  Used by
st1633                 16384  0
fuse                  110592  2
sg                     28672  0
brcmfmac              315392  0
brcmutil               16384  1 brcmfmac
asix                   36864  0
sha256_generic         20480  0
uas                    24576  0
cfg80211              651264  1 brcmfmac
rfkill                 28672  4 cfg80211
raspberrypi_hwmon      16384  0
hwmon                  16384  1 raspberrypi_hwmon
snd_bcm2835            24576  2
snd_pcm               102400  1 snd_bcm2835
snd_timer              32768  1 snd_pcm
snd                    73728  7 snd_timer,snd_bcm2835,snd_pcm
bcm2835_codec          36864  0
bcm2835_v4l2           45056  0
v4l2_common            16384  1 bcm2835_v4l2
v4l2_mem2mem           24576  1 bcm2835_codec
bcm2835_mmal_vchiq     32768  2 bcm2835_codec,bcm2835_v4l2
videobuf2_vmalloc      16384  1 bcm2835_v4l2
videobuf2_dma_contig    20480  1 bcm2835_codec
videobuf2_memops       16384  2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2         24576  3 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       45056  4 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
i2c_bcm2835            16384  0
vc_sm_cma              36864  1 bcm2835_mmal_vchiq
videodev              200704  6 bcm2835_codec,v4l2_common,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
media                  36864  3 bcm2835_codec,videodev,v4l2_mem2mem
evdev                  24576  5
uio_pdrv_genirq        16384  0
fixed                  16384  0
uio                    20480  1 uio_pdrv_genirq
i2c_dev                20480  0
ip_tables              24576  0
x_tables               32768  1 ip_tables
ipv6                  454656  22

Code: Select all

[email protected]:~/Downloads $ sudo vcdbg log msg
002191.365: brfs: File read: /mfs/sd/config.txt
002193.344: brfs: File read: 1740 bytes
002564.938: HDMI:EDID error reading EDID block 0 attempt 0
002926.958: HDMI:EDID error reading EDID block 0 attempt 1
003288.974: HDMI:EDID error reading EDID block 0 attempt 2
003650.991: HDMI:EDID error reading EDID block 0 attempt 3
004013.006: HDMI:EDID error reading EDID block 0 attempt 4
004375.023: HDMI:EDID error reading EDID block 0 attempt 5
004737.038: HDMI:EDID error reading EDID block 0 attempt 6
005099.055: HDMI:EDID error reading EDID block 0 attempt 7
005461.070: HDMI:EDID error reading EDID block 0 attempt 8
005823.087: HDMI:EDID error reading EDID block 0 attempt 9
005824.144: HDMI:EDID giving up on reading EDID block 0
006185.223: HDMI:EDID error reading EDID block 0 attempt 0
006547.244: HDMI:EDID error reading EDID block 0 attempt 1
006909.264: HDMI:EDID error reading EDID block 0 attempt 2
007271.283: HDMI:EDID error reading EDID block 0 attempt 3
007633.304: HDMI:EDID error reading EDID block 0 attempt 4
007995.324: HDMI:EDID error reading EDID block 0 attempt 5
008357.345: HDMI:EDID error reading EDID block 0 attempt 6
008719.365: HDMI:EDID error reading EDID block 0 attempt 7
009081.385: HDMI:EDID error reading EDID block 0 attempt 8
009443.406: HDMI:EDID error reading EDID block 0 attempt 9
009444.468: HDMI:EDID giving up on reading EDID block 0
009457.870: brfs: File read: /mfs/sd/config.txt
009459.666: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
009469.947: gpioman: gpioman_get_pin_num: pin BT_ON not defined
009470.007: gpioman: gpioman_get_pin_num: pin WL_ON not defined
009503.083: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
009503.172: *** Restart logging
009503.236: brfs: File read: 1740 bytes
009864.835: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
010226.862: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
010588.887: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
010950.912: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
011312.938: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
011674.963: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
012036.988: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
012399.013: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
012761.038: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
013123.063: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
013124.130: hdmi: HDMI:EDID giving up on reading EDID block 0
013485.227: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
013847.249: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
014209.270: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
014571.290: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
014933.312: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
015295.333: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
015657.354: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
016019.375: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
016381.396: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
016743.417: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
016744.479: hdmi: HDMI:EDID giving up on reading EDID block 0
016748.106: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
016749.323: gpioman: gpioman_get_pin_num: pin CAMERA_0_SDA_PIN not defined
016749.388: gpioman: gpioman_get_pin_num: pin CAMERA_0_SCL_PIN not defined
016749.450: gpioman: gpioman_get_pin_num: pin CAMERA_0_I2C_PORT not defined
016755.364: brfs: File read: /mfs/sd/bcm2710-rpi-cm3.dtb
016755.431: Loading 'bcm2710-rpi-cm3.dtb' to 0x100 size 0x62ce
016956.192: brfs: File read: 25294 bytes
016957.940: brfs: File read: /mfs/sd/config.txt
016958.082: dtparam: i2c_arm=on
016982.186: dtparam: spi=off
017002.840: dtparam: i2c1=off
017027.871: brfs: File read: 1740 bytes
017035.611: brfs: File read: /mfs/sd/overlays/sdio.dtbo
017067.920: Loaded overlay 'sdio'
017067.986: dtparam: sdio_overclock=25
017068.740: dtparam: gpios_34_39=true
017153.315: brfs: File read: 1889 bytes
017161.693: brfs: File read: /mfs/sd/overlays/cm-bt.dtbo
017178.935: Loaded overlay 'cm-bt'
017251.097: brfs: File read: 1049 bytes
017255.752: brfs: File read: /mfs/sd/overlays/i2c0-bcm2708.dtbo
017280.014: Loaded overlay 'i2c0-bcm2708'
017280.073: dtparam: sda0_pin=28
017281.773: dtparam: scl0_pin=29
017283.485: dtparam: pin_func=6
017292.097: Unknown dtparam 'pin_func' - ignored
017322.594: brfs: File read: 1674 bytes
017330.936: brfs: File read: /mfs/sd/overlays/st1633-override.dtbo
017349.309: Loaded overlay 'st1633-override'
017349.383: dtparam: i2c_vc=on
017371.202: dtparam: uart0_arm=on
017379.766: Unknown dtparam 'uart0_arm' - ignored
017379.844: dtparam: sdio1_arm=on
017388.386: Unknown dtparam 'sdio1_arm' - ignored
017388.468: dtparam: audio=on
017488.544: brfs: File read: 1197 bytes
017489.666: brfs: File read: /mfs/sd/cmdline.txt
017489.765: Read command line from file 'cmdline.txt':
017489.827: 'console=serial0,115200 console=tty1 root=PARTUUID=ea7d04d6-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles'
019415.128: gpioman: gpioman_get_pin_num: pin BT_ON not defined
019423.187: gpioman: gpioman_get_pin_num: pin WL_ON not defined
019438.545: brfs: File read: 166 bytes
019928.495: brfs: File read: /mfs/sd/kernel7.img
019928.561: Loading 'kernel7.img' to 0x8000 size 0x52e450
019928.635: Device tree loaded to 0x2eff9600 (size 0x69b1)
019930.438: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
021167.052: vchiq_core: vchiq_init_state: slot_zero = 0xef980000, is_master = 1
021171.249: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
021176.478: TV service:host side not connected, dropping notification 0x00000002, 0x00000001, 0x0000001f
025019.798: brfs: File read: 5432400 bytes
025024.929: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
025024.995: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
025025.085: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
025025.159: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined

Code: Select all

[email protected]:~/Downloads $ sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Any help is highly appreciated it.

Thanks

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2646
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: CM3 and Display Touch I2C Controller

Mon Mar 09, 2020 10:49 am

Go through the evidence:

Code: Select all

[email protected]:~/Downloads $ sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
The 38 here tells us two things:
1. That the device is being detected, so the pin configuration must be good.
2. That the driver isn't being successfully instantiated, otherwise it would say "==".

Code: Select all

[email protected]:~/Downloads $ lsmod
Module                  Size  Used by
st1633                 16384  0
Unless you have an explicit modprobe (or entry in /etc/modules), this suggests that the driver is being loaded automatically, but failing for some other reason.

I hope you can see that the place you need to be looking is the kernel message log (the output from dmesg), since it ought to give you a clue. The driver probe function (https://github.com/raspberrypi/linux/bl ... 232.c#L175) includes a number of potential error messages, but you could take some of the guesswork out by adding a few pr_err() lines of your own, e.g.:

Code: Select all

static int st1232_ts_probe(struct i2c_client *client,
			   const struct i2c_device_id *id)
{
	const struct st_chip_info *match;
	struct st1232_ts_data *ts;
	struct st1232_ts_finger *finger;
	struct input_dev *input_dev;
	int error;

	pr_err("In st1232_ts_probe:\n"); // <==== Insert something like this
	match = device_get_match_data(&client->dev);
By the way, you should take care of the other reported errors to reduce the clutter:

Code: Select all

017379.766: Unknown dtparam 'uart0_arm' - ignored
017388.386: Unknown dtparam 'sdio1_arm' - ignored
These dtparam lines can both be deleted.

rlev
Posts: 76
Joined: Sat Dec 15, 2018 2:20 pm

Re: CM3 and Display Touch I2C Controller

Wed Mar 25, 2020 10:34 pm

Hi Guys,

For the sake of completion.

Just to let you know we dropped ST1633I chip in favor of GT911 chip which has support in Raspian.

Thank you all for your help.

Return to “Compute Module”