Hi everyone,
on the PicoCoreMX6UL100 Rev. 1.00 board, the touch screen FT5x06 does not work well - it looks like the I2C connection is working with errors. I assume that the ft5x0x_i2c_rxdata() function from in ft5x06_ts.c is not working correctly.
In the console, when I click on the touch screen, I see the following: "ft5x06_ts_v2 2-0038: Error reading touch screen data: -110". But sometimes it still works right. With an oscilloscope, I do not see anything abnormal on the I2C bus (J1 pin 3 I2C_B_SCL and J1 pin 5 I2C_B_SDA) and pins I2C_B_IRQn (J1 pin 1) and I2C RESET (J1 pin 2).
The touch screen is configured in picocoremx6ul100.dts as follows:
- //#define CONFIG_PICOCOREMX6UL100_CAPTOUCH_MXT224
- #define CONFIG_PICOCOREMX6UL100_CAPTOUCH_FT5x06
- //#define CONFIG_PICOCOREMX6UL100_CAPTOUCH_SITRONIX
- //#define CONFIG_PICOCOREMX6UL100_CAPTOUCH_ILITEK
- #ifdef CONFIG_PICOCOREMX6UL100_CAPTOUCH_FT5x06
- /* F&S driver V3.0 */
- ft5x06_ts@38 {
- compatible = "FocalTech,ft5306";
- reg = <0x38>;
- fingers = <2>;
- touchscreen-size-x = <480>;
- touchscreen-size-y = <272>;
- threshold = <25>;
- /*x-rev;
- y-rev;*/
- interrupt-parent = <&gpio1>;
- interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
- reset-gpios = <&gpio3 28 GPIO_ACTIVE_LOW>;
- linux,wakeup;
- };
- #endif
The I2C_B is configured in picocoremx6ul100.dts as follows:
- /* I2C */
- #define CONFIG_PICOCOREMX6UL100_I2C_A
- #define CONFIG_PICOCOREMX6UL100_I2C_B
- #define CONFIG_PICOCOREMX6UL100_I2C_C
- #define CONFIG_PICOCOREMX6UL100_I2C_D
- ifdef CONFIG_PICOCOREMX6UL100_I2C_B
- &i2c3 {
- clock-frequency = <100000>;
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_i2c3>;
- status = "okay";
- #ifdef CONFIG_PICOCOREMX6UL100_CAPTOUCH_MXT224
- mxt224@4a {
- compatible = "atmel,maxtouch";
- reg = <0x4a>;
- interrupt-parent = <&gpio1>;
- interrupts = <1 2>;
- atmel,cfg_name = "atmel/mxt224.cfg";
- atmel,reset-gpio = <&gpio3 28 GPIO_ACTIVE_LOW>;
- #if 0
- atmel,suspend-mode = <2>;
- vdd = <®_atmel_mxt_vdd>;
- avdd = <®_atmel_mxt_avdd>;
- #endif
- };
- #endif
- ...
- ...
- }
- #endif
- #ifdef CONFIG_PICOCOREMX6UL100_I2C_B
- pinctrl_i2c3: i2c3grp {
- fsl,pins = <
- MX6UL_PAD_UART1_TX_DATA__I2C3_SCL 0x4001b8b1
- MX6UL_PAD_UART1_RX_DATA__I2C3_SDA 0x4001b8b1
- /*MX6UL_PAD_UART1_TX_DATA__I2C3_SCL 0x4001b8b0*/
- /*MX6UL_PAD_UART1_RX_DATA__I2C3_SDA 0x4001b8b0*/
- /* I2C_B_IRQn */
- MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0x0b0b0
- >;
- };
- #endif
The logic analyzer shows that when you click on the touch screen, the first interrupt begins to be processed (the transfer via I2C begins). But the transfer ends after reading the first byte (sometimes even earlier, sometimes after reading several bytes) with the condition "I2C Stop". The controller of the touch screen continues to generate interrupts approximately once every 10 ms, but this is not reflected in the I2C bus in any way. After about 100 ms, the I2C transmission starts again and is interrupted again as well. And only occasionally all 15 bytes are read. The same touch screen on another efus boards (efus A9X and efus A7UL) works correctly and all 15 bytes are read after each interrupt, i.e. approximately every 10 ms. If you replace the ft5x0x_ts_ist() (in ft5x06_ts.c) handler with
then using the logic analyzer you can see that this handler is called after each interrupt, as it should be. From which it can be assumed that the ft5x0x_i2c_rxdata() function is too slow and usually fails.
What can I do to fix this problem?
Thanks in advance