
1. Article purpose[edit | edit source]
This article provides the basic information needed to enable DSI video mode pattern generator (VMPG) for MIPI® DSI signal quality measurements like:
- Colorimetry: thanks to vertical or horizontal color bars
- Data transmission conformance testing: thanks to a Bit Error Rate (BER)[1] pattern
2. Introduction[edit | edit source]
The DSI video mode pattern generator (VMPG) allows the transmission of horizontal/vertical color bars and D-PHY BER testing patterns.
The DSI VMPG is programmed and enabled using the DSI Host video mode configuration register DSI_VMCR (address 0x38)
:
- Bit 24 PGO: Pattern generator orientation
- 0: Vertical color bars
- 1: Horizontal color bars
- Bit 20 PGM: Pattern generator mode
- 0: Color bars (horizontal or vertical)
- 1: BER pattern (vertical only)
- Bit 16 PGE: Pattern generator enable
- 0: Pattern generator is disabled
- 1: Pattern generator is enabled
Refer to the STM32 MPU reference manuals for the complete DSI video mode pattern generator feature and register descriptions.
To sum up:
- Power up the board and be sure the DSI is running.
- According to the signal quality measurements, choose between vertical color bars (default), horizontal color bars and the BER pattern.
- Prepare the test equipments accordingly.
- Read the DSI Host video mode configuration register
DSI_VMCR (address 0x38)
to get its default running values. - Enable the desired pattern by writing in
DSI_VMCR
the default running values read previously with the VMPG 3 bitsDSI_VMCR.PGO, DSI_VMCR.PGM & DSI_VMCR.PGE
. - Use the measurement equipments.
![]() |
If Debugfs is available in the software, it is convenient to use vpg, vpg_ber_pattern, vpg_horizontal files instead of using DSI register reads and writes:
ls /sys/kernel/debug/5a000000.dsi vpg vpg_ber_pattern vpg_horizontal Read Getting started (Debugfs case) chapter for more details. |
3. Installing Devmem or GDB on the target board to read/write registers[edit | edit source]
The simplest ways for enabling the DSI VMPG 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 (register access case)[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. Identify the DSI internal peripheral memory address
- On STM32MP15x lines
: DSI address is
0x5a000000
- On STM32MP23x lines
and STM32MP25x lines
: DSI address is
0x48000000
Refer to the STM32 MPU reference manuals for details.
It is possible to use the running board device tree too, like in the below example:
ls -R /proc/device-tree/ | grep dsi # STM32MP15 case ... dsi@5a000000 /proc/device-tree/soc/dsi@5a000000: ...
ls -R /proc/device-tree/ | grep dsi # STM32MP23/25 case ... dsi@48000000 /proc/device-tree/soc@0/bus@42080000/dsi@48000000:
![]() |
Next steps use the DSI address 0x5a000000 as example (STM32MP15x lines ![]() |
2. Boot the board and read the VMPG related register running values
devmem2 0x5a000038 # Read DSI_VMCR running value (here 0x0000BF02) /dev/mem opened. Memory mapped at address 0xb6fd6000. Read at address 0x5A000038 (0xb6fd6038): 0x0000BF02
3. Enable the desired test pattern
devmem2 0x5a000038 w 0x0001BF02 # Enable VMPG with vertical color bars by default (DSI_VMCR.PGE=0x1) /dev/mem opened. Memory mapped at address 0xb6fc8000. Read at address 0x5A000038 (0xb6fc8038): 0x0000BF02 Write at address 0x5A000038 (0xb6fc8038): 0x0001BF02, readback 0x0001BF02
devmem2 0x5a000038 w 0x0101BF02 # Switch to horizontal color bars (DSI_VMCR.PGO=0x1) /dev/mem opened. Memory mapped at address 0xb6fbc000. Read at address 0x5A000038 (0xb6fbc038): 0x0001BF02 Write at address 0x5A000038 (0xb6fbc038): 0x0101BF02, readback 0x0101BF02
devmem2 0x5a000038 w 0x0011BF02 # Switch to the BER pattern (DSI_VMCR.PGM=0x1) /dev/mem opened. Memory mapped at address 0xb6f63000. Read at address 0x5A000038 (0xb6f63038): 0x0101BF02 Write at address 0x5A000038 (0xb6f63038): 0x0011BF02, readback 0x0011BF02
devmem2 0x5a000038 w 0x0000BF02 # Disable VMPG (DSI_VMCR.PGE=0x0) /dev/mem opened. Memory mapped at address 0xb6eeb000. Read at address 0x5A000038 (0xb6eeb038): 0x0011BF02 Write at address 0x5A000038 (0xb6eeb038): 0x0000BF02, readback 0x0000BF02
4. Perform the signal quality test with the measurement equipment
![]() |
Before making any measurements, it may be useful to test the procedure on a real MIPI® DSI panel, keeping in mind that enabling VMPG will cause the screen to display test patterns instead of its application content.
In the below photos, the STM32MP157x-DKx board is used, the application is by default in landscape mode but the panel is natively portrait: |
5. Getting started (Debugfs case)[edit | edit source]
If Debugfs is available in the software, it is convenient to use vpg, vpg_ber_pattern, vpg_horizontal
files instead of using DSI register reads and writes.
5.1. On STM32MP15x lines
[edit | edit source]
Next commands use the DSI address 5a000000
:
ls /sys/kernel/debug/5a000000.dsi vpg vpg_ber_pattern vpg_horizontal echo 1 > /sys/kernel/debug/5a000000.dsi/vpg # Enable VMPG with vertical color bars by default echo 1 > /sys/kernel/debug/5a000000.dsi/vpg_horizontal # Switch to horizontal color bars echo 1 > /sys/kernel/debug/5a000000.dsi/vpg_ber_pattern # Switch to the BER pattern echo 0 > /sys/kernel/debug/5a000000.dsi/vpg # Disable VMPG
5.2. On STM32MP23x lines
and STM32MP25x lines
[edit | edit source]
Next commands use the DSI address 48000000
:
ls /sys/kernel/debug/48000000.dsi vpg vpg_ber_pattern vpg_horizontal echo 1 > /sys/kernel/debug/48000000.dsi/vpg # Enable VMPG with vertical color bars by default echo 1 > /sys/kernel/debug/48000000.dsi/vpg_horizontal # Switch to horizontal color bars echo 1 > /sys/kernel/debug/48000000.dsi/vpg_ber_pattern # Switch to the BER pattern echo 0 > /sys/kernel/debug/48000000.dsi/vpg # Disable VMPG
6. Alternatives[edit | edit source]
Instead of the OpenSTLinux distribution, it is also possible to use:
- On STM32MP23x lines
and STM32MP25x lines
: STM32CubeMP2 Package
7. References[edit | edit source]
- ↑ Bit error rate article on Wikipedia