ADC startup issue with AT91SAM9G45

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

JHynninen
Posts: 2
Joined: Sun Oct 11, 2020 9:37 pm

ADC startup issue with AT91SAM9G45

Wed Oct 28, 2020 11:37 am

Hi all,

We have been producing a device with AT91SAM9G45 for several years. As we updated from kernel 2.6.30 to 4.19.152, we started observing hick-ups with GPAD startup.

It's a proprieatary board with 4-wire resistive touch panel connected. All four touch panel signals have 120p caps to GND and ym has additional 121k resistor to GND as instructed in chip errata.

The issue we are facing is that the GPAD4..7 conversion results read all 0 until the touch screen is touched for the first time. This situation occurs on roughly 90% of the boots, and has some slight unit-to-unit variations.
# cat /sys/devices/platform/ahb/ahb:apb/fffb0000.adc/iio:device0/in_voltage?_raw
993
0
0
0
# cat /sys/devices/platform/ahb/ahb:apb/fffb0000.adc/iio:device0/in_voltage?_raw
0
0
0
0
Adding debug prints in the at91_adc driver (https://git.kernel.org/pub/scm/linux/ke ... =v4.19.152) hints that straight out of the boot there is a constant flow of at91_adc_rl_interrupt and handle_adc_eoc_trigger interrupts fired, and they stop when you just touch the screen once.

Tried also with kernel 5.4, with no observable improvement.

Compiling kernel 4.19.78-linux4sam-6.2 to AT91SAM9M10-G45-EK evaluation board we were not able to reproduce this issue.

Any ideas what to try next?


-Jukka
blue_z
Location: USA
Posts: 2131
Joined: Thu Apr 19, 2007 10:15 pm

Re: ADC startup issue with AT91SAM9G45

Thu Oct 29, 2020 8:15 pm

JHynninen wrote: We have been producing a device with AT91SAM9G45 for several years. As we updated from kernel 2.6.30 to 4.19.152, we started observing hick-ups with GPAD startup.
So for the same hardware, you went from a custom board file to a custom Device Tree.
The obvious possibilities are:
a. your Device Tree is not an accurate/sufficient description of the hardware.
b. a driver regression has been introduced during the decade between kernel versions.
c. the old kernel has modifications for the hardware that have not been ported correctly.

JHynninen wrote: Tried also with kernel 5.4, with no observable improvement.
Did you reuse the Device Tree from 4.19, or did you actually write another DT based on the 5.4. source?
FYI DT source and blobs should be considered specific to a kernel version.

JHynninen wrote: Compiling kernel 4.19.78-linux4sam-6.2 to AT91SAM9M10-G45-EK evaluation board we were not able to reproduce this issue.
That would seem to eliminate the driver regression theory.

Regards
JHynninen
Posts: 2
Joined: Sun Oct 11, 2020 9:37 pm

Re: ADC startup issue with AT91SAM9G45

Fri Oct 30, 2020 8:22 pm

c. the old kernel has modifications for the hardware that have not been ported correctly.
This is most relevant comment. Back in the day, there was no Linux support for GPAD conversions between touch screen scans.

The 2.6.30 driver also needed extra 200 lines of nasty hacks and filtering to overcome the noisy pen detect issue, which later on was added to the chip errata in form of an additional resistor.

Our main goal for the update was to catch up the mainline, and get rid of all these off-tree patches, and so far it has been a great success.

Studying this further, I discovered that removing 120 pF cap in parallel with the added resistor makes the issue impossible to reproduce.

I'm not ready to declare case closed, until I understand why excess capacitance makes things fail in such way.

Issue is somehow connected to opening the touch screen device, which initially starts the continuous flow of EOC interrupts.

The first touch screen event also has incorrect coordinates, but after the first touch everything starts to work fluently.

This makes me think whether the mainline driver on our HW ends up in an erratic state, which is then solved by the first touch.

I'm going to try if I can induce similar situation on EK board by increasing ym capacitance

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 9 guests