cancel
Showing results for 
Search instead for 
Did you mean: 

DSI display interface doesn't work

PZamb.2
Associate III

Hi

I'm development a board with STM32F779a cpu connect with dsi display.

I create the graphic wit TouchFX tools and included in the STM32cube ide design software.

How example I see STM32f769i-disco demo, and received the init code of display by producer.

My problem is that the DSI Host not run, no signal appare , I'm monitoring with oscilloscopie.

What may be the problem ?

int main(void)

{

 /* USER CODE BEGIN 1 */

 /* USER CODE END 1 */

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

 HAL_Init();

 /* USER CODE BEGIN Init */

 /* USER CODE END Init */

 /* Configure the system clock */

 SystemClock_Config();

 /* USER CODE BEGIN SysInit */

 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */

 MX_GPIO_Init();

 MX_LTDC_Init();

 MX_CRC_Init();

 MX_DSIHOST_DSI_Init();

 MX_FMC_Init();

 MX_QUADSPI_Init();

 MX_DMA2D_Init();

 MX_TouchGFX_Init();

 /* Call PreOsInit function */

 MX_TouchGFX_PreOSInit();

 /* USER CODE BEGIN 2 */

 /* USER CODE END 2 */

 /* Init scheduler */

 osKernelInitialize();

 /* USER CODE BEGIN RTOS_MUTEX */

 /* add mutexes, ... */

 /* USER CODE END RTOS_MUTEX */

 /* USER CODE BEGIN RTOS_SEMAPHORES */

 /* add semaphores, ... */

 /* USER CODE END RTOS_SEMAPHORES */

 /* USER CODE BEGIN RTOS_TIMERS */

 /* start timers, add new ones, ... */

 /* USER CODE END RTOS_TIMERS */

 /* USER CODE BEGIN RTOS_QUEUES */

 /* add queues, ... */

 /* USER CODE END RTOS_QUEUES */

 /* Create the thread(s) */

 /* creation of defaultTask */

 defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);

 /* USER CODE BEGIN RTOS_THREADS */

 /* add threads, ... */

 /* USER CODE END RTOS_THREADS */

 /* USER CODE BEGIN RTOS_EVENTS */

 /* add events, ... */

 /* USER CODE END RTOS_EVENTS */

 /* Start scheduler */

 osKernelStart();

 /* We should never get here as control is now taken by the scheduler */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

   /* USER CODE END WHILE */

   /* USER CODE BEGIN 3 */

 }

13 REPLIES 13
PZamb.2
Associate III

static void MX_DSIHOST_DSI_Init(void)

{

 /* USER CODE BEGIN DSIHOST_Init 0 */

   // Reset DSI Display

   HAL_GPIO_WritePin(DSI_reset_GPIO_Port, DSI_reset_Pin, GPIO_PIN_RESET);

   HAL_Delay(20);

   HAL_GPIO_WritePin(DSI_reset_GPIO_Port, DSI_reset_Pin, GPIO_PIN_SET);

   HAL_Delay(20);

 /* USER CODE END DSIHOST_Init 0 */

 DSI_PLLInitTypeDef PLLInit = {0};

 DSI_HOST_TimeoutTypeDef HostTimeouts = {0};

 DSI_PHY_TimerTypeDef PhyTimings = {0};

 DSI_LPCmdTypeDef LPCmd = {0};

 DSI_CmdCfgTypeDef CmdCfg = {0};

 /* USER CODE BEGIN DSIHOST_Init 1 */

 /* USER CODE END DSIHOST_Init 1 */

 hdsi.Instance = DSI;

 hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE;

 hdsi.Init.TXEscapeCkdiv = 3;

 hdsi.Init.NumberOfLanes = DSI_TWO_DATA_LANES;

 PLLInit.PLLNDIV = 103;

 PLLInit.PLLIDF = DSI_PLL_IN_DIV7;

 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 = 24;

 PhyTimings.ClockLaneLP2HSTime = 25;

 PhyTimings.DataLaneHS2LPTime = 13;

 PhyTimings.DataLaneLP2HSTime = 18;

 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)

 {

   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();

 }

 CmdCfg.VirtualChannelID = 0;

 CmdCfg.ColorCoding = DSI_RGB565;

 CmdCfg.CommandSize = 200;

 CmdCfg.TearingEffectSource = DSI_TE_EXTERNAL;

 CmdCfg.TearingEffectPolarity = DSI_TE_RISING_EDGE;

 CmdCfg.HSPolarity = DSI_HSYNC_ACTIVE_LOW;

 CmdCfg.VSPolarity = DSI_VSYNC_ACTIVE_LOW;

 CmdCfg.DEPolarity = DSI_DATA_ENABLE_ACTIVE_HIGH;

 CmdCfg.VSyncPol = DSI_VSYNC_FALLING;

 CmdCfg.AutomaticRefresh = DSI_AR_DISABLE;

 CmdCfg.TEAcknowledgeRequest = DSI_TE_ACKNOWLEDGE_ENABLE;

 if (HAL_DSI_ConfigAdaptedCommandMode(&hdsi, &CmdCfg) != HAL_OK)

 {

   Error_Handler();

 }

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

 {

   Error_Handler();

 }

 /* USER CODE BEGIN DSIHOST_Init 2 */

 /* USER CODE END DSIHOST_Init 2 */

}

