cancel
Showing results for 
Search instead for 
Did you mean: 

When init dsi the func ran into Error_Handler,bucause of HAL_TIMEOUT

99
Associate

- MCU : STM32U5F9VJT

- HAL 驱动程序版本号:V1.6.0

当 init dsi de flag DSI_FLAG_PLLLS始终为 0.检查 enable 寄存器时,标志是可以的。

 

 

  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_DSI;
    PeriphClkInit.DsiClockSelection = RCC_DSICLKSOURCE_PLL3;
    PeriphClkInit.PLL3.PLL3Source = RCC_PLLSOURCE_HSE;
    PeriphClkInit.PLL3.PLL3M = 4;
    PeriphClkInit.PLL3.PLL3N = 125;
    PeriphClkInit.PLL3.PLL3P = 8;
    PeriphClkInit.PLL3.PLL3Q = 2;
    PeriphClkInit.PLL3.PLL3R = 24;
    PeriphClkInit.PLL3.PLL3RGE = RCC_PLLVCIRANGE_0;
    PeriphClkInit.PLL3.PLL3FRACN = 0;
    PeriphClkInit.PLL3.PLL3ClockOut = RCC_PLL3_DIVP;
    if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
    {
      Error_Handler();
    }
//the clock of dsi 


  hdsi.Instance = DSI;
  hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE;
  hdsi.Init.TXEscapeCkdiv = 4;
  hdsi.Init.NumberOfLanes = DSI_TWO_DATA_LANES;
  hdsi.Init.PHYFrequencyRange = DSI_DPHY_FRANGE_450MHZ_510MHZ;
  hdsi.Init.PHYLowPowerOffset = PHY_LP_OFFSSET_0_CLKP;
  PLLInit.PLLNDIV = 125;
  PLLInit.PLLIDF = DSI_PLL_IN_DIV4;
  PLLInit.PLLODF = DSI_PLL_OUT_DIV2;
  PLLInit.PLLVCORange = DSI_DPHY_VCO_FRANGE_800MHZ_1GHZ;
  PLLInit.PLLChargePump = DSI_PLL_CHARGE_PUMP_2000HZ_4400HZ;
  PLLInit.PLLTuning = DSI_PLL_LOOP_FILTER_2000HZ_4400HZ;
  if (HAL_DSI_Init(&hdsi, &PLLInit) != HAL_OK)
  {
    Error_Handler();
  }
//the init of sdi 

 

 

 

4 REPLIES 4
99
Associate
  DSI_ConfigBandControl(hdsi);

  /* Set PLL Tuning */
  DSI_SetWrapperPLLTuning(hdsi, PLLInit);

  /* Enable the DSI PLL */
  __HAL_DSI_PLL_ENABLE(hdsi);

  /* Requires min of 400us delay before reading the PLLLS flag */
  /* 1ms delay is inserted that is the minimum HAL delay granularity */

  HAL_Delay(1);

  /* Get tick */
  tickstart = HAL_GetTick();

  /* Wait for the lock of the PLL */
  while (__HAL_DSI_GET_FLAG(hdsi, DSI_FLAG_PLLLS) == 0U)
  {
    /* Check for the Timeout */
    if ((HAL_GetTick() - tickstart) > DSI_TIMEOUT_VALUE)
    {
      return HAL_TIMEOUT;   // the error 
    }
  }
KDJEM.1
ST Employee

Hello @99 and welcome to the Community ;

 

Could you please refer to DSI example and check the PLL configuration. may this example can help you.

Please make that the HSE is ON and READY before starting DSI (as DSI PLL source is HSE).

Please try to increase the delay before verifying the PLLLS flag (3ms for example).

I hope this help you.

Please let me know if the issue is solved or not?

Thank you.

Kaouthar

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

屏幕截图 2024-09-23 173219.png屏幕截图 2024-09-23 173242.png

it does not work .

i check the colock is same with DSI example.21.png屏幕截图 2024-09-24 084815.png

KDJEM.1
ST Employee

Hello @99 ,

 

Are you use a STM32 board?

Could you please try to decrease the DSI Clock ?

Thank you.

 

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.