An4860 Introduction To Dsi Host On Stm32 Mcus and Mpus Stmicroelectronics
An4860 Introduction To Dsi Host On Stm32 Mcus and Mpus Stmicroelectronics
Application note
Introduction to DSI host on STM32 MCUs and MPUs
Introduction
A growing demand for smartphone-like, high level graphical user interfaces in embedded
devices is posing big challenges to embedded system designers. The SPI, parallel and RGB
interfaces have been widely used so far to make the connection between an MCU (or MPU) and
a display. With increasing resolution and refresh rate requirements, a higher number of pins (up
to 28 pins in case of the 16.7 million colors displays) and higher pixel clock frequencies are
needed. These requests increase the pin count requirement on the controller side and the
overall PCB complexity and cost due to board size, routing complexity and skew problems
between clock and data.
To address these challenges, STMicroelectronics offers the first MCU products in the market
with an integrated MIPI-DSI host. These new STM32 products with DSI host implement a more
effective method for connecting to displays. The MIPI-DSI is a high-speed, low pin-count serial
interface for displays originally targeted for the mobile industry. The DSI interface has become
popular due to its widespread use in mobile phones and tablets, which has driven down the DSI
displays costs and made them attractive for other consumer markets.
The STM32 MIPI-DSI host drastically reduces the device’s pin count, enabling an easy
connection with ubiquitous DSI displays available today in the market. Thanks to its low pin-
count and low-power features, the DSI host is the most effective way to connect to displays
especially for devices which have stringent constraints on size and power consumption like
wearables.
This application note describes the DSI host interface on STM32 MCUs and MPUs and focuses
on presenting different operating modes of the DSI host and providing guidelines to choose the
best operating mode depending on an application’s needs. It also provides practical examples
on how to configure the DSI host depending on the operating mode.
Related documents
This application note has to be read in conjunction with below documents available at
www.st.com:
• STM32F76xxx and STM32F77xxx advanced Arm®-based 32-bit MCUs (RM0410)
• STM32F469xx and STM32F479xx advanced Arm®-based 32-bit MCUs (RM0386)
• STM324Rxxx and STM32L4Sxxx advanced Arm®-based 32-bit MCUs (RM0432)
• STM32H747/757 advanced Arm®-based 32-bit MCUs (RM0399)
• STM32MP157 advanced Arm®-based 32-bit MPUs (RM0436)
• STM32U5 Series Arm®-based 32-bit MCUs (RM0456)
• Related STM32F469/479, STM32F7x8, STM32F7x9, STM32L4R9xx, STM32L4S9xx,
STM32H747xI/G, STM32H757xI, STM32MP157A/D, STM32MP157C/F datasheets
Contents
3 DSI introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1 DSI operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.1 Command mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.2 Video mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 DSI physical layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.1 PHY configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.2 PHY signaling mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Data lane states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
3.2.3 Data lane operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Control mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
High-speed transmission mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Escape mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24
3.2.4 Bidirectional lanes and bus turnaround procedure . . . . . . . . . . . . . . . . 30
3.2.5 Clock-lane power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Low-power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
High-speed mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
Ultra-low-power state (ULPS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
10 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
List of tables
List of figures
Figure 100. Generic short write with acknowledge request enabled . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Figure 101. RCC configuration to use HSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Figure 102. LTDC configuration in DSI mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Figure 103. DSI host configuration in video mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Figure 104. LTDC pixel clock configuration in video mode using PLLSAI1 . . . . . . . . . . . . . . . . . . . . . 113
Figure 105. DSI clocks configuration in video mode using DSI PLL . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Figure 106. LTDC parameters settings in video mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Figure 107. LTDC layers settings in video mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Figure 108. Data and clock lanes configuration in video mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Figure 109. PHY timings configuration in video mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Figure 110. Commands configuration in video burst mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Figure 111. Display interface configuration in video burst mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Figure 112. Commands configuration in video nonburst mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Figure 113. Display interface configuration in video nonburst mode . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Figure 114. DSI adapted mode selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Figure 115. LTDC clock configuration in adapted command mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Figure 116. LTDC parameters configuration in adapted command mode . . . . . . . . . . . . . . . . . . . . . . 126
Figure 117. Data and clock lanes configuration in adapted command mode . . . . . . . . . . . . . . . . . . . 127
Figure 118. PHY timing configuration in adapted command mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Figure 119. Command transmission configuration in adapted command mode . . . . . . . . . . . . . . . . . 129
Figure 120. Display interface configuration in adapted command mode . . . . . . . . . . . . . . . . . . . . . . . 130
Figure 121. Small display driving example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Figure 122. Large display driving example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
This section presents the standards and references used in this document.
• MIPI® Alliance specification for display serial interface (DSI)
v1.1 - November 22, 2011
• MIPI® Alliance specification for display bus interface (DBI-2)
v2.00 - November 16, 2005
• MIPI® Alliance specification for display command set (DCS)
v1.1 - November 22, 2011
• MIPI® Alliance specification for display pixel interface (DPI-2)
v2.00 - September 15, 2005
• MIPI® Alliance specification for stereoscopic display formats (SDF)
v1.0 - November 22, 2011
• MIPI® Alliance specification for D-PHY
v1.1 - November 7, 2011
The display serial interface (DSI) is a high-speed serial protocol defined by the MIPI (mobile
industry processor interface) Alliance to allow the interface between a display module and a
host processor.
The STM32 is the first MCU on the market with an integrated DSI host. The STM32 DSI
host provides a highly integrated solution thanks to its internal MIPI D-PHY, a dedicated
PLL, and a 1.2 V voltage regulator.
The DSI host provides a high-speed communication interface of up to 2 Gb/s. The DSI host
allows the STM32 MCUs and MPUs to interface with a display using only a reduced pin
count and without the need of an external bridge. The DSI interface is fully configurable,
allowing an easy connection to the DSI compliant displays available today on the market.
Applications can benefit from the easy connection and reduced pin count enabled by the
DSI host, which reduces the PCB complexity and the overall system’s cost.
The DSI host is deeply integrated with the LCD-TFT display controller (LTDC) to ease the
application development and porting.
The STM32 DSI host provides a scalable architecture. Depending on the bandwidth’s
requirements, the user may choose one or two data lanes.
Gate driver
LCD / OLED
Continously refreshed from GRAM
@ 60 Hz
PWM timer
high-voltage Backlight
controller
Only for LCD
MSv43445V1
MCU RGB
Continous Display module
Timing
Display
controller
controller Sync
Source driver
60 Hz
streaming
Frame bandwidth
buffer
(GRAM)
Gate driver
LCD / OLED
Continously refreshed from GRAM
@ 60 Hz
PWM timer
high-voltage Backlight
controller
Only for LCD
MSv43446V1
Ctrl
Ctrl
MSv43447V1
The MIP-DSI is supported by the new STM32 products embedding a DSI host.
The DSI interface gives the possibility to interface with both types of displays. In case of
displays with GRAM and display controller, the DSI host sends commands to refresh the
GRAM as in DBI mode. In case of displays without GRAM nor display controller, the DSI
host sends a stream of pixel data and video synchronization events as in DPI mode.
DSI
DBI 4 to 6 pins
host - 1 clock lane
- Up to 2 data lanes
Flash RAM FMC - 80 Mbit/s up to 1 Gbit/s
PPI
Controller
DSI
D-PHY control
GRAM
MSv43449V1
The Table 2 below summarizes the different display interface schemes inside the STM32
products.
Max FMC
On SRAM
Product FLASH chip MIPI- LTDC Quad-
JPEG Chrom-Art Max AHB
and
DSI (1) Codec Accelerator frequency
(bytes) SRAM host SPI (2) (3) (4) (5) SDRAM
(MHz)
(bytes) frequency
(MHz)
Up to
STM32F469/479 line 384k Yes Yes Yes No Yes 180 90
2M
STM32F7x8 line Up to
512k Yes Yes Yes Yes Yes 216 100
STM32F7x9 line 2M
STM32L4R9xx/S9xx 2M 640k Yes Yes Yes No Yes 120 60
STM32H747/H757 2M 1M Yes Yes Yes Yes Yes 240 110
STM32U599/5A9
4M 2.5M Yes Yes Yes No Yes 160 80
STM32U595/5A5
1. The LTDC is a TFT-LCD display controller. For more details on STM32’s LTDC interface, refer to application note AN4861.
2. The Quad-SPI interface allows interfacing with external memories to extend the application’s size. For more details on
STM32’s QSPI interface, refer to application note AN4760.
3. The JPEG codec provides hardware acceleration for JPEG encoding and decoding.
4. Chrom-Art Accelerator® is an ST proprietary 2D graphic acceleration engine.
5. The LTDC fetches graphic data at AHB speed.
4 or 6
DSI Host
28
Chrom
LCD-TFT
Cortex-M DMA
Art
(DMA2D)
CPU buses
FLASH
ART
2 MB
SRAM
FMC
QSPI
3 DSI introduction
The DSI specifies the interface between a host processor and a display module. It is built on
the existing MIPI Alliance specifications by adopting the pixel formats and the command set
specified in the DPI-2, DBI-2, and DCS standards.
The DSI host sends pixel data, signal events or commands to the display after
encapsulating them into DSI packets. The DSI host can read back status or pixel information
from the display.
The DSI host transmits the DSI packets in the form of parallel data to the D-PHY through the
PHY protocol interface (PPI). The D-PHY serializes the packets and sends them across the
serial link.
On the display side, the packets are decomposed into parallel data, signal events and
commands.
Figure 7 provides an overview of a DSI interface between a host and a display:
MCU
DSI Host
PPI (PHY protocol
interphace)
D-PHY
CLKP
CLKP
D0N
D3N
D0P
D3P
...
D-PHY
PPI (PHY protocol
interphace)
DSI Peripheral
Display
MSv43451V1
display module that supports the command mode incorporates a controller and a frame
buffer.
The host processor indirectly controls the activity at the display module by sending
commands, parameters and data to the display controller.
Host Display
clock lane clock lane
Host DSI Display DSI
controller Host Display controller
PPI PPI
data lane 0 data lane 0
Host Display
data lane 1 data lane 1
Reference ground
MSv43453V1
Control mode
After reset, the data lanes are in control mode (LP-11 stop mode). All other modes start and
end to control mode.
Byte Byte
LPS SoT Byte 0 Byte 1 EoT LPS
N-2 N-1
MSv43454V1
HS data
Start of transmission transmission End of transmission
0 0 0 0 1 1 1 0 1
LP-11 LP-01 LP-00 HS-0 HS-0 HS-1 HS-0 HS-1 HS-0/1 HS-0/1 LP-11
D0N
D0P
MSv43455V1
3. Multilane support
The HS transmission can be done using one or more data lanes.
Figure 12 shows an example of HS transmission using two data lanes:.
If the number of bytes transmitted is not an integer multiple of the number of lanes,
some lanes may complete the HS transmission before the other lanes.
Figure 13 shows an example with two data lanes and odd number of bytes causing
lane 1 to complete HS transmission and issue EoT sequence before data lanes 0.
Figure 13. HS transmission using two data lanes with odd number of bytes
Escape mode
The data lane may enter the escape mode via the escape mode request procedure (LP-
11,LP-10,LP-00,LP-01,LP-00).
After entering the escape mode, the transmitter sends an 8-bit entry command to indicate
the requested action.
Escape entry command may be:
• Low-power data transmission (LPDT)
• Ultra low-power state (ULPS)
• Remote triggers
The Table 6 states the different entry commands supported in the escape mode:
Note: The low-power data transmission and trigger messages are only supported by lane 0.
The escape mode is exit through the escape mode exit procedure (LP-10, LP-11).
1. Spaced-one-hot coding
In escape mode, the entry command and the low-power data transmission (LPDT)
communication are coded using the spaced-one-hot coding, which means that each
mark state is interleaved with a space state.
Each symbol consists therefore of two parts: a one-hot phase (Mark-0 or Mark-1) and a
space phase.
The spaced-one-hot coding provides high reliability and the ability to extract the clock
from the data stream. However, it requires the double of the bandwidth of the data
transmitted (see Figure 14).
LP-10 LP-01
LP-00 LP-00
Mark-1 Mark-0
D0P D0N
MSv43458V1
2. Low-power clock
The transmitter uses a low-power clock signal for the low-power communications, but
this clock is not transmitted to the receive side.
The data is self-clocked by the spaced-one-hot bit encoding, and the receiver can
retrieve the clock from the two line signals using an exclusive-OR function.
Figure 15 shows an example of data transmission using spaced-one-hot encoding. The
LP clock is obtained by applying an exclusive-OR function on the two signals (D0P and
D0N.).
Data transmitted 0 0 1 0 0 0 0 1
D0P
D0N
LP CLK =
EXOR (D0P, D0N)
MSv43459V1
1 1 1 0 0 0 0 1
D0P D0N
MSv43460V1
Data is sent in LSB (least significant bit) first, and for a multibyte payload, the least
significant byte is transferred first.
During the LPDT, the lane can be paused by maintaining a space state (LP-00) on the
lines. Figure 17 shows an example of an LPDT payload data transmission.
Space
0 0 1 0 1 0 0 1 0 1 1 1 0 0 0 0
State
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
LP-00
D0P D0N
MSv43461V1
0 0 0 1 1 1 1 0 LP-00
D0P D0N
MSv43462V1
5. Triggers
The trigger signaling is a messaging system to send a flag to the receiving side. This
can be either in the forward or reverse direction.
Three trigger messages are used in DSI:
– Acknowledge trigger: is a message sent by the display to the DSI host to indicate
that the last transmissions have been received with no errors. This is a reverse
direction communication (see Figure 19).
– Tearing effect trigger: used by the display to inform the host about the internal
timing. This is a reverse direction communication (see Figure 20).
– Reset trigger: sent by the host to reset the display (see Figure 21).
Escape
Control mode Control mode
mode
Escape mode entry Escape mode exit
0 0 1 0 0 0 0 1
D0P D0N
MSv43463V1
0 1 0 1 1 1 0 1
D0P D0N
MSv43464V1
0 1 1 0 0 0 1 0
D0P D0N
MSv43465V1
Low-power mode
During the low-power mode, the clock lane is in the LP-11 stop state. All other modes start
from and end with the LP mode.
High-speed mode
The clock lane enters the HS mode starting from the LP mode by driving an HS entry
sequence (LP-11,LP-01,LP-00,HS-0) (see Figure 23). After that, the clock lane enters the
HS mode and starts toggling HS-0,HS-1.
LP mode HS mode
0 000 1 0 1 0 1
ClkN ClkP
MSv43467V1
The clock lane leaves the HS mode through the exit sequence (HS-0,LP-11) (see
Figure 24).
HS mode LP mode
0 0 0 0 0 0 0 0 0 0 0 0
LP-11
Toggling HS-0/HS-1 HS-0
Stop
ClkN ClkP
MSv43468V1
The high-speed clock is started before that the high-speed data is sent via the data lanes.
The high-speed clock continues clocking after the high-speed data lane has stopped (see
Figure 25).
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
LP-01
LP-11 LP-00 LP-11
HS- HS-0 Toggling HS-0/HS-1 Toggling HS-0/HS-1 Toggling HS-0/HS-1 HS-0
Stop Bridge Stop
Rqst
HS data
Start of transmission End of transmission
transmission
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0 0 0 0 1 1 1 0 1
ClkN ClkP
MSv43470V1
The clock lane leaves the ULPS state towards the LPM using the ULPS exit sequence (LP-
00, LP-10, LP-11) as shown inFigure 27.
ClkN ClkP
MSv43471V1
[7:6]: Virtual
channel ID
[5:0]: Data type
Data
DataID Word count ECC Data 0 Data 1 Data 2 Checksum
WC-1
8 bits 16 bits 8 bits 0 … 65535 bytes 16 bits
Short packet
Packet: 4 bytes
MSv43472V1
The data is sent in bytes with least significant bit first. For multibyte fields such as word
count and checksum, the data is sent with least significant byte first.
Figure 29 shows a long packet example.
10 0 1 0 1 0 01 0 0 0 0 0 0 00 0 0 0 0 0 0 00 1 1 0 0 0 0 01 0 0 0 0 0 0 00 1 1 1 0 0 0 00 1 1 1 1 0 0 0
MSB
MSB
MSB
MSB
MSB
LSB
LSB
LSB
LSB
LSB
Time
MSv44677V1
Long packet
The long packets are mainly used for large blocks of data transmission such as pixel data.
They are composed of three parts: packet header (PH), payload data, and packet footer
(PF).
Short packet
Short packets are formed of four bytes:
• One byte for data ID.
• Two bytes for command or payload data.
• One byte for ECC.
They are mainly used for short command transmission and for timing sensitive information
like video synchronization events.
B7 B6 B5 B4 B3 B2 B1 B0
VC DT
Virtual
Data type (DT)
channel
identifier (VC)
MSv44678V1
EoT
packet
MSv43473V1
Figure 32. Short packet transmission in HS mode using one data lane
Data
Lane 0 LPS SoT Data 0 Data 1 ECC EoT LPS
ID
MSv43474V1
Figure 33 shows a short packet transmission in HS mode using two data lanes.
Figure 33. Short packet transmission in HS mode using two data lanes
Data
Lane 0 LPS SoT Data 1 EoT LPS
ID
MSv43475V1
Escape
Escape Data Escape
LPS command Data 0 Data 1 ECC LPS
entry LPDT ID exit
Lane 0
MSv43476V1
Figure 35 shows a long packet transmission in HS mode using one data lane.
Figure 35. Long packet transmission in HS mode using one data lane
Lane 0
WC WC Data CS
LPS SoT Data ID
LSB MSB
ECC Data 0
WC-1
CS LSB
MSB
EoT LPS
MSv43477V1
Figure 36. Long packet transmission in HS mode using two data lanes
Data WC Data CS
Lane 0 LPS SoT
ID MSB
Data 0
WC-2 LSB
EoT LPS
WC Data CS
Lane 1 LPS SoT
LSB
ECC Data 1
WC-1 MSB
EoT LPS
MSv43478V1
If the number of payload data is not an integer multiple of the number of lanes, some lanes
may complete the HS transmission before the other lanes, sending an EoT one cycle (byte)
earlier.
Figure 37 shows an example using two data lanes. In this case, the payload data has an
odd number of bytes causing data lane 1 to complete the HS transmission before data lane
0.
Figure 37. Long packet transmission in HS mode using two data lanes with odd
payload data
WC Data Data CS
Lane 0 LPS SoT Data ID
MSB
Data 0
WC-3 WC-1 MSB
EoT LPS
WC Data
Lane 1 LPS SoT
LSB
ECC Data 1
WC-2
CS LSB EoT LPS
MSv43479V1
Lane 0
Escape
Escape WC WC Data CS CS Escape
comman Data ID ECC Data 0
LPS entry LSB MSB WC-1 LSB MSB exit LPS
d LPDT
MSv43480V1
0x00
0x00
0x12
0x00
0x00
0x18
DataID Data0 Data1 ECC DataID Data0 Data1 ECC
MSv43481V1
The shutdown and the turn on commands are short packets used to switch on or off the
display module (see Figure 40).
0x0D
0x1E
0x22
0x00
0x00
0x32
0x00
0x00
2. Synchronization events
The synchronization events are sent through short packets since short packets are
more suitable to convey accurate timing information (see Figure 41).
0x01
0x00
0x00
0x07
0x00
0x00
0x14
0x11
HSYNC start HSYNC end
0x00
0x00
0x12
0x31
0x00
0x00
0x01
DataID Data0 Data1 ECC DataID Data0 Data1 ECC
MSv43483V1
Figure 42. Packed pixel stream, 16-bit format, data type (0x0E)
pixel 1 pixel N
MSv43484V1
Figure 43. Packed pixel stream, 18-bit format, data type = (0x1E)
0 7 0 15 0 7 0 7 0 7 0 7 0 7 0 7 0 15
0 5 R RG GB BR RG GB BR RG GB B
0 50 50 5 0 50 50 50 50 50 5
V. channel
Data type
PACKED
MSv44129V1
Figure 44. Loosely packed pixel stream, 18-bit format, data type = (0x2E)
1 byte 2 bytes 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 2 bytes
0 7 0 15 0 70 7 0 7 0 7 0 7 0 7 0 7 0 15
0 5 R R G G B B R R G G B B
LOOSELY
0 5 0 5 0 5 0 5 0 5 0 5
V. channel
Data type
pixel 1 pixel N
MSv44130V1
Figure 45. Packed pixel stream, 24-bit format, data type = (0x3E)
1 byte 2 bytes 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 2 bytes
0 7 0 15 0 70 7 0 7 0 7 0 7 0 7 0 7 0 15
0 5 R RG GB B R RG GB B
0 7 0 7 0 7 0 7 0 7 0 7
V. channel
Data type
pixel 1 pixel N
1 pixel
MSv44131V1
Parameter 1
Parameter 2
Parameter
0x03
0x00
0x00
0x13
0x00
0x01
0x23
ECC
ECC
DataID Data0 Data1 ECC DataID Data0 Data1 ECC DataID Data0 Data1 ECC
MSv44132V1
Checksum
WC MSB
WC LSB
Data 0
Data 1
0x29
ECC
16-bit
32-bit packet header Playload data
packet footer
MSv44133V1
Parameter 2
Parameter
0x04
0x00
0x00
0x14
0x00
0x24
ECC
ECC
ECC
DataID Data0 Data1 ECC DataID Data0 Data1 ECC DataID Data0 Data1 ECC
MSv44134V1
2. DCS commands
DCS is a standardized command set defined by the MIPI Alliance intended for the
command mode displays. The DCS commands are listed in Table 8.
The DCS commands with a 0 or 1 parameter are sent using short packets, while the
DCS commands with more than one parameter are sent using long packets.
There are three types of DCS commands:
– DCS short write. Refer to Figure 49.
DCS short write with no parameters is sent using a shot packet with DT 0x05. The
DCS command index is placed in the data 0 field. The data 1 field is not used. It is
set to 0.
The DCS short write with one parameter have DT 0x15. The DCS command index
is placed in the data 0 field and the parameter is placed in the data 1 field.
– DCS long write. Refer to Figure 50.
– DCS read. Refer to Figure 51.
The read command must be followed by a BTA to give the bus control to the
display, so that the latter can send the response.
The response may be a DCS short or long read response (see Table 9).
DCS command
Parameter
0x05
0x00
0x15
ECC
ECC
DataID Data0 Data1 ECC DataID Data0 Data1 ECC
MSv44135V1
Checksum
command
WC MSB
WC LSB
Data 0
0x39
ECC
DCS
16-bit
32-bit packet header Playload data
packet footer
MSv44136V1
command
0x06
0x00
DCS
ECC
DataID Data0 Data1 ECC
MSv44137V1
set_gamma_curve 26h Selects the gamma curve used by the display device.
set_page_address 2Bh Set the page extent.
Defines the number of columns in the partial display
set_partial_columns 31h
area on the display device.
Defines the number of rows in the partial display area
set_partial_rows 30h
on the display device.
Defines how many bits per pixel are used in the
set_pixel_format 3Ah
interface.
Defines the vertical scrolling and fixed area on display
set_scroll_area 33h
device.
set_scroll_start 37h Defines the vertical scrolling starting point.
Synchronization information is not sent from the
set_tear_off 34h
display module to the host processor.
Synchronization information is sent from the display
set_tear_on 35h
module to the host processor at the start of VFP.
Synchronization information is sent from the display
set_tear_scanline 44h module to the host processor when the display device
refresh reaches the provided scanline.
set_VSYNC_timing 40h Set VSYNC timing.
soft_reset 01h Software reset.
write_LUT 2Dh Fills the peripheral lookup table with the provided data.
Transfer image information from the host processor
write_memory_continue 3Ch
interface to the peripheral from the last written location.
Transfer image data from the host processor to the
write_memory_start 2Ch peripheral starting at the location provided by
set_column_address and set_page_address.
The display to host communication may only begin after the host gives the bus ownership to
the display by using a BTA sequence.
After sending the response, the display gives back the bus control to the host through a BTA
sequence.
Figure 52 shows and example of a reverse communication sequence. Note that the display
to host transmissions happen in LP mode using the data lane 0.
response
BTA H2P
BTA P2H
Display
Escape entry
Escape exit
Data ID
Data 0
Data 1
LPDT
ECC
Short Read
Escape entry
Escape exit
Data WC-1
WC MSB
WC LSB
CS MSB
CS LSB
Data ID
Data 0
Data 1
LPDT
Long Read
MSv44138V1
tL tL tL tL tL tL tL tL
B B B B B H H H B H H H B H B V
V H H H H H H H H V H H H H H H H
LS L L L L Active video area S S S L S S S L S L S
S S S S S S S S S S S S S S S S S
LS L L L L S A E L S A E L S L S
S A E S A E S A E S A E S A E A E
P P P P P P P P
H H H H
S HSA S HBP RGB HFP S HSA S HBP RGB HFP
S E S E
VACT lines
MSv44697V1
tL tL tL tL tL tL tL tL
B B B B B B B B
V H H H H H H H V
L L L L L L L L
S SS S S S Active video area S S S S
L L L L L L L L
S SS S S S S S S S
P P P P P P P P
H H
S HBP RGB HFP S HBP RGB HFP
S S
VACT lines
MSv44698V1
tL tL tL tL tL tL tL tL
B B B B B B B B
V H H H H H H H V
L L L L L L L L
S SS S S S Active video area S S S S
L L L L L L L L
S SS S S S S S S S
P P P P P P P P
H B H B
S RGB L S RGB L
HBP HFP HBP HFP
S L S L
P P
VACT lines
MSv44699V1
The double BTA is required because the display’s DSI protocol layer responds to the first
BTA with an acknowledge trigger or error report and gives back the bus control to the host
(as it does not interpret DCS commands).
In order to allow a TE reporting, the host has to perform a second BTA to give the bus
control to the display. The display responds with a TE trigger (01011101) as soon as the
scanline is reached.
Figure 56 illustrates the tearing effect sequence.
Display reaches
TE scanline
DCS
set_tear_on/ BTA Ack BTA BTA TE BTA LP-11
set_tear_Sca H2P Trigger P2H H2P Trigger P2H
nline
MSv44139V1
1. BTA H2P is a BTA procedure initiated by the host to give bus control to the peripheral. BTA P2H is a BTA
procedure initiated by the peripheral to give bus control to the host.
The Set_tear_scanline enables the TE reporting in the same way than set_tear_on, but
Set_tear_scanline also defines the scanline at which the TE reporting should happen. The
Set_tear_scanline DCS long packet is illustrated in Figure 57 where the TE reporting is
required when the display reaches line 533 (in this example).
Generally set_tear_scanline is used at the initialization phase to program the TE scanline,
then the host sends set_tear_on whenever it needs to enable a TE reporting.
The Set_tear_scanline command is a long DCS write command. It takes two parameters
that define the TE scanline.
Note: The TE scanline is sent using two bytes, most significant byte first.
0x03
0x00
0x44
0x02
0x15
ECC
This section describes the STM32 DSI host system level architecture and operating modes
and provides some guidance to select the appropriate operating mode depending on the
application needs.
DSI
Regulator
LCD_CLK
PLL
LCD_HSYNC
CLKP
LCD_VSYNC
LCD_DE
Sync
CLKN
LTDC
LCD_R[7:0] RGB D0P
D1P
LCD_B[7:0]
D1N
Ctrl
APB
MSv44682V1
Hsync
DATAEN
VSA
VSE Blanking HSE Blanking or LP
Blanking or LP
VBP HSS Blanking HSE
Blanking
HSS Blanking HSE Blanking or LP PPS NULL PPS NULL or LP
Blanking
HSS Blanking HSE Blanking or LP PPS NULL PPS NULL
VACT or LP
Blanking
HSS Blanking HSE Blanking or LP PPS NULL PPS NULL or LP
MSv44142V1
The HSA (HSYNC active) period is composed of HSS (HSYNC start), blanking and HSE
(HSYNC end) packets. The packets in this region are transmitted in high-speed mode and
the link does not go to LP during the HSA period.
The DSI host automatically calculates the blanking packet size required to match the timing
between the HSS and HSE packets, with the HSA period time.
When the DSI host detects a VSYNC rising edge (supposing VSYNC signal is active high),
the DSI host starts an HSA period with a VSYNC start (VSS) packet instead of an HSS
packet.
When the VSYNC falling edge is detected, the DSI host sends a VSYNC end (VSE) packet
instead of an HSS packet to mark the end of the VSA period.
Other lines inside the VSYNC active (VSA) region are started with an HSS packet.
Outside the vertical active (VACT) period, the link goes to LP after an HSA period until the
end of the horizontal line.
In the VACT region, the DSI host conveys an HSA period as described above, then the link
either goes to LP or sends a blanking packet for a timing period equal to an horizontal back
porch (HBP) period. Then the DSI host sends a PPS (packed pixel stream) packet in one or
more chunks with eventually null packets to match the pixel transmission timing with the
horizontal active (HACT) period.
Once the HACT period has finished, the DSI host either goes to LP or sends blanking
packets for a period equal to a horizontal front porch (HFP) period.
Note: When regions are tagged with blanking or LP, it means that the DSI host may send a high-
speed blanking packet for the total period time, or that the DSI host may put the link into low-
power mode.
The DSI host can calculate the number of bytes needed inside a blanking packet in order to
match the period timing.
In the low-power mode case, the DSI PHY initiates an end of transmission sequence before
going to the low-power mode. Then, before starting a new HS transmission, the DSI PHY
issues a start of transmission sequence.
The DSI host needs some inputs from the user to know the overhead of the low-power
transition (EoT and SOT sequences) to know if switching to low-power is possible during a
specific period.
Figure 60 shows the two possible scenarios for blanking or low-power regions.
Blanking or LP
HS Blanking packet
EoT LP SoT
MSv44143V1
During the VACT period, there are many different configurations of a horizontal line.
Figure 61 shows different possible configurations of VACT region lines.
DATAEN LTDC
interface
Hsync
Blanking
HSS Blanking HSE Blanking or LP PPS NULL HSS
or LP
Non burst
One chunk PPS + NULL with sync
pulses
Blanking one chunk
HSS Blanking HSE Blanking or LP PPS HSS
or LP
Blanking
HSS Blanking HSE Blanking or LP PPS PPS HSS
or LP
Non burst
Chunk 1 Chunk 2 with sync
pulses two
Blanking chunks
HSS Blanking HSE Blanking or LP PPS NULL PPS NULL HSS
or LP
Chunk 1 + Chunk 2 +
NULL NULL
MSv44144V1
During HBP and HFP periods the link may go to LP, or the DSI host sends a blanking packet
if there is no sufficient time to transition between HS and LP mode during this period.
During the HACT period, the DSI host must send pixel data in a timing period that matches
the LTCD HACT period. Depending on the DSI and on the pixel clock frequency, the DSI
host may send the pixel data using one or more chunks.
Each chunk may contain only a packet pixel stream (PPS) packet or a PPS packet with null
packet.
The choice of the number of chunks and the size of null packets in nonburst mode is
discussed in Section 5.2.1: Video mode over LTDC interface.
Figure 62 shows an active line with four chunks. Each chunk is composed of a PPS packet
and a null packet.
Figure 62. Active line with four chunks with null packets configuration
Hsync
DATAEN
VSS Blanking or LP
VSA
HSS Blanking or LP
Blanking or LP
VBP HSS
Blanking
HSS Blanking or LP PPS NULL PPS NULL or LP
Blanking
HSS Blanking or LP PPS NULL PPS NULL
VACT or LP
Blanking
HSS Blanking or LP PPS NULL PPS NULL or LP
HSS Blanking or LP
VFP
HSS Blanking or LP
MSv44146V1
The start of the VSA region is determined by a line starting with a VSS packet. All other lines
in the frame start with an HSS packet.
In nonactive regions (VSA,VBP,VFP) the link goes to LP after sending the HSS packet until
the next line.
In the VACT region, the DSI host sends an HSS packet than either goes to LP or sends
blanking packets until the end of HSA + HBP periods.
The HACT region is same as in the nonburst with sync pulses mode.
Figure 64 shows a VACT region in burst mode with sync events.
DATAEN LTDC
interface
Hsync
Blanking
HSS Blanking or LP PPS NULL HSS
or LP
Non burst
One chunk PPS + NULL with sync
pulses
Blanking one chunk
HSS Blanking or LP PPS HSS
or LP
Blanking
HSS Blanking or LP PPS PPS HSS
or LP
Non burst
Chunk 1 Chunk 2 with sync
pulses two
Blanking chunks
HSS Blanking or LP PPS NULL PPS NULL HSS
or LP
Chunk 1 + Chunk 2 +
NULL NULL
MSv44147V1
The VACT region in nonburst mode with sync event differs from the sync pulses only during
the HSA period.
The DSI host sends the HSS packet to signal the beginning of an HSA period. Then, the link
either goes to LP or the host sends blanking packets until the start of HACT region.
When to use nonburst mode
The nonburst mode provides a better matching of rates for pixel transmission. This
mode enables:
– Only a certain number of pixels to be stored in the memory and not requiring a full
pixel line (fewer RAM requirements in the DSI host).
– Operations with devices that support only a small amount of pixel buffering (less
than a full pixel line).
Burst mode
In the video burst mode, RGB pixel packets are time-compressed, leaving more time during
a scanline for LP mode (saving power) or for multiplexing other transmissions onto the DSI
link.
In this mode, the entire active pixel line is buffered into a FIFO and transmitted in a single
packet with no interruptions. This transmission mode requires that the DSI payload pixel
FIFO has the capacity to store a full line of active pixel data inside of it.
This mode is optimally used when the difference between the LTDC bandwidth and the DSI
link bandwidth is significant. The burst mode enables the DSI host to quickly dispatch the
entire active video line in a single burst of data and then return to low-power mode.
Figure 65 shows a typical frame in video burst mode. The difference versus the nonburst
mode with sync events resides in the HACT region. In burst mode, during the HACT region,
the RGB data is sent using a single packet at maximum speed then the link goes to LP
mode.
Hsync
DATAEN
VSS Blanking or LP
VSA
HSS Blanking or LP
Blanking or LP
VBP HSS
HSS Blanking or LP
VFP
HSS Blanking or LP
MSv44148V1
Figure 66 shows a video active line with RGB pixel data sent by using a PPS packet. Since
the DSI link bandwidth is higher than the DSI input bandwidth from the LTDC, the link goes
to LP mode for a long period.
DATAEN LTDC
interface
Hsync
Blanking
HSS Blanking or LP PPS NULL PPS NULL or LP HSS Non burst with sync
events
MSv44149V1
The adapted command mode only supports the DCS (display command set), WMS
(write_memory_start) and WMC (write_memory_continue) commands. Additional
commands such as display configuration commands and tearing effect initialization are
required for proper operation. These commands have to be sent through the APB interface.
DCS
CMD
DataID WC ECC byte Playload data Checksum
Note: The user may need to send DCS commands over the APB interface in order to select the
area to be refreshed on the display side (set_column_address and set_page_address). Also
the user has to reprogram the LTDC parameters to select the window of pixels to be
fetched.
Please refer to STM32cube command mode examples for more details about required
settings.
DCS
CMD
0 1 2 3 DataID WC ECC byte Playload data Checksum
4 5 6 7 WMS 0x39 0xD 0x00 ECC 0x2C Pixel 5 Pixel 6 Checksum
8 9 10 11 WMC 0x39 0xD 0x00 ECC 0x3C Pixel 9 Pixel 10 Checksum
12 13 14 15 WMC 0x39 0xD 0x00 ECC 0x3C Pixel 13 Pixel 14 Checksum
16 17 18 19
Framebuffer
Height 5 lines
Width 4 pixels
MSv44151V1
The basic flow of the adapted command mode is shown in Figure 70.
Once the frame buffer is ready, the user sends Set_tear_on command to activate the TE
reporting on the display side. When the display reaches the programmed scanline, it sends
TE trigger message.
After receiving the TE event, the host automatically refreshes the display by sending
WMS/WMC DCS commands if the automatic refresh feature is enabled.
If the automatic refresh feature is not enabled, the refresh in this case is simply done by
setting one bit (LTDC_EN bit) in the DSI Wrapper.
When the refresh operation is terminated, an EndOfRefresh event is signaled to the DSI
host that may now start the computation of the next frame.
Figure 70. Adapted command mode flow example with automatic refresh
FB computation
Set_tear_on
EndOfRefresh
MSv44152V1
When the display reaches the specified scanline, it sends a tearing effect trigger with a
BTA procedure to give back the bus control to the DSI host.
Figure 74 shows a zoom on the tearing effect trigger message.
The DSI host starts the display refresh operation using the WMS/WMC DCS
commands.
Run Active.
Sleep Active. Peripheral interrupts cause the device to exit the sleep mode.
Stop Frozen. Peripheral register content is kept.
Standby Power-down. The peripheral must be reinitialized after exiting standby mode.
This section describes the low-level hardware registers required for the configuration and
use of the DSI host. For complete programming sequences, please refer to the relevant
STM32 reference manual.
The configuration process is split into two parts:
• Global initialization: this is common to all operating modes: video mode or adapted
command mode.
• Operational mode configuration: this section depends on the chosen operating mode,
either video mode or adapted command mode.
Note: The APB command mode is used in parallel with the video mode and the adapted command
mode. It is not optimized for a use in standalone to refresh the display, even if it is possible,
because it causes high latency. This is why the focus is done only on the video and adapted
command operating modes configuration.
The DSI regulator providing the 1.2 V is controlled through the DSI Wrapper.
The regulator is enabled setting the REGEN bit of the DSI_WRPCR register.
Once the regulator is ready, the RRIF bit of the DSI_WISR register is set.
The power ON / OFF of the D-PHY is done by directly enabling the 1.2 V regulator.
The incoming clock to the DSI PLL is the HSE (high-speed external) oscillator clock.
The PLL output clock is the HS clock fed to the D-PHY. The HS clock is a full-rate clock. It
must be in the range between 80 MHz and 500 MHz.
The D-PHY uses the HS clock to generate a half-rate DDR clock that is transmitted to the
display using the clock lane. Which means that for 500 Mbit/s per lane rate, the PLL output
must be 500 MHz and the transmitted clock lane is a 250 MHz DDR clock.
The D-PHY divides the HS clock by eight to generate the lane_byte_clk, and feed it to the
DSI host.
The lane_byte_clk is calculated using the following formula:
HSE
FVCO = ------------- X 2 X NDIV
IDF
/IDF x2
xN HSE
x20
PLLM
/R xNDIV
PLL fVCO
/2
PLLR
/ODF
DSI PLL
500 MHz
HS CLK
62.5 MHz
Lane_byte_clock
/8
Txescclk
/TXECKDIV 20 MHz max
To_clk
/TOCKDIV /2
Rxclkesc DDR clk to
DSI Host 20 MHz max D-PHY display
MSv44696V2
Note: TXECKDIV must be programmed to ensure that the TX escape clock is less than 20 MHz.
The TX prescaler must be set to a value higher than 2. A prescaler value 0 or 1 disables the
generation of the TX escape clock.
This bit must be cleared when the DSI-PHY is used as the DSI lane_byte_clk source. This is
in normal operating mode.
This bit must be set when PLLR is used as DSI lane_byte_clk source in case DSI PLL and
DSI-PHY are off.
Number of lanes
The DSI host provides a scalable architecture using one or two data lanes. Table 15 shows
the register fields used to program the number of lanes.
Note: In video mode the DSI host decides if it is possible to send the clock lane into LP mode
based on the timing provided in the PHY transition timing (DSI_CLTCR.HS2LP_TIME and
This field defines the bit period in high-speed mode in multiples of 0.25 ns, and is used as a
time base for all the timings managed by the D-PHY.
The unit interval is configured through the DSI_WPCR0.UIX4 field. If this period is not a
multiple of 0.25 ns, the driven value should be rounded down.
Note: This field is mandatory. It must be correctly programmed to avoid timing mismatch issues
between the DSI host and the PHY.
Example: For a 500 Mbit/s link speed, the HS clock output from the PLL and fed to the
PHY is 500 MHz, which has a 2 ns bit period. So, the UIX4 is programmed to
2 / 0.25 = 8.
The unit interval is half the clock period so,
UI= 1 / (2 x 250 MHz) = 2 ns, so UIX4 is programmed to 8.
Bus turnaround
The bus turnaround enable is mandatory when the reverse direction communication is
required, for example on read, acknowledge and tearing effect requests.
Figure 80 shows an example of a read command with BTA procedure automatically
started by the DSI host if DSI_PCR.BTAE is set.
The video control signals (HSYNC, VSYNC and DE) polarity can be programmed in the DSI
LTDC interface. The programmed value must be consistent with the LTDC control signal
polarity settings, meaning that the polarity must be the same in the DSI and LTDC except for
the DE signal.
LTDC global control register allows to set the polarity of NOT DE signal. In all DSI modes,
LTDC NOT DE polarity must be set to active low and so DSI DE polarity must be active high.
The inverse cannot be used.
These timings allow the DSI host to know the LP to HS and the HS to LP transitions
overhead to see if it has enough time to go to LP mode during video blanking periods.
It is mandatory to set LP2HS_TIME and HS2LP_TIME for data lanes in DSI_DLTCR
register.
For clock lane, LP2HS_TIME and HS2LP_TIME are to be set in the DSI_CLTCR register,
only when “automatic clock lane control” is enabled.
LP2HS_TIME reflects the maximum time required by the PHY to switch between LP and
HS, while HS2LP_TIME reflects the maximum time required by the PHY to switch between
HS and LP.
The DSI host compares blanking period with total transition time in order to know whether it
can switch to LP during a blanking period or not.
If (period timing) > (total transition time), then the DSI host requests the D-PHY to go to LP.
If (period timing) < (total transition time), then the DSI host sends blanking packet in HS
mode during that period.
• PHY transition timing:
– Data lane
LP2HS= 17 lanebyteclk
HS2LP= 18 lanebyteclk
– Clock lane
LP2HS= 36 lanebyteclk
HS2LP= 28 lanebyteclk
• Total transition time calculation:
– Only data lanes go to LP
Transition time=HS2LP_TIME (DATA) + LP2HS_TIME (DATA)
– Clock and data lanes go to LP
Transition time= HS2LP_TIME (clock) + LP2HS_TIME (clock)
Example calculation
This example assumes that:
• HS2LP_TIME = 18 lane_byte clock cycle
• LP2HS_TIME = 17 lane_byte clock cycle
• HFP period = 35 pixel_clock cycles
HS2LP_TIME +LP2HS_TIME = 35 lane_byte clock cycle.
HFP > (HS2LP + LP2HS), so the DSI host goes to LP in the HFP region.
Note: The HS2LP_TIME and LP2HS_TIME values must be carefully set to reflect the maximum
time required by the PHY to switch between low-power and high-speed. Otherwise, if the
timing provided to the DSI host is less than actual required transition timing, the DSI host
may request an LP transition in a period that is shorter than the PHY transition time; which
may cause a video timing violation.
The programmed timing must not be much bigger than the actual required timing by the
PHY, because the DSI host uses this timing for internal calculation.
LP transitions configuration
Configure the low-power transitions in the DSI_VMCR to define the video periods that are
permitted to go to low-power if there is time available to do so.
Table 24 shows the register fields used to program LP settings for each region.
Figure 81 shows the basic LP mode entry flow. If the LP entry is disabled in a region, the
DSI host sends blanking packets instead of entering the LP mode.
If the LP entry is enabled in one region, the DSI host checks if the period length is long
enough to enter and exit LP mode. This is done by comparing the region’s period with the
HS2LP and LP2HS transition timings.
End of HS
transmission
Yes LP region No
enabled
Yes No
Region width >
HS2LP + LP2HS
Send blanking
Go to LP
packet
MSv44688V1
Note: The last line of frame always goes to LP mode, even if LP mode is not enabled for the VFP
region. This is to ensure that the DSI link enters the LP mode at least once per frame.
• LP mode disabled for all regions
The STM32 DSI host ensues that the host goes to LP state at least once per frame.
This happens at the last line of the frame even if no region is configured to go to LP in
DSI_VMCR register (see Figure 85).
LTDC settings
The DSI host relies on the LTDC to stream the pixel data and video control signals. The
LTDC configuration is crucial for the good operation of the DSI host.
• LTDC video timing
The frame’s vertical and horizontal timing values are retrieved from the display
datasheet.
Since the DSI specification recommends entering the LP state at each scanline, the
user may choose an horizontal timing in a way that it allows the DSI link to go to LP
once per scanline (as long as the timing is compliant with the display timing
specification).
Refer to Table 25 for a display timing example.
Vertical timing
VSA 2 2 63 HS
VBP 20 20 255 HS
VFP 18 20 255 HS
Vertical blanking
40 42 1024 HS
period
VACT - 480 - HS
Vertical refresh
- 60 - Hz
rate
Horizontal timing
HSA 1 10 63 PCLK
HBP 3 15 63 PCLK
HFP 4 16 63 PCLK
Horizontal
8 32 128 PCLK
blanking period
HACT 800 PCLK
fPCLK 24 26.36 30.74 MHz
The horizontal timings are chosen to allow an LP transition once per scanline.
– Horizontal timing in pixel clock:
HSA = 5, HBP = 35, HACT = 800, HFP = 35
With these HBP and HFP values, the link goes to LP during both HBP and HFP
periods as explained in Section : PHY transition timing configuration on page 83.
– Vertical timing in lines:
VSA = 2, VBP = 20, VACT = 480, VFP = 20
• LTDC pixel clock setting
The pixel clock is set according to following formula:
pixel_clock = (VSA+VBP+VACT+VFP) x (HSA+HBP+HACT+HFP) x frame rate
Example calculation:
– Horizontal timing in pixel_clock:
HSA = 5, HBP = 35, HACT = 800, HFP = 35
– Vertical timing in lines:
VSA = 2, VBP = 20, VACT = 480, VFP = 20
– Refresh rate = 60 fps.
– pixel_clock = (2+20+480+20) x (5+35+800+35) x 60= 522 x 875 x 60 = 27.4 MHz
Refer to Section 7: DSI host performance for more details on the maximum pixel clock
supported.
The video timing in DSI host must have the same length as in the LTDC. The values in the
LTDC are expressed in pixel_clock cycles and the values programmed in the DSI are
expressed in lane byte clock cycles.
Video timing registers are described in Figure 90.
DSI_VVACR.VA (Line)
DSI_VVBPCR.VBP (Line)
DSI_VVFPCR.VFP (Line)
DSI_VLCR.HLINE (lanebyteclk)
MSv35877V1
The video packet parameters configuration depends on the video mode chosen:
• Burst mode
In burst mode, the VPSIZE must be equal to an entire line length in pixels. So, the
number of chunks can be set to 0 to transmit the video line in a single packet.
After sending the packed pixel stream, the link goes to LP mode to save power. There
is no need for null packet (NPSIZE = 0).
Figure 87 shows a video line in burst mode.
• Nonburst mode
The DSI nonburst mode should be configured in a way that allows matching the DSI
output pixel ratio with the LTDC interface input pixel ratio. This is achieved by dividing a
pixel line (HACT region) into several chunks of pixels and optionally interleaving them
with null packets.
The following equations allow setting the DSI host transmission parameters in nonburst
mode. Both equations allow balancing the time required to output the pixels on DSI
(right side of equation) with time required to input pixels from LTDC (left side of
equation).
– When the null packets are enabled:
Equation 1
lanebyteclkperiod x NUMC (VPSIZE x bytes_per_pixel + 12 + NPSIZE) /
number_of_lanes = pixels_per_line x LTDC_clock_period
– When the null packets are disabled
Equation 2
lanebyteclkperiod x NUMC (VPSIZE x bytes_per_pixel + 6) / number_of_lanes =
pixels_per_line x LTDC_clock_period
Example of configuration with four chunks and without null packets enabled
In order to remove the need for null packets, the DSI and LTDC throughput must be
balanced using equation 2 above.
This example uses a four chunks configuration, and the lane_byte_clk is measured as
follows:
– Lane_byte_clk = pixel_clock x NUMC x (VPSIZE x bytes_per_pixel + 6) /
(pixels_per_line x num_lanes) = 41.24 MHz
Figure 89 shows an active video line with four chunks configuration without null packet,
the DSI link is at 41.2 MHz.
Note: The video packet size (VPSIZE) and consequently the number of chunks (NUMC) have to
be set in concordance with the display’s internal FIFO size. For example, if the internal FIFO
only allows to accommodate 200 pixels, then the number of chunks must be greater than 4
to ensure that VPSIZE is equal to 200 pixels or less.
For LP commands, the DSI host needs an input from the user to determine the appropriate
area in which the command may be transmitted.
• Command transmission mode
Table 28 shows the register bit used to select between HS and LP transmission of
commands in video mode.
If DSI_VMCR.LPE = 1 then the commands are sent in LP mode, otherwise they are sent in
HS mode.
Note: Some displays require initialization commands to be sent in LP mode. In that case, the LP
command transmission must be enabled during the initialization phase.
• LP command packet size
When the LP command transmission is enabled, the user has to inform the DSI host of the
maximum allowed packet size in bytes using the register fields defined in Table 29.
When the DSI host is configured to send the low-power (LP) commands during the HS video
mode transmission(DSI_VMCR.LPCE=1), it is necessary to calculate the time available, in
bytes, to transmit a command in LP mode during the horizontal front porch (HFP), the
vertical sync active (VSA), the vertical back porch (VBP), and the vertical front porch (VFP)
regions.
– LPSIZE: largest packet size out of VACT region
This field is used for the transmission of commands in LP mode. It defines the
size, in bytes, of the largest packet that can fit in a line during VSA, VBP and VFP
regions.
– VLPSIZE: largest packet size in VACT region
This field is used for the transmission of commands in LP mode. It defines the
size, in bytes, of the largest packet that can fit in a line during the HFP of the VACT
region.
Note: It is important to correctly configure LPSIZE and VLPSIZE. If LPSIZE and VLPSIZE are
higher than actual available time, it may cause a video timing violation. In the other hand, if
LPSIZE and VLPSIZE are much lower than the available timing, many commands are
delayed to the last line of the frame.
Note: It is recommended to avoid sending lines on the last line of the frame. If large commands
have to be sent, the user may disable the DSI video mode and send the command in DSI
command mode, then reenable the video mode.
LPSIZE calculation
Figure 90 shows LPSIZE calculation for video nonburst mode with sync pulses.
command
EscEntry
2 tESCCLK
EscExit
LPDT
HSS
HSE
MSv35870V1
Figure 91 shows LPSIZE calculation for video burst mode and video nonburst mode with
sync events.
2 tESCCLK
EscExit
LPDT
HSS
MSv35871V1
Where
tL = line time = (HSA + HBP + HACT + HFP) / PCLK;
tH1
Nonburst mode with sync pulses:
tH1= time of the HSA pulse = tHSA = HSA / PCLK
Burst mode or nonburst mode with sync events:
tH1= time to send the HSS packet = 4 bytes / (lane_byte_clk x Number_Lanes)
tHS->LP = time to enter the low-power mode;
tLP->HS = time to leave the low-power mode;
tLPDT = D-PHY timing related with escape mode escape, LPDT command, and
escape exit. According to the D-PHY specification, this value is always 11 bits in LP (or
22 TX escape clock cycles);
tESCCLK = escape clock period= DSI_CCR.TXECKDIV /lane_byteclk
2 tESCCLK = delay imposed by the DSI host implementation.
Example calculation:
tL = (5 + 35 + 800 + 35) / 27.429 MHz = 31.9 us
tH1
Nonburst mode with sync pulses:
tH1=tHSA =5/27,429 MHz=0,182us
Burst mode or nonburst mode with sync events:
tH1 = 4 / (62.5 x 2) = 0.032 us
tHS->LP = 291 ns (this is D-PHY specific timing)
tLP->HS = 264 ns (this is PHY specific timing)
tESCCLK = 4 / 62.5 = 0.064 ns
tLPDT = 22 x tESCCLK = 1.408
LPSIZE in burst and nonburst with sync events modes:
LPSIZE = (31.9 - (0.032 + 0.291 + 0.264 + 1.408 + 0.128)) / (2 x 8 x 0.064) = 29.07
LPSIZE in nonburst with sync pulses mode:
LPSIZE = (31.9 - (0.182 + 0.291 + 0.264 + 1.408 + 0.128)) / (2 x 8 x 0.064) = 28.93
In order to have some margin, the LPSIZE to be programmed is 28 bytes in both cases.
Figure 92 shows a 28-bytes command sent in LP mode during a blanking region. The
command fits into the blanking period without causing a time line violation.
Figure 93 shows a 29-bytes command which does not fit into active or blanking regions. In
this case, the DSI host postpones the command to the last line of the frame.
VLPSIZE calculation
Figure 94 shows VLPSIZE calculation for video nonburst mode with sync pulses.
2 tESCCLK
EscExit
LPDT
HSS
HSE
HACT with
HSA HBP HSÆLP invact_lpcmd_time LPÆHS
Blanking Non-Burst
MSv35872V1
Figure 95 shows VLPSIZE calculation for video nonburst mode with sync events.
command
EscEntry
2 tESCCLK
EscExit
LPDT
HSS
HACT with
HSA HBP HSÆLP invact_lpcmd_time LPÆHS
Blanking Non-Burst
MSv35890V1
command
EscEntry
2 tESCCLK
EscExit
LPDT
HSS
MSv35873V1
Where
tL = line time = (HSA + HBP + HACT + HFP) / PCLK;
tHSA = time of the HSA pulse = HSA / PCLK;
tHBP = time of horizontal back porch= HBP / PCLK;
tHACT = time of video active.
Nonburst mode: pixels_per_line / PCLK
Burst mode: the video active is time compressed and is calculated as
tHACT = (VPSIZE x Bytes_per_Pixel) / (Number_Lanes x tLane_byte_clk);
tESCCLK = escape clock period= DSI_CCR.TXECKDIV / lane_byteclk
Example calculation:
tL = line time = (5 + 35 + 800 + 35) / 27.4 MHz = 31.9 us
tHSA = 5 / 27.4 MHz = 0.182 us
tHBP = 35 / 27.4 MHz = 1.27 us
tHACT
Nonburst mode:
tHACT =800 / 27.4 MHz = 29.16 us
Burst mode:
tHACT = (800 x 3) / (2 x 62.5 MHz) = 19.2 us
VLPSIZE in burst mode
VLPSIZE = (31.9 - (0.182 + 1.27 + 19.2 + 0.291 + 0.264 + 1.408 + 0.128)) /
(2 x 8 x 0. 064) = 8.94
Note: The user may take 10% margin on the allowed number of bytes (LPSIZE and VLPSIZE) to
avoid video timing issues.
Frame acknowledge
In order to ensure that the frame has been correctly received by the display, the DSI host
may ask for frame acknowledge.
Table 30 shows the register bit used to enable frame acknowledge in video mode.
During the last line of the frame, the host performs a BTA procedure. Then, the display takes
control of the bus and sends an acknowledge trigger if all previous packets have been
received with no errors. This means that the frame has been correctly received by the
display. After that the display performs a BTA sequence to give back bus control to the DSI
host. If the display has encountered errors from the previous packets it responds with an
error report.
Note: It is mandatory to set DSI_PCR.BTAE to 1 in order to enable the bus turnaround (BTA)
request.
Figure 98 and Figure 99 shows an example of frame acknowledge trigger in video mode.
Select the adapted command mode in the DSI Wrapper configuration register
(DSI_WCFGR.DSIM=1).
Select the command mode in the DSI host mode configuration register
(DSI_MCR.CMDM=1).
The SW_TIME is mandatory for the transmitter D-PHY to guarantee that all data lanes are
in stop state before a new HS transmission is initiated.
A display may also require a specific time before receiving a new HS transmission. This
must be checked in the display’s datasheet.
The programmed value must be the maximum between host SW_Time and display
SW_TIME.
Note: The minimum SW_Time for the DSI host is 10 lanebyteclk command mode.
The DSI host pixel FIFO size is 960 32-bit words. This implies that:
• In 24 bpp mode this field shall not exceed 1280 pixels.
• In 16 bpp mode this field shall not exceed 1920 pixels.
LTDC can be halted either on falling or rising edge of VSYNC. The edge polarity must be
consistent with the VSYNC polarity of the LTDC interface: if DSI_LPCR.VSP is active high,
then LTDC must be halted on rising edge. If DSI_LPCR.VSP is active low, then LTDC must
be halted on falling edge.
TE source DSI_WCFGR.TESRC
TE polarity DSI_WCFGR.TEPOL
Tearing effect acknowledge request enable DSI_CMCR.TEARE
Refresh mode
The DSI host supports two modes to start the display refresh operation. Table 35 shows the
register field used to choose the refresh mode.
The automatic refresh (AR) bit of the DSI Wrapper configuration register (DSI_WCFGR) is
set if the display needs to be updated automatically each time that a tearing effect event is
received.
• Automatic refresh: the DSI_WCR.LTDCEN is set automatically after receiving a TE
event.
• Manual refresh: it is the software responsibility to refresh GRAM by setting
DSI_WCR.LTDCEN bit after reception of TE event.
LTDC settings
In adapted command mode, the DSI host inputs the pixel stream from the LTDC. The LTDC
pixel rate and video timing have a specific configuration when DSI operates in adapted
command mode.
• LTDC pixel clock setting
The pixel clock frequency does not need to match the display pixel clock since the relies on
its internal controller for timing information generation.
In adapted command, the LTDC pixel clock has to be selected to ensure following
requirements:
– Minimum pixel clock must be fast enough in order to ensure that GRAM refresh
time is shorter than display internal refresh rate to avoid visual artifacts.
– Maximum pixel clock must be consistent with system constraints to avoid FIFO
under-run issues on LTDC side.
Refer to Section 7: DSI host performance for more details on the pixel clock minimum and
maximum values in adapted command mode.
• LTDC video timing
Since the display does not rely on the host for timing information, it is possible to set all the
vertical and horizontal blanking periods (HSA, HBP, HFP, VSA, VBP, VFP) to the minimum
that is 1, but the user must set HACT and VACT correctly with line length and number of
lines per frame respectively.
Note: Some displays require initialization commands to be sent in LP mode. In this case, the
commands used for display initialization must be configured in LP mode during the
initialization phase.
After initialization phase, commands may be reconfigured to be sent in high-speed mode.
This is important especially for DCS long write commands that are used to accommodate
the WMS and WMC DCS commands used during the display refresh.
Acknowledge request
The DSI host may request an acknowledge after each sent command. This is enabled by
setting DSI_ CMCR.ARE bit (see Table 38).
When this feature is enabled, DSI host starts a BTA procedure after each command sent.
The display takes control of the bus and responds with an acknowledge trigger or an error
report in case of errors.
Then the display sends a BTA to give back bus control to the DSI host.
Note: This feature should be avoided in case of adapted command mode during refresh operation,
since it adds a lot of overhead, slowing the display refresh time.
This feature can be useful in order to have a safer system and detect errors as soon as
possible. So, its utilization depends on the application needs.
Figure 100 shows an example of write command with acknowledge request enabled.
The STM32CubeMX tool can be used to configure the DSI host peripheral. This section
shows basic configuration steps required to configure the DSI host in different operating
modes: video burst mode, video nonburst mode with sync pulses and adapted command
mode. This section also provides software code examples to configure both LTDC and DSI
host in different operating modes. For more complete examples, the user may refer to the
STM32Cube examples. The examples have been generated for the STM32F769I-Discovery
board.
Since the DSI host uses the LTDC as video streamer, the LTDC configuration is mandatory.
These examples show a very basic configuration of the LTDC. More information on LTDC
configuration is available in application note AN4861.
Note: The DSI host uses dedicated pins, there is no alternate function configuration required.
Figure 104. LTDC pixel clock configuration in video mode using PLLSAI1
Figure 105. DSI clocks configuration in video mode using DSI PLL
The escape mode clock prescaler value must be selected to generate the escape clock
used during the TX LP transmission. This clock must not exceed 20 MHz.
Note: The TX prescaler must be set to a value higher than 2. A prescaler value 0 or 1 disables the
generation of the TX escape clock.
Vertical and horizontal video timings: the user enters the display timing and STM32CubeMX
automatically generates the corresponding values to be programmed inside the LTDC
registers.
Video signal polarity: these signals are fed to the DSI host. The user has to enter polarity for
LTDC and then STM32CubeMX ensures that the corresponding polarity is automatically set
inside the DSI.
It is recommended to keep the default LTDC signal polarity (all signals active low).
• LTDC layer settings
Figure 107 shows LTDC layer settings. Only one layer is used in this example.
Window position definition: this example uses an image with 320 pixels width and 240 lines
height, and the rest of the screen is filled with a layer default color. The window position is
chosen so that image is displayed in the center of the screen.
Pixel parameters setting: pixel parameters must be set according to the source image color
format. ARGB8888 is the color format of the image used in this example.
Blending parameters setting: this example uses only one layer with 255 constant Alpha
parameter for blending.
– Color coding selection: this allows choosing the color format of the DSI packets
transmitted over the link. This setting is independent from the LTDC layer color
format of the image source. The image source can have 565 color format and the
DSI host set to 24-bit color format.
In this example, the pixel streams are sent using packed pixel streams in 24-bit
format.
– Video mode configuration:
Select video burst mode.
Set video packet size: in burst mode video packet size is set to a full video line
length in pixels.
Enable frame BTA acknowledge if needed. This is not used in this example.
– Frame vertical and horizontal timing are retrieved from the LTDC configuration.
Values are automatically calculated by STM32CubeMX based on the LTDC video
settings, lane byte clock and LTDC pixel clock.
– The LP transitions must be enabled for all regions. The DSI host automatically
checks if a transition is possible based on the region’s length and the PHY
transition. The user can disable the LP transition in specific regions if needed but
this is not recommended.
/*Global initialization*/
static void MX_DSIHOST_DSI_Init(void){
hdsi.Instance = DSI;
hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE;
hdsi.Init.TXEscapeCkdiv = 4;
hdsi.Init.NumberOfLanes = DSI_TWO_DATA_LANES;
/*DSI PLL configuration for 500mbps per lane rate. Lane_byte_clock is at
62,5 Mhz*/
PLLInit.PLLNDIV = 20;
PLLInit.PLLIDF = DSI_PLL_IN_DIV1;
PLLInit.PLLODF = DSI_PLL_OUT_DIV1;
Error_Handler();
}
/*LTDC initialization*/
LTDC_LayerCfgTypeDef pLayerCfg;
hltdc.Instance = LTDC;
/*LTDC signal polarity*/
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
/*Video timing configuration according to display timing*/
hltdc.Init.HorizontalSync = 4;
hltdc.Init.VerticalSync = 1;
hltdc.Init.AccumulatedHBP = 39;
hltdc.Init.AccumulatedVBP = 21;
hltdc.Init.AccumulatedActiveW = 839;
hltdc.Init.AccumulatedActiveH = 501;
hltdc.Init.TotalWidth = 874;
hltdc.Init.TotalHeigh = 521;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.Backcolor.Green = 255;
pLayerCfg.Backcolor.Red = 255;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
In nonburst mode there is less margin during the VACT region for command transmission
compared to the video burst mode.
In this example no commands are allowed to be transmitted during this period, so LP largest
packet during VACT must be set to 0.
Please refer toCommand transmission in video mode for more details.
Video mode selection: select the nonburst with sync pulse in this example.
Video packet size: this has to be set according to available line buffer size inside the display.
In this example the video packet size is set to 200 pixels.
Number of chunks is automatically calculated based on: active width configured in LTDC
and packet size (number of chunks = active width / video packet size).
Null packet size: size of the null packet in bytes have to be calculated. 299 bytes are needed
in this example. Please refer to Section : DSI video packet parameters for more details on
calculation.
Note: If tearing effect reporting over the pin is required, “Adapted Command Mode with TE pin”
must be selected. This configures the pin to be used for TE.
The configuration of the LTDC parameters is the same as in video mode, except for video
blanking timing (see Figure 116).
In an adapted command, the horizontal blanking timing can be set to the minimum that is
one pixel clock and the vertical blanking timing may be set to the minimum that is one line.
This is because the display relies on its internal display controller for video timing
generation.
Figure 117. Data and clock lanes configuration in adapted command mode
Number of data lanes selection: two data lanes are used in this example.
If tearing effect reporting over link is required, the user must enable:
– Bus turnaround request
– Tearing effect acknowledge request
This example does not use the tearing effect reporting.
/* Enable DCACHE */
SCB_EnableDCache();
/* MCU configuration */
HAL_DSI_Start(&hdsi_eval);
/* Manual refresh. This enables LTDCEN bit in the DSI Wrapper Control
register */
HAL_DSI_Refresh(&hdsi);
/* USER CODE END 2 */
/*Global initialization*/
hdsi.Instance = DSI;
hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE;
hdsi.Init.TXEscapeCkdiv = 4;
hdsi.Init.NumberOfLanes = DSI_TWO_DATA_LANES;
/*DSI PLL configuration. This sets link rate at 500 mbps. Lane_byte_clock is
at 62,5 Mhz*/
PLLInit.PLLNDIV = 20;
PLLInit.PLLIDF = DSI_PLL_IN_DIV1;
PLLInit.PLLODF = DSI_PLL_OUT_DIV1;
if (HAL_DSI_Init(&hdsi, &PLLInit) != HAL_OK)
{
Error_Handler();
}
CmdCfg.VirtualChannelID = 0;
/*Select DSI host color format*/
CmdCfg.ColorCoding = DSI_RGB888;
CmdCfg.CommandSize = 800;
CmdCfg.TearingEffectSource = DSI_TE_DSILINK;
CmdCfg.TearingEffectPolarity = DSI_TE_RISING_EDGE;
/* DSI host Signal polarity. Same polarity between LTDC and DSI except for
Data Enable which has opposite polarity*/
CmdCfg.HSPolarity = DSI_HSYNC_ACTIVE_LOW;
CmdCfg.VSPolarity = DSI_VSYNC_ACTIVE_LOW;
CmdCfg.DEPolarity = DSI_DATA_ENABLE_ACTIVE_HIGH;
CmdCfg.VSYNCPol = DSI_VSYNC_FALLING;
/*Manual refresh is used*/
CmdCfg.AutomaticRefresh = DSI_AR_DISABLE;
CmdCfg.TEAcknowledgeRequest = DSI_TE_ACKNOWLEDGE_DISABLE;
if (HAL_DSI_ConfigAdaptedCommandMode(&hdsi, &CmdCfg) != HAL_OK)
{
Error_Handler();
}
/*LTDC configuration*/
hltdc.Instance = LTDC;
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
/*Video timing configuration. Vertical and horizontal blanking can be set
to 1 in adapted command mode.*/
hltdc.Init.HorizontalSync = 0;
hltdc.Init.VerticalSync = 0;
hltdc.Init.AccumulatedHBP = 1;
hltdc.Init.AccumulatedVBP = 1;
hltdc.Init.AccumulatedActiveW = 801;
hltdc.Init.AccumulatedActiveH = 481;
hltdc.Init.TotalWidth = 802;
hltdc.Init.TotalHeigh = 482;
/*Background color configuration*/
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
/*LTDC Layer configuration is same as video burst mode example.*/
The DSI host performance is impacted by the physical limit of DSI link bandwidth and by
system level constraints.
STM32F76xxx and
2 500 Mbit/s 1 Gbit/s
STM32F77xxx
STM324Rxxx and
2 500 Mbit/s 1 Gbit/s
STM32L4Sxxx
STM32H747/757 2 1 Gbit/s 2 Gbit/s
STM32MP157 2 1 Gbit/s 2 Gbit/s
STM32U599/5A9
2 500 Mbit/s 1 Gbit/s
STM32U595/5A5
There is a relationship between the equivalent pixel clock and the DSI host configuration.
Depending on the DSI color coding, the number of data lanes used and the speed of the
data lane, it is possible to evaluate the equivalent pixel clock as follows:
( Lane_rate × number_of_lanes )
Pixel clock = --------------------------------------------------------------------------------------------
Bits_per_pixel
As an example, when using two data lanes at 500 Mbit/s for a total data rate of 1 Gbit/s:
• 16 bits per pixel coding:
Maximum equivalent pixel clock is 1 Gb/s / 16 bpp = 62,5 MHz
• 24 bits per pixel coding:
Maximum equivalent pixel clock is 1 Gb/s / 24 bpp = 41,66 MHz
For products supporting 1Gbit/s per lane rate for a total data rate of 2Gbit/s:
• 16 bits per pixel coding:
Maximum equivalent pixel clock is 2 Gb/s / 16 bpp = 125 MHz
• 24 bits per pixel coding:
Maximum equivalent pixel clock is 2 Gb/s / 24 bpp = 83.33 MHz
Table 40 shows the maximum pixel clock frequency depending on the color coding and the
DSI link speed.
Table 40. Maximum pixel clock frequency depending on color coding and DSI link
speed
500 Mbit/s 1 Gbit/s 2 Gbit/s
Note: The link BW shown above gives just an estimate of the minimum required BW and number
of lanes to be used. The video mode type (burst versus nonburst) and protocol overhead
have an impact on the link BW to be chosen.
In burst mode the DSI link BW can be increased. This ensures that the DSI host sends the
pixel data fast enough to go to LP mode for long periods.
In nonburst mode, the DSI link BW calculation must be fine-tuned to consider the protocol
overhead as shown in equation 1 and 2 of sectionSection : DSI video packet parameters on
page 93.
Note that in both cases, even if the DSI BW is increased, the LTDC pixel clock must keep
the same value as the one calculated from the display video timing.
Note: While increasing the DSI link speed, the pixel clock has also to be increased.
The LTDC pixel clock in this example is increased to 500 / 16 = 31.25 MHz, but user has to
pay attention to the system constraints to avoid FIFO under-run issues on LTDC side.
The maximum link speed to guarantee the minimum refresh time has to be evaluated
according to:
• Maximum DSI link physical limit (refer to Section 7.1: DSI link maximum bandwidth
impact on LTDC pixel clock).
• System constraints impact on LTDC pixel clock (refer to Section : There is a
relationship between the equivalent pixel clock and the DSI host configuration.).
This section shows some use case examples for display driving using the DSI host. The DSI
host operating mode is chosen according to the display characteristics. The link bandwidth
and frame buffer size requirements have been presented Section 7: DSI host performance .
Ctrl
CLK
D0 GRAM
CLK
FMC D0
D1
MSv45215V1
9 Supported devices
The STM32 DSI host supports all the operating modes defined in the MIPI DSI specification.
It supports command mode and all the video mode variants (burst, nonburst with sync
pulses and nonburst with sync events).
It supports up to 1 Gbit/s or 2 Gbit/s link speed depending on the product.
It can be interfaced with any DSI-compliant display.
10 Conclusion
The new STM32 MCUs and MPUs with DSI host represent the most effective way to
connect to a display thanks to the low pin-count and low-power features of the DSI protocol.
This application note presented the STM32 DSI host capabilities and features that allow to
interface with a wide range of displays.
The STM32 DSI host scalable architecture and various operating modes that offer flexibility
to the customer had been presented.
The DSI host adapted command mode is the most appropriate way to interface with a
display thanks to its one-shot refresh capability and its low-power consumption, but it comes
at a higher cost on the display side that requires a full frame buffer GRAM.
For displays that do not embed a controller and a GRAM, the best option is the video
nonburst mode since it is the most power efficient among video modes. But it requires to
store a video line on the display side.
For low cost displays that do not include GRAM and line buffer, the STM32 DSI host
supports the nonburst mode to interface with this kind of displays.
A step by step configuration using STM32CubeMX has been presented and sample codes
have been provided to allow users to start quickly an application’s development.
11 Revision history
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgment.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of purchasers’ products.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, refer to www.st.com/trademarks. All other product
or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.