2025-04-24 4:58 AM - edited 2025-04-24 11:44 AM
Today I tried to configure MIPI-DSI on STM32U5G9 using CubeMX and I did not win this first clash.
MX_DSIHOST_DSI_Init() function fails executing HAL_DSI_Init() where it waits for
DSI_PSR register flags PSS0, PSS1 and PSSC to be set (indicate both lanes and clock stop state) - see scrsht below.
1. My first observation is that according to RM0456 section 44.14.1 "Programing procedure overview" initially PLL3 should be used as the MIPI clock source (step 2) and then it should be switched to D-PHY PLL (step 14). HAL_DSI_Init() function does not seem to follow this procedure.
2. I found no explanation on how to configure PLLChargePump and PLLTuning. Both values are set in DSI_WPTR register. Do I correctly guess that the selected Phase Frequency Detector range needs to correspond to HSE clock since HSE is the only available PLL-DSI clock source? In my case it is 16MHz.
Please advise.
CubeMX 6.14.1, MCU Package 1.7.0
2025-04-24 9:35 AM
Hello,
Try to use the PLL3 as source clock first then switch to D-PHY clock if needed(it is the recommended clock) as referances see examples for STM32U5:
STM32CubeU5/Projects/STM32U5x9J-DK/Examples/DSI at main · STMicroelectronics/STM32CubeU5 · GitHub
Regards
2025-04-26 6:15 AM - edited 2025-04-26 6:24 AM
Hello @Ch_JE,
Thank you. I managed to get this example working. Its advantage is that it is simple and it works. To understand it better I had to restructure the code and pull important constants out of functions where they are used - see image below.
The above allowed me to notice that settings like front porch and back porch must be configured differently for LTDC and DSI. Cube MX probably wrongly sets them the same (almost the same since corresponding LTDC registers values are [-1]). Moreover, pixel formats used by LTDC and DSI are different.
Another lesson I learned is that PLL3 really needs to be used, likely for both DSI and LTDC, and only at the very end of the initial setup DSI can be switched to DSI PHY PLL clock. Does DSI need sort of jump start?
There is still a lot I have to research in order to get it working with LCD that I want to use but all in all this example is a good starting point.
Settings that I still do not understand are PLLChargePump and PLLTuning. Both values are set in DSI_WPTR register. Do I correctly guess that the selected Phase Frequency Detector range needs to correspond to HSE clock since HSE is the only available PLL-DSI clock source? Description found in RM0456 is at best enigmatic.
Please advise.