I2C read hangs Frame Buffer

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

saurabhnamjoshi
Posts: 2
Joined: Thu Jan 02, 2020 3:47 am

I2C read hangs Frame Buffer

Thu Jan 02, 2020 4:32 am

Hello all,
my name is Saurabh Namjoshi, I worked for Elcom International.
We are developing a software for Smart PDU's, for this project we have selected SAMA5D27-SOM1 with linux (buildroot 6.2) as its operating system.
Here, we have configured Frame Buffer( /dev/fb0).
This Frame buffer(spi based) is used to render a menu driven UI on ILI9163 LCD.
We have also interfaced keyboard with 4 keys on I2C(/dev/i2c-1) bus for scrolling menu.
We have written a C code to read interfaced keys over I2C.
We are using fb-test-rect for rendering some patterns on LCD.
Problem we are facing is when we read keys over I2C & FB is also rendering pattern or menu, after some duration FB hangs, LCD screen frozen & it never recovers, as we also tried to power cycle LCD & also tried to restart fb-test-rect or other FB test apps.
Only solution is reboot.
FB works fine when we are not reading any keys over I2C, as we tested fb-test-rect app running for more than 24 hours.
Please let me know how can we resolve this issue
I am also attaching FB & I2C parameters/setting added in dts file for your reference.

FB :
spi0: spi@f8000000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi0_default>;
status = "okay";
tft@2{
compatible = "ilitek,ili9163";
reg = <0>;
spi-max-frequency = <24000000>;
fps = <15>;
bgr;
rotate = <180>;
debug = <3>;
regwidth = <0x8>;
buswidth = <8>;
width = <128>;
height = <160>;
reset-gpios = <&pioA PIN_PB22 GPIO_ACTIVE_HIGH>;
dc-gpios = <&pioA PIN_PB20 GPIO_ACTIVE_HIGH>;
cs-gpios = <&pioA PIN_PB24 GPIO_ACTIVE_LOW>;

};
};
i2c:

i2c1: i2c@fc028000 {
dmas = <0>, <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1_default>;
status = "okay";
};
pinctrl_i2c1_default: i2c1_default {
pinmux = <PIN_PD4__TWD1>,
<PIN_PD5__TWCK1>;
bias-disable;
};

Waiting for reply.
Thanks & regards,
saurabh namjoshi
blue_z
Location: USA
Posts: 2131
Joined: Thu Apr 19, 2007 10:15 pm

Re: I2C read hangs Frame Buffer

Sat Jan 04, 2020 1:48 am

saurabhnamjoshi wrote: We are developing a software for Smart PDU's, for this project we have selected SAMA5D27-SOM1 with linux (buildroot 6.2) as its operating system.
Which Linux kernel are you using?

saurabhnamjoshi wrote: Problem we are facing is when we read keys over I2C & FB is also rendering pattern or menu, after some duration FB hangs, LCD screen frozen & it never recovers, as we also tried to power cycle LCD & also tried to restart fb-test-rect or other FB test apps.
Only solution is reboot.
Be sure you're using a beefy, high-quality power supply to eliminate concerns regarding power.
If it's a software issue, then those symptoms could indicate that the SPI master controller is blocked for some reason.

You need to gather information on the state of the SPI master controller when the framebuffer is hung.
Use the devmem command in Busybox (or write a similar program) to dump all of the registers of the SPI master controller when the system is idle (for comparison) and when the framebuffer is hung.
Compare the register values, and use the SoC datasheet to determine the significance of the bits which are different.

You need to understand what events/conditions lead to a hang.
Try enabling the built-in debug reporting by spi-atmel.c, e.g. insert a '#define DEBUG' statement at the beginning of the source file.

FWIW a long time ago (Linux 2.6 era) there was a HW/SW quirk that occasionally caused a SPI read request to never complete, presumably because a SPI interrupt was missing/lost. If there is something similar happening now on transmit, then you may have to insert some printk() statements to get accurate insight as to what the device driver is doing.

saurabhnamjoshi wrote: I am also attaching FB & I2C parameters/setting added in dts file for your reference.
It's almost unreadable. Learn to use the 'code' tag which will preserve indentation (assuming you've formatted the DT nodes properly).

Regards
saurabhnamjoshi
Posts: 2
Joined: Thu Jan 02, 2020 3:47 am

Re: I2C read hangs Frame Buffer

Sat Jan 04, 2020 7:48 am

Hello Biue_z,
thanks for reply.

Which Linux kernel are you using?
A) Linux 4.19.56-linux4sam-6.1 armv7l

I will check by enabling debug in SPI & let you know.


Regards,
saurabh namjoshi

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 4 guests