cancel
Showing results for 
Search instead for 
Did you mean: 

800 x 800 Display with STM32U5G9VJT6Q - possible?

Ricko
Senior III

Hi,

we are trying to get a 800x800 display to work with the STM32U5G9VJT6Q, using either RGB888 or RGB565 in Video Mode (Burst).

According to what we read it is definitely possible. Did we miss something?

Could someone please confirm that is definitely possible?

Much appreciated

Thank you

28 REPLIES 28

@Ricko , 

Thank you very much for your reply and sharing your project!

I shipped my hardware platform to ST several weeks ago.  I hope I can get it working in either command mode or video mode with help from ST.  The display manufacture does not provide tester to demonstrate HS mode data transfer, and the IC driver manufacture does not respond to my inquiry on the timing that controls HS to LP, LP to HS timing transition on data line and clock line. Which makes the debug even harder. I wish ST can revise their HAL driver to allow user to use  HAL_DSI_LongWrite() directly to transfer image data from buffer to display at its maximum packet length of 65534 bytes. 

Best Regards,

@Ricko ,

Thank you for the code again. I have one question :
 
Is project "Bare_Metal_800_20250514_HSE16.7z" the one that displays image right-left swapped?  Is it 60fps as expected? 
 
 
 
Regards,
 
 Kelly
 
 
 
 

Hi @Kelly3 

it has been so long ago that I honestly don't remember. I actually think that was the latest from ST which was not tested because by the time they answered the projhect was stopped.

Is it not working? Do you not get anything at all?

From memory the refresh rate was 30fps or less. We were using only images, not videos (just mentioning if it is relevant).

Best

Rick

@Ricko Thank you!

@RobNewbury  I am working on a project using STM32U5G9- DK1 DSI Host MIPI one lane to drive SH8601 based display. I am still not able to work in video mode or in adaptive command mode. So far, I only can set it to work in APB command mode which send images to GRAM at very slow data rate. 

1. If configure DSI host in video mode or adaptive command mode and  send initialization command to display in escape mode,  when using HAL_DSI_ShortWrite() and HAL_DSI_LongWrite() to send initialization command to display, it will report  PE0:  escape entry error from lane 0. Thus, can't initialize display.

2. If first configure DSI host in APB command mode,  then change DSI Host to be in video mode or adaptive command mode,  display can be initialized properly. But the image data can't be sent over to display. The clock signal waveform is very good, but no data shown on data0 lane.  I have checked status of LTDC , DSI host and DSI wrapper, they have been enabled. 

I saw your project is initialize display in LP mode and send image data in HS mode. Would you like to share how to make reconfiguration successfully? Thank you very much. 

RobNewbury
Associate III

@Kelly3 To be clear, my set up is a bit different to yours as I'm using STM32F469, I have successfully interfaced to two different displays, one uses FL7705 controller and the other JD9365A controller, I have written bespoke drivers for both types of display controller. I'm also using 2 lanes MIPI DSI, I now have both display types working well but it took a lot of effort and time to get this far.

 Initially I tried to initialise in HS mode but the display was initialising correctly only about 50% of the time. I switched to LP mode and then found that I got bus errors, I can't remember what the error was but it sounds like this may be a similar issue to the one that you are having.

What I found was that when initialising in LP mode, the LTDC needs to be started before calling the display initialisation code, but when in HS mode, the LTDC needs to be started after calling the display initialisation code.

Below is my function MX_LTDC_Init from main.c and is generated by CubeMX, I have added code in USER CODE BEGIN LTDC_Init 2.
My display initialisation code is the function  TTH345BRS_Init()

When I switched to LP mode to initialise the display, I had to move the macro that starts the LTDC, __HAL_LTDC_ENABLE(&hltdc) to be before the call to the display initialistaion function TTH345BRS_Init().

On the other hand, in HS mode, the LTDC needs to be enabled after the display is initialised and is how CubeMX had originally configured the code. I dare say this works with some displays in both HS and LP mode. 

I hope this helps.

 

static void MX_LTDC_Init(void)

{

 

/* USER CODE BEGIN LTDC_Init 0 */

LTDC->IER |= LTDC_IER_LIE; // Enable LTDC interrupts

/* USER CODE END LTDC_Init 0 */

 

LTDC_LayerCfgTypeDef pLayerCfg = {0};

 

/* USER CODE BEGIN LTDC_Init 1 */

 

/* USER CODE END LTDC_Init 1 */

hltdc.Instance = LTDC;

hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;

hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;

hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;

hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;

hltdc.Init.HorizontalSync = 59;

hltdc.Init.VerticalSync = 7;

hltdc.Init.AccumulatedHBP = 119;

hltdc.Init.AccumulatedVBP = 27;

hltdc.Init.AccumulatedActiveW = 919;

hltdc.Init.AccumulatedActiveH = 827;

hltdc.Init.TotalWidth = 979;

hltdc.Init.TotalHeigh = 847;

hltdc.Init.Backcolor.Blue = 0;

hltdc.Init.Backcolor.Green = 0;

hltdc.Init.Backcolor.Red = 0;

if (HAL_LTDC_Init(&hltdc) != HAL_OK)

{

Error_Handler();

}

pLayerCfg.WindowX0 = 0;

pLayerCfg.WindowX1 = 800;

pLayerCfg.WindowY0 = 0;

pLayerCfg.WindowY1 = 800;

pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;

pLayerCfg.Alpha = 255;

pLayerCfg.Alpha0 = 0;

pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;

pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;

pLayerCfg.FBStartAdress = 0xc0000000;

pLayerCfg.ImageWidth = 800;

pLayerCfg.ImageHeight = 800;

pLayerCfg.Backcolor.Blue = 0;

pLayerCfg.Backcolor.Green = 0;

pLayerCfg.Backcolor.Red = 0;

if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)

