1. Article purpose[edit | edit source]
This article provides the basic information needed to enable LVDS PRBS[1] generator for signal quality measurements (eye pattern[2]) on OpenSTLinux distribution.
2. Introduction[edit | edit source]
The LVDS PRBS generator is capable of four sequences common in measuring and testing equipment. The polynomials are defined in ITU-T standard O.150: PRBS7, PRBS15, PRBS23 and PRBS31.
The LVDS PRBS Polynomial is selected using the LVDS channel distribution link 2 configuration register LVDS_CDL2CR.PRBS (address 0x2C)
. Note: It is advised to use the most complex PRBS31 polynomial which provides a longer random sequence because a longer period generally produces a greater variety of data patterns that more thoroughly check the transmission system's performance.
The PRBS is transmitted outside by selecting it as a Channel, in the channel distribution operator, by selecting LVDS_CDLxCR.DISTRy = 0xA
, for any Lane y
of Link x
.
Refer to the STM32 MPU reference manuals for the complete LVDS PRBS feature and register descriptions.
To sum up:
- Identify LVDS lanes on the board and connect them to the measurement equipments.
- Thanks to the board device tree, identify LVDS links (only link 1, only link 2 or both links 1 and 2) and related LVDS channels / distribution channels (jeida, vesa, ...) . Please refer to LVDS device tree configuration for more details.
- Power up the board and be sure the LVDS is running.
- Select the PRBS polynomial type by writing in the LVDS channel distribution link 2 configuration register
LVDS_CDL2CR.PRBS (address 0x2C)
. - Enable PRBS by writing in the LVDS channel distribution link 1&2 configuration registers
LVDS_CDLxCR.DISTRy (address 0x2C/0x30)
the value0xa
, for any Laney
of Linkx
. - Use the measurement equipments.
3. Installing Devmem or GDB on the target board[edit | edit source]
The simplest ways for enabling the LVDS PRBS are:
- using the command line
devmem2
tool: please refer to How to read or write peripheral registers article for its installation and usage. - using the debug and trace
gdb
tool: please refer to GDB article for its installation and usage.
4. Getting started[edit | edit source]
Once both the board under test and the measurement equipments are ready, follow the below procedure based on the devmem2
tool (Note: a similar procedure can be done with gdb
tool too):
1. Boot the board and read the two related registers running values:
devmem2 0x4806002c # LVDS_CDL1CR for link 1 /dev/mem opened. Memory mapped at address 0xffffa051e000. Read at address 0x4806002C (0xffffa051e02c): 0x00004321 devmem2 0x48060030 # LVDS_CDL2CR for link 2 and PRBS polynomial type /dev/mem opened. Memory mapped at address 0xffff9e169000. Read at address 0x48060030 (0xffff9e169030): 0x00000000
2. Configure the PRBS polynomial type (3
for the longest sequence) in LVDS_CDL2CR
register:
devmem2 0x48060030 w 0x03000000 # LVDS_CDL2CR.PRBS=3 /dev/mem opened. Memory mapped at address 0xffffa60fb000. Read at address 0x48060030 (0xffffa60fb030): 0x00000000 Write at address 0x48060030 (0xffffa60fb030): 0x03000000, readback 0x03000000
3. Enable the PRBS by writing 0xa
on a given distribution lane of a given link, here below distribution channel 3 (set to channel 4) of link 1:
devmem2 0x4806002c w 0x0a321 # LVDS_CDL1CR = 0x0a321 ie. enable prbs on DISTR3 (channel 4) of link 1 /dev/mem opened. Memory mapped at address 0xffff8bb00000. Read at address 0x4806002C (0xffff8bb0002c): 0x00004321 Write at address 0x4806002C (0xffff8bb0002c): 0x0000A321, readback 0x0000A321
4. Perform the eye pattern test with the measurement equipment. When done, continue with others lanes and links.
![]() |
Before making any measurements, it may be useful to test the procedure on a real LVDS panel, keeping in mind that enabling PRBS on the channels carrying the clock or blankings will cause the screen to become desynchronized and therefore display nothing.
|
5. Alternatives[edit | edit source]
It is also possible to use STM32CubeMP2 instead of OpenSTLinux distribution
6. References[edit | edit source]
- ↑ Pseudorandom binary sequence (PRBS) article on Wikipedia
- ↑ Eye pattern article on Wikipedia