2025-03-10 4:51 PM - edited 2025-03-10 6:05 PM
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 :)