Skip to main content
AlexVetoshko
Associate
April 29, 2021
Question

STM32H747 MIPI DSI intreface problem (no signal on DSI data lines in LP command mode)

  • April 29, 2021
  • 3 replies
  • 3853 views

Hello!

I have problem with initialization MIPI DSI interface on STM32H747. I use this interface for connect round LCD display with the St7797 display controller. But the problem is that when sending a sequence of LP commands to initialize the display, there is no data on the D0P and D0N lines. In this case, the signal is constantly present on the CLK lines.

I am attaching a test project with settings. Tell me where the problem might be?

UPDATE: If use LTDC controller, video data present on data line.

But there is nothing on the data lines when sending init commands to display.

I am attaching a test CubeIDE project with interface initialization.

Regards, Alex

3 replies

Ons KOOLI
Associate
April 29, 2021

Hi @AlexVetoshko​ ,

Please refer to the STM32CubeH7 LCD_DSI example under the following location: Projects\STM32H747I-DISCO\Examples

Best Regards,

Ons.

AlexVetoshko
Associate
May 1, 2021

Hello!

Yes, I looked at this example. In this example, commands are transmitted normally. But there the DSI module is used in a different mode (Adaptive Command Mode). My display requires video mode. And in this mode, I cannot send LP commands for initialization (I do not see any signals on the data line). Because of this, I can not initialize the display controller. In this case, the video data (when the LTDС module is turned on) is normal. What is the problem?

Can you help me?

I am attaching the code with the initialization of the DSI module:

static void MX_DSIHOST_DSI_Init(void)

