2024-01-22 09:32 AM
This is a repost of the message I left on the "STM32 MCUs Touch GFX and GUI" and I'm hoping that it gets some more traction in this section of the forum.
Apologies for the repost.
I'm in the process of migrating from an STM32F779AIY6TR to an STM32U5A9NJH6Q and I'm running into issues with the DSI communications to my LCD on the U5 platform that were not present with the F7 when using the same parameters.
Hardware setup:
LCD Panel - E30RB-I-MW340-N (Sitronix ST7701S TFT IC) Focus LCD: MIPI Driver Pseudocode
U5 Processor (DSI not working) STM32U5A9NJH6Q
F7 Processor (DSI working) STM32F779AIY6TR
Modes:
Video Mode, Non Burst Mode with Event
LP transitions are enabled for all video areas.
16 Byte command maximums
Commands are transmitted in Low Power mode
Clock and other parameters that seem potentially relevant (same for both platforms generated from CubeMX):
PHY DSI 240MHz
DSI lane byte clock 30 MHz
DSI txclkesc 6 MHz
Automatic clock lane control is disabled (per the U5 Errata)
PHY Low Power offset 0 CLK
BTA is enabled
Issues / Symptoms / Oddities:
// Start DSI
if (HAL_DSI_Start(&hdsi) != HAL_OK)
{
Error_Handler();
}
/* Switch to DSI PHY PLL clock */
RCC_PeriphCLKInitTypeDef PeriphClkInit;
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_DSI;
PeriphClkInit.DsiClockSelection = RCC_DSICLKSOURCE_DSIPHY;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
/* USER CODE END DSIHOST_Init 2 */
While the CubeMX generated code for my platform handles this inside of HAL_DSI_MspInit(DSI_HandleTypeDef* dsiHandle).
Things tried:
At this point, I'm at a loss for what to look into next. The autogenerated peripheral configuration code for the F7 and U5 differs in various ways when I run a diff. Most of the differences seem to relate to a general refactoring of code but there are configuration parameters on the U5 that aren't present in the F7. For example PLLInit.PLLVCORange, PLLInit.PLLChargePump, and PLLInit.PLLTuning are present in the U5 as configurable parameters, but not in the F7.
Any help would be appreciated on the matter.
2024-01-27 04:37 AM
Dear @jadczak_slr ,
Sorry for the late response, just wanted to close the loop as you contacted us via our Online support channel with thus case number 00197041 and my colleagues and FAEs in our touch with you , indeed your case is a bit complex and and require a deep debugging with our experts as the architecture for both HW/SW from STM32F7 to STM32U5 on DSI is different.
stay tuned !
Cheers,
STOne-32
2024-02-14 07:17 AM
Good afternoon,
For a couple of months, we have been having the same issues while integrating a slightly different controller (Sitronix ST7796).
All the points that jadczak_slr is mentioning are somehow the same as we are facing.
We managed to get something partially displayed (1/3 of the display has the image warped by 45 degrees) using the CubeMX configuration but it's really flaky: as soon as the content in the framebuffer is changed - e.g. adding different colors, drawing on different areas - the result spans from being worse to completely broken (blank display).
The picture shows the best result we could achieve, and how it should look (the bars' height dynamically changes over time so they don't match 1:1)
Are there any updates that could help us proceed with the development? At the moment we already tried all the possible combinations in CubeMX.
Looking forward to receiving your kind support,
Regards
2024-02-14 09:01 AM
Dear @dannti @jadczak_slr ,
We have an on-going version of STM32Cube U5 that will update the DSI driver and will align DSI Initialization sequence to the recommended ‘Programming procedure overview’ part to avoid DSI read LCD controller register 0x0A error. It will be released during Q1/2024 and if it might help you here is a patch , if you can try it from now :
////////////////////////////////////////////////////Version 1.4.0 //////////////////////////////////////////////////
/*************************** Set the PHY parameters ***************************/
/* D-PHY clock and digital enable*/
hdsi->Instance->PCTLR |= (DSI_PCTLR_CKE | DSI_PCTLR_DEN);
/* Clock lane configuration */
hdsi->Instance->CLCR &= ~(DSI_CLCR_DPCC | DSI_CLCR_ACR);
hdsi->Instance->CLCR |= (DSI_CLCR_DPCC | hdsi->Init.AutomaticClockLaneControl);
/* Configure the number of active data lanes */
hdsi->Instance->PCONFR &= ~DSI_PCONFR_NL;
hdsi->Instance->PCONFR |= hdsi->Init.NumberOfLanes;
/************************ Set the DSI clock parameters ************************/
/* Set the TX escape clock division factor */
hdsi->Instance->CCR &= ~DSI_CCR_TXECKDIV;
hdsi->Instance->CCR |= hdsi->Init.TXEscapeCkdiv;
/****************************** Error management *****************************/
/* Disable all error interrupts and reset the Error Mask */
hdsi->Instance->IER[0U] = 0U;
hdsi->Instance->IER[1U] = 0U;
hdsi->ErrorMsk = 0U;
////////////////////////////////////////////////////Version 1.5.0 //////////////////////////////////////////////////
__HAL_DSI_ENABLE(hdsi);
/************************ Set the DSI clock parameters ************************/
/* Set the TX escape clock division factor */
hdsi->Instance->CCR &= ~DSI_CCR_TXECKDIV;
hdsi->Instance->CCR |= hdsi->Init.TXEscapeCkdiv;
/*************************** Set the PHY parameters ***************************/
/* D-PHY clock and digital enable*/
hdsi->Instance->PCTLR |= DSI_PCTLR_DEN;
/************************ Set D-PHY Band Control registers ******************************/
/* Set Band Control Frequency and LPX Offset */
DSI_ConfigBandControl(hdsi);
/* Set PLL Tuning */
DSI_SetWrapperPLLTuning(hdsi, PLLInit);
hdsi->Instance->PCTLR |= DSI_PCTLR_CKE;
/* Configure the number of active data lanes */
hdsi->Instance->PCONFR &= ~DSI_PCONFR_NL;
hdsi->Instance->PCONFR |= hdsi->Init.NumberOfLanes;
/* 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;
}
}
}
/****************************** Error management *****************************/
/* Disable all error interrupts and reset the Error Mask */
hdsi->Instance->IER[0U] = 0U;
hdsi->Instance->IER[1U] = 0U;
hdsi->ErrorMsk = 0U;
__HAL_DSI_DISABLE(hdsi);
/* Clock lane configuration */
hdsi->Instance->CLCR &= ~(DSI_CLCR_DPCC | DSI_CLCR_ACR);
hdsi->Instance->CLCR |= (DSI_CLCR_DPCC | hdsi->Init.AutomaticClockLaneControl);
Hope it will help you,
Cheers,
STOne-32
2024-02-14 02:29 PM
Can you walk me through this, because at first glace the 1.5 code doesn't fully make sense to me.
It looks like we're
Presumably I need to re-enable the DSI `__HAL_DSI_ENABLE(hdsi)` at this point in time?
I'm also not sure how this is fundamentally different than the 1.4 with automatic clock lane control. We've reordered some stuff and did some clock configuration with the DSI off...
You said that this will resolve 0x0A errors (DSI read LCD control), but I'm not getting those errors to the best of my knowledge (I'm not trying to read any registers).
2024-02-19 05:23 AM
Hello,
I just wanted to update the thread because we managed to have something displayed. It still has some bugs (but that could be related to other issues not strictly related to the U5 or the controller).
We started with an example from the TouchGFX which was also based on RGB565. We made some changes according to the controller pseudocode given by the display supplier and some hit&tries.
The crucial parts were the following:
Tell me if this helped you somehow.
Cheers
2024-11-05 05:28 AM
Did anyone figure out why PLL3P needs to be used and PLL DSI is not ok?