Blog Sturntech

Archive for the ‘gumstix’ Category

Changing Live Video Modes with OMAPDSS

with one comment

The OMAP documentation has plenty of information on how to configure a desired video mode at boot by way of kernel boot parameters. See http://gitorious.org/linux-omap-dss2/linux/blobs/master/Documentation/arm/OMAP/DSS

Recently I was tasked with implementing a method of dynamically changing video mode timings without rebooting the system. Additionally the system is very bare-bones, consisting of essentially sysvinit, sysfs and Qt/Embedded. Size requirements dictated the absence of fbset and other nice applications in the rootfs, so a more direct route to changing the video timings was needed.

The embedded system uses a TFT LCD screen that requires a particular timing video pattern. These timings are non-VESA, meaning that while the video stream will be properly parsed by the TFT’s processor, there can be no expectation for the video stream to be parsed by any other VGA device.

The timings required for the TFT (640x480M-32@60) are:
23750,640/80/16/64,480/3/13/4

The timings for VESA compliance (640×480-32@60) are:
25175,640/40/24/96,480/32/11/2

These timings are relatively close, but different enough that distortion would appear on the opposite device. The TFT screen will show scattered lines and garbling when using the VESA-compliant timings. VGA devices would show an assortment of results when using the TFT timings, including fully functional, entirely non-functional, screen clipping, screen shifting, and distortion.

My solution was to allow our sales staff a key sequence to directly modify the timings held in the display0 entry found at /sys/devices/platform/omapdss/display0 entry. The device would boot with the TFT timings, and on a key-press, would switch to the VESA-timings. The idea is that the sales staff can switch to “projector” mode when training, allowing the audience to see a clean image at the cost of slight distortion on the handheld display.

The basic approach was the following:

# Change to TFT timings
echo “23750,640/80/16/64,480/3/13/4” > /sys/devices/platform/omapdss/display0/timings

# Change to VESA timings
echo “25175,640/40/24/96,480/32/11/2” > /sys/devices/platform/omapdss/display0/timings

Written by sturnfie

January 19th, 2012 at 3:27 pm

Designing with Gumstix Overo: SYSEN floating is a major flaw (boot failure)

without comments

Gumstix Overo Fire COM

Gumstix Overo Fire COM

I designed my first embedded system that uses a Gumstix Overo FE COM for my employer about 11 months ago. The prototype circuit passed all functional tests and my PCB layout kept clean signal isolation and near-ideal power integrity (no ground/power ripples). The Gumstix Overo was easy to interface with and aside from learning how to configure X-Load and U-Boot to properly set the OMAP pin MUXs for the various system functions, use of the module was problem-free.

The system I designed for my employer is essentially a tablet computer that is dedicated to running an analysis application that receives and processes the output of a Photon Detector. The Photon Detector interfaced to the Overo via a UART link.

During bench testing I encountered only one unresolved ambiguity. This ambiguity was an Overo Fire whose NAND chip became irreversibly corrupted at the memory location read for U-Boot’s default environmental configuration. Since my employer wished to keep the entire system software on an MMC card, and since the system was executing U-Boot from the MMC storage anyway, I modified the U-Boot source to read the default configuration from a local configuration file instead of touching the NAND. That broken Gumstix became usable after the hack and the problem has not been seen again on any system. I have not been able to replicate the error that caused only that area of the one Overo’s NAND memory to become corrupted.

So after bench validation, a unit was placed into the hands of a technician for field testing. All was well for about 4 months when I’m contacted by the technician with word that the system is no longer booting. We replaced the unit and I set about determining the root cause for how and why the system broke.

The mode of failure is describable as “failure to boot”. The Gumstix Overo had a single green LED lit (middle of row of three) when power was applied, but no other LEDs lit (in particular the blue LED on the right did not light). The three inductors on the top of the Overo had voltages matching a working Overo (L1: +1.211V, L2: +1.201V, L3: +1.801V). The serial console would chirp the following characters out the console serial line during boot “@É ¼c”.

Reading chapter 29 (Initialization) of the 35xx OMAP Technical Reference Manual (linked at bottom) indicates that the broken piece is somewhere in the Stage 1 boot of the initialization sequence. In this Stage, the OMAP CPU copies the boot code from static ROM to the RAM. The chirps on the console serial line are a boot location request by the OMAP. Properly configured, the OMAP checks the MMC and NAND modules for bootability before checking the UART(s). The fact that the OMAP was failing to check the NAND or MMC modules, but seems to check the UART indicates that there is a mis-configuration or wide-spread sub-system failure.

Regardless of how/if the ROM became corrupted, the Overo was not reaching X-Load in the NAND or the MMC card.

The cause of the problem was found to be the support circuitry initializing before the Overo’s OMAP CPU fully initialized. In particular, the level shifters (used to interface the +3.3V logic of external systems to the +1.8V logic of the Overo) were immediately in Operating mode after Power-On. The OMAP on the Overo module, however, waits for the PMIC to initialize before beginning its initialization sequence. This allowed the level shifters to pass signals to the OMAP before it was ready.

My design included the external UART serial communication from the Photon Detector. This UART line was allowed to reach the OMAP CPU pins before the chip was initialized. All other interfaces used in this design were slaves to the OMAP and would not otherwise toggle the OMAP pins without communication from the OMAP (implying the OMAP had initialized at that point). The Photon Detector sends “am-alive” pulses every 500ms.

The timing of the Photon Detector initializing and the timing of the Overo initializing had never overlapped enough to expose this flaw in bench testing. It took one occasion during field testing where the photon detector initialized extra-fast and the Overo extra-slow to create the “system not booting” problem. This occurred when the “am-alive” pulse hit the Overo during the Overo’s initialization process.

The solution to is to couple all in-bound signal interfaces to the SYSEN signal provided on the Overo’s J1 connector (pin 59). This signal pulls Low when the OMAP is ready to go. Do not pull High any I/O line directly attached to the Overo prior to the signal of SYSEN.

Some very useful information sources for debugging this problem:
The OMAP 35xx Technical Reference Manual strongly discourages letting this happen (http://www.ti.com/lit/ug/spruf98u/spruf98u.pdf).
The Gumstix Signals Document lists the pins and implies their uses (http://www.gumstix.org/images/overo_signals_latest.pdf)

Written by sturnfie

November 8th, 2011 at 2:44 pm