cancel
Showing results for 
Search instead for 
Did you mean: 

DSI timeout waiting for DSI to be idle - DSI bit PSS0, PSS1 and PSSC are not being set?

Ricko
Senior III

Hi,

I am new to STM32 and using DSI for the first time.

I generated the simplest code for bringing up a custom DSI display board using CubeMX and TouchGFX. The code compiles successfully, but the CubeMX-generated function HAL_DSI_Init() within MX_DSIHOST_DSI_Init() (code snippet below) returns HAL_TIMEOUT at line 26.

By default, HAL_TIMEOUT is set to 100ms, which is quite a long time...

 

 

 

 

 

  /* Get tick */
  tickstart = HAL_GetTick();
  if ((hdsi->Instance->PCONFR & DSI_PCONFR_NL) == DSI_ONE_DATA_LANE)
  {
    while ((hdsi->Instance->PSR & (DSI_PSR_PSS0 | DSI_PSR_PSSC)) != (DSI_PSR_PSS0 | DSI_PSR_PSSC))
    {
      if ((HAL_GetTick() - tickstart) > DSI_TIMEOUT_VALUE)
      {
        /* Process Unlocked */
        __HAL_UNLOCK(hdsi);

        return HAL_TIMEOUT;
      }
    }
  }
  else
  {
    while ((hdsi->Instance->PSR & (DSI_PSR_PSS0 | DSI_PSR_PSS1 | DSI_PSR_PSSC)) != (DSI_PSR_PSS0 | \
                                                                                    DSI_PSR_PSS1 | DSI_PSR_PSSC))
    {
      if ((HAL_GetTick() - tickstart) > DSI_TIMEOUT_VALUE)
      {
        /* Process Unlocked */
        __HAL_UNLOCK(hdsi);

        return HAL_TIMEOUT;  //##### IT RETURNS THIS TIMEOUT #####
      }
    }
  }

 

 

 

 

 

It seems that the code is waiting for the DSI bits DSI_PSR_PSS0, DSI_PSR_PSS1, and DSI_PSR_PSSC to be set, but they are not (as shown in the register view on the right side of the screenshot below). Any idea why these bits are not being set?

 

For reference, I’ve also included a series of screenshots of the DSI peripheral setup/configuration pages, along with the IOC file. Hopefully, this helps in troubleshooting the issue.

 

Thank you :)

 

Ricko_1-1741649691724.png

Ricko_2-1741650013285.png

Ricko_3-1741650020644.png

Ricko_4-1741650028995.png

Ricko_5-1741650046817.png

Ricko_6-1741650055422.png

Ricko_7-1741650078810.png

Ricko_8-1741650086856.png

Ricko_9-1741650101557.png

 

 

 

 

 

 

0 REPLIES 0