/**

 * @brief LTDC Initialization Function

 * @param None

 * @retval None

 */

static void MX_LTDC_Init(void)

{

 /* USER CODE BEGIN LTDC_Init 0 */

 /* USER CODE END LTDC_Init 0 */

 LTDC_LayerCfgTypeDef pLayerCfg = {0};

 /* USER CODE BEGIN LTDC_Init 1 */

 /* USER CODE END LTDC_Init 1 */

 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;

 hltdc.Init.HorizontalSync = 23;

 hltdc.Init.VerticalSync = 3;

 hltdc.Init.AccumulatedHBP = 73;

 hltdc.Init.AccumulatedVBP = 23;

 hltdc.Init.AccumulatedActiveW = 873;

 hltdc.Init.AccumulatedActiveH = 823;

 hltdc.Init.TotalWidth = 923;

 hltdc.Init.TotalHeigh = 831;

 hltdc.Init.Backcolor.Blue = 0;

 hltdc.Init.Backcolor.Green = 0;

 hltdc.Init.Backcolor.Red = 0;

 if (HAL_LTDC_Init(&hltdc) != HAL_OK)

 {

   Error_Handler();

 }

 pLayerCfg.WindowX0 = 0;

 pLayerCfg.WindowX1 = 800;

 pLayerCfg.WindowY0 = 0;

 pLayerCfg.WindowY1 = 800;

 pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;

 pLayerCfg.Alpha = 255;

 pLayerCfg.Alpha0 = 0;

 pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;

 pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;

 pLayerCfg.FBStartAdress = 0xC0000000;

 pLayerCfg.ImageWidth = 800;

 pLayerCfg.ImageHeight = 800;

 pLayerCfg.Backcolor.Blue = 0;

 pLayerCfg.Backcolor.Green = 0;

 pLayerCfg.Backcolor.Red = 0;

 if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)

 {

   Error_Handler();

 }

 /* USER CODE BEGIN LTDC_Init 2 */

 __HAL_LTDC_DISABLE(&hltdc);

   DSI_LPCmdTypeDef LPCmd;

   HAL_DSI_Start(&hdsi);

   MLT034S32_setup();

   //HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_DISPOFF, 0x00);

   //DSI_IO_WriteCmd();

   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;

   HAL_DSI_ConfigCommand(&hdsi, &LPCmd);

   HAL_LTDC_SetPitch(&hltdc, 800, 0);

   __HAL_LTDC_ENABLE(&hltdc);

 /* USER CODE END LTDC_Init 2 */

}

MM..1
Chief II

Primary all this lines is in bad order in LTDC you start unconfigured DSI

 MX_GPIO_Init();
 MX_LTDC_Init();
 MX_CRC_Init();
 MX_DSIHOST_DSI_Init();
 MX_FMC_Init();
 MX_QUADSPI_Init();
 MX_DMA2D_Init();

PZamb.2
Associate III

Hi yes is true but is the automatic compiler, all run i must move DSIhost under LTDC

I modify the interface protocole to DSI 24Bit (Display datasheet is poor of information) and now the signal run.

PZamb.2
Associate III

I don't understand because the TouchGFx application doesn't work.

I try with another application board based of same cpu but different display , i think of configured all device , memory Sdram work and external flash is loaded, configuration string from display productor.

The Touchgfx not start, i place the breakpoint to screenviewbase.cpp but the routines doesen't call.

PZamb.2
Associate III

I chage the position but not work

May be some parameter is wrong

PZamb.2
Associate III
 
PZamb.2
Associate III
 
PZamb.2
Associate III
 
PZamb.2
Associate III

This is my .project file:

<?xml version="1.0" encoding="UTF-8"?>

<projectDescription>

   <name>Pomelli_test_funzioni</name>

   <comment></comment>

   <projects>

   </projects>

   <buildSpec>

      <buildCommand>

         <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>

         <triggers>clean,full,incremental,</triggers>

         <arguments>

         </arguments>

      </buildCommand>

      <buildCommand>

         <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>

         <triggers>full,incremental,</triggers>

         <arguments>

         </arguments>

      </buildCommand>

   </buildSpec>

   <natures>

      <nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>

      <nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>

      <nature>org.eclipse.cdt.core.cnature</nature>

      <nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>

      <nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>

      <nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>

      <nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>

      <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>

      <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>

      <nature>org.eclipse.cdt.core.ccnature</nature>

   </natures>

</projectDescription>