{

 DSI_PLLInitTypeDef PLLInit = {0};

 DSI_HOST_TimeoutTypeDef HostTimeouts = {0};

 DSI_PHY_TimerTypeDef PhyTimings = {0};

 DSI_VidCfgTypeDef VidCfg = {0};

 /* USER CODE BEGIN DSIHOST_Init 1 */

 /* USER CODE END DSIHOST_Init 1 */

 hdsi.Instance = DSI;

 hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_ENABLE;

 hdsi.Init.TXEscapeCkdiv = 2;

 hdsi.Init.NumberOfLanes = DSI_ONE_DATA_LANE;

 PLLInit.PLLNDIV = 10;

 PLLInit.PLLIDF = DSI_PLL_IN_DIV1;

 PLLInit.PLLODF = DSI_PLL_OUT_DIV1;

 if (HAL_DSI_Init(&hdsi, &PLLInit) != HAL_OK)

 {

   Error_Handler();

 }

 HostTimeouts.TimeoutCkdiv = 1;

 HostTimeouts.HighSpeedTransmissionTimeout = 0;

 HostTimeouts.LowPowerReceptionTimeout = 0;

 HostTimeouts.HighSpeedReadTimeout = 0;

 HostTimeouts.LowPowerReadTimeout = 0;

 HostTimeouts.HighSpeedWriteTimeout = 0;

 HostTimeouts.HighSpeedWritePrespMode = DSI_HS_PM_DISABLE;

 HostTimeouts.LowPowerWriteTimeout = 0;

 HostTimeouts.BTATimeout = 0;

 if (HAL_DSI_ConfigHostTimeouts(&hdsi, &HostTimeouts) != HAL_OK)

 {

   Error_Handler();

 }

 PhyTimings.ClockLaneHS2LPTime = 20;

 PhyTimings.ClockLaneLP2HSTime = 18;

 PhyTimings.DataLaneHS2LPTime = 10;

 PhyTimings.DataLaneLP2HSTime = 13;

 PhyTimings.DataLaneMaxReadTime = 0;

 PhyTimings.StopWaitTime = 0;

 if (HAL_DSI_ConfigPhyTimer(&hdsi, &PhyTimings) != HAL_OK)

 {

   Error_Handler();

 }

 if (HAL_DSI_ConfigFlowControl(&hdsi, DSI_FLOW_CONTROL_BTA) != HAL_OK)

 {

   Error_Handler();

 }

 if (HAL_DSI_SetLowPowerRXFilter(&hdsi, 10000) != HAL_OK)

 {

   Error_Handler();

 }

 if (HAL_DSI_ConfigErrorMonitor(&hdsi, HAL_DSI_ERROR_NONE) != HAL_OK) // HAL_DSI_ERROR_NONE

 {

   Error_Handler();

 }

 LPCmd.LPGenShortWriteNoP = DSI_LP_GSW0P_ENABLE;

 LPCmd.LPGenShortWriteOneP = DSI_LP_GSW1P_ENABLE;

 LPCmd.LPGenShortWriteTwoP = DSI_LP_GSW2P_ENABLE;

 LPCmd.LPGenShortReadNoP = DSI_LP_GSR0P_ENABLE;

 LPCmd.LPGenShortReadOneP = DSI_LP_GSR1P_ENABLE;

 LPCmd.LPGenShortReadTwoP = DSI_LP_GSR2P_ENABLE;

 LPCmd.LPGenLongWrite = DSI_LP_GLW_ENABLE;

 LPCmd.LPDcsShortWriteNoP = DSI_LP_DSW0P_ENABLE;

 LPCmd.LPDcsShortWriteOneP = DSI_LP_DSW1P_ENABLE;

 LPCmd.LPDcsShortReadNoP = DSI_LP_DSR0P_ENABLE;

 LPCmd.LPDcsLongWrite = DSI_LP_DLW_ENABLE;

 LPCmd.LPMaxReadPacket = DSI_LP_MRDP_ENABLE;

 LPCmd.AcknowledgeRequest = DSI_ACKNOWLEDGE_ENABLE;

 if (HAL_DSI_ConfigCommand(&hdsi, &LPCmd) != HAL_OK)

 {

   Error_Handler();

 }

 /*Video Mode initialization*/

 VidCfg.VirtualChannelID = 0;

 /*DSI Host Color format configuration. The image data is transmitted using Packed Pixel Stream with 24 bit format.*/

 VidCfg.ColorCoding = DSI_RGB888;

 VidCfg.LooselyPacked = DSI_LOOSELY_PACKED_DISABLE;

 /*Video mode configuration*/

 VidCfg.Mode = DSI_VID_MODE_BURST;

 /*Video packet configuration*/

 VidCfg.PacketSize = 400;

 VidCfg.NumberOfChunks = 0;

 VidCfg.NullPacketSize = 0;

 /*Signal polarity configuration. Same polarity between LTDC and DSI except for Data Enable which has opposite polarity */

 VidCfg.HSPolarity = DSI_HSYNC_ACTIVE_LOW;//correct

 VidCfg.VSPolarity = DSI_VSYNC_ACTIVE_LOW;//correct

 VidCfg.DEPolarity = DSI_DATA_ENABLE_ACTIVE_HIGH;//correct

 /*Video timing configuration. Retrieved from LTDC config*/

 VidCfg.HorizontalSyncActive = HSYNC * LBCLK_PCLK_MULT; //lane byte clock cycles

 VidCfg.HorizontalBackPorch = HBP * LBCLK_PCLK_MULT; //lane byte clock cycles

 VidCfg.HorizontalLine = (HSYNC + HBP + HACT + HFP) * LBCLK_PCLK_MULT; //lane byte clock cycles

 VidCfg.VerticalSyncActive = VSYNC;

 VidCfg.VerticalBackPorch = VBP;

 VidCfg.VerticalFrontPorch = VFP;

 VidCfg.VerticalActive = VACT;

 /*Command transmission mode and Max LP packet size*/

 VidCfg.LPCommandEnable = DSI_LP_COMMAND_ENABLE;

 VidCfg.LPLargestPacketSize = 29;

 VidCfg.LPVACTLargestPacketSize = 8;

 /*LP transition configuration. It is recommended to enable LP transition in all regions*/

 VidCfg.LPHorizontalFrontPorchEnable = DSI_LP_HFP_ENABLE;

 VidCfg.LPHorizontalBackPorchEnable = DSI_LP_HBP_ENABLE;

 VidCfg.LPVerticalActiveEnable = DSI_LP_VACT_ENABLE;

 VidCfg.LPVerticalFrontPorchEnable = DSI_LP_VFP_ENABLE;

 VidCfg.LPVerticalBackPorchEnable = DSI_LP_VBP_ENABLE;

 VidCfg.LPVerticalSyncActiveEnable = DSI_LP_VSYNC_ENABLE;/*Flow control configuration*/

 VidCfg.FrameBTAAcknowledgeEnable = DSI_FBTAA_ENABLE;//needed for commands in video mode

 if (HAL_DSI_ConfigVideoMode(&hdsi, &VidCfg) != HAL_OK)

 {

   Error_Handler();

 }

 if (HAL_DSI_SetGenericVCID(&hdsi, 0) != HAL_OK)

 {

   Error_Handler();

 }

 __HAL_LTDC_DISABLE(&hltdc);

 HAL_DSI_Start(&(hdsi));

 LOG_INFO("Start display init\r\n");

 LCD_Reset();

 HAL_Delay(120);

 St7797_Init_sequence();

      LOG_INFO("Disable command mode \r\n");

      LPCmd.LPGenShortWriteNoP = DSI_LP_GSW0P_DISABLE;

      LPCmd.LPGenShortWriteOneP = DSI_LP_GSW1P_DISABLE;

      LPCmd.LPGenShortWriteTwoP = DSI_LP_GSW2P_DISABLE;

      LPCmd.LPGenShortReadNoP = DSI_LP_GSR0P_DISABLE;

      LPCmd.LPGenShortReadOneP = DSI_LP_GSR1P_DISABLE;

      LPCmd.LPGenShortReadTwoP = DSI_LP_GSR2P_DISABLE;

      LPCmd.LPGenLongWrite = DSI_LP_GLW_DISABLE;

      LPCmd.LPDcsShortWriteNoP = DSI_LP_DSW0P_DISABLE;

      LPCmd.LPDcsShortWriteOneP = DSI_LP_DSW1P_DISABLE;

      LPCmd.LPDcsShortReadNoP = DSI_LP_DSR0P_DISABLE;

      LPCmd.LPDcsLongWrite = DSI_LP_DLW_DISABLE;

      LPCmd.LPMaxReadPacket = DSI_LP_MRDP_DISABLE;

      LPCmd.AcknowledgeRequest = DSI_ACKNOWLEDGE_DISABLE;

      if (HAL_DSI_ConfigCommand(&hdsi, &LPCmd) != HAL_OK)

      {

          Error_Handler();

      }

 /* USER CODE BEGIN DSIHOST_Init 2 */

 /* USER CODE END DSIHOST_Init 2 */

}

wrfrf.1
Associate
May 26, 2021

Hi Ons KOOLI (ST Employee)

Can you help us?

We really need to know, it's very critical on this moment for us. 

Ons KOOLI
Associate
May 27, 2021

Hi @wrfrf.1​ ,

I am rising your claim internally to get help from specific dev team.

Best Regards,

Ons.