{

Error_Handler();

}

/* USER CODE BEGIN LTDC_Init 2 */

 

DSI_LPCmdTypeDef LPCmd;

LPCmd.LPGenShortWriteNoP = DSI_LP_GSW0P_DISABLE;

LPCmd.LPGenShortWriteOneP = DSI_LP_GSW1P_DISABLE;

LPCmd.LPGenShortWriteTwoP = DSI_LP_GSW2P_DISABLE;

LPCmd.LPGenShortReadNoP = DSI_LP_GSR0P_DISABLE;

LPCmd.LPGenShortReadOneP = DSI_LP_GSR1P_DISABLE;

LPCmd.LPGenShortReadTwoP = DSI_LP_GSR2P_DISABLE;

LPCmd.LPGenLongWrite = DSI_LP_GLW_DISABLE;

LPCmd.LPDcsShortWriteNoP = DSI_LP_DSW0P_DISABLE;

LPCmd.LPDcsShortWriteOneP = DSI_LP_DSW1P_DISABLE;

LPCmd.LPDcsShortReadNoP = DSI_LP_DSR0P_DISABLE;

LPCmd.LPDcsLongWrite = DSI_LP_DLW_DISABLE;

HAL_DSI_ConfigCommand(&hdsi, &LPCmd);

 

HAL_DSI_Start(&hdsi);

 

clear_screen();

__HAL_LTDC_ENABLE(&hltdc);

TTH345BRS_Init(TTH345BRS_FORMAT_RGB888,TTH345BRS_ORIENTATION_LANDSCAPE);

 

// HAL_LTDC_SetPitch(&hltdc, 1024, 0);

 

 

/* USER CODE END LTDC_Init 2 */

 

}

 

 

@RobNewbury ,Thank you for your sharing!  I tried start DSI -> start LTDC-> initial display in LP mode, The display can't be initialized.  I guess F4 might be different from U5.

In your code, DCS long write, DCS short write, generic long write and generic short write are LP mode disabled, i.e. they are all set  to HS mode.  Is the above code for initial display in HS mode? 

Are you using burst video mode? or other mode? 

 

@Kelly3 I'm using HAL_DSI_ShortWrite() and HAL_DSI_LongWrite(), I'm using these in LP mode, I'm not aware that these functions are LP mode disabled, I am definetly using LP mode and they are working for me?

I'm using burst video mode, below is my DSI set up. Check that the VACT value is correct for your display. My other display is 720 pixels and I had the VACT set to 800 pixels, the display wouldn't initialise until I changed VACT to 720. I had thought that the VACT should include VS period in pixel clock cycles, however that is not the case.

Another mistake I had made was to initialise the display to RGB888 and the DSI to RGB565.

I hope that you get your display working.  

RobNewbury_0-1766006424074.png

RobNewbury_1-1766007930969.png

 

This is my DSI write code.

void DSI_IO_WriteCmd(uint32_t NbrParams, uint8_t* pParams)

{

HAL_StatusTypeDef status;

status = HAL_ERROR;

 

if (NbrParams <= 1)

{

status = HAL_DSI_ShortWrite(&hdsi, LCD_TTH345BRS_ID, DSI_DCS_SHORT_PKT_WRITE_P1, pParams[0], pParams[1]);

}

else

{

status = HAL_DSI_LongWrite(&hdsi, LCD_TTH345BRS_ID, DSI_DCS_LONG_PKT_WRITE, NbrParams, pParams[NbrParams], pParams);

}

}

 

 

@RobNewbury Thank you! 

I am using 454x454 display. VACT is set to be 454 as in main.h file. 

in main.c file, the display initial function is called  inside function MX_DSIHOST_DSI_Init(). It can initialize display. command 0x23, all pixel on is called in the display initial function so that I know whether display can be initialized. I can probe HS data transfer on data lane 0.but no image displayed on display. 

in main-1.c file, the display initial function is called  inside function MX_LTDC_Init() following your instruction. Yet, display can't be initialized.   

I have been working on this project for a long time, it is pretty frustrating since following user manual RM 0456 procedure does not work.