cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5A9J-DK: Init the MIPI-DSI TFT round LCD from the scratch, (without touchgfx and default code)

emmaulala
Associate

I am coding from the scratch to learn how STM32 works with MIPI-DSI LCD, because I am going to use customized MIPI-DSI LCD. I refer to the official code, but some incorrect content as below:

official default code: in main.c , static void MX_LTDC_Init(void):

// SETVCOM

uint8_t InitParam60[4] = {00, 00, 00, 0xC0};

if (HAL_DSI_LongWrite(&hdsi, 0, DSI_DCS_LONG_PKT_WRITE, 4, 0xC7, InitParam60) != HAL_OK)

{

Error_Handler();

}

BUT, I check HX8379C datasheet (LCD control ), SETVCOM command is (B6h), and there is no 0xC7 command ?

so what's this code for? and HX8379C datasheet dosen't mention initial sequence , how do we know that we need to set SETPOWER, SETDISP, Set display cycle timing,.....SET GAMMA,....,then Exit Sleep Mode to let LCD work? 

I don't use touchgfx now, just want to test if DSIHOST, LTDC work successfully, so I declare a framebuffer[480*480] then in MX_LTDC_Init(), write:
pLayerCfg.FBStartAdress = (uint32_t)framebuffer;
then using for loop to fill it red, but the screen is still black

2 REPLIES 2
Saket_Om
ST Employee

Hello @emmaulala 


@emmaulala wrote:

I refer to the official code, but some incorrect content as below:


Could you please specify the name of the example you are referring to?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om
emmaulala
Associate

@Saket_Om 

These 2 examples contains what I mentioned incorrect: the example from touchGFX Designer of STM32U5A9J-DK, in main.c , in function  MX_LTDC_Init, and the example from firmware package (\Repository\STM32Cube_FW_U5_V1.8.0\Projects\STM32U5x9J-DK\Examples\DSI\DSI_VideoMode_SingleBuffer), in main.c, in function SetPanelConfig, what's 0xC7 cmd for?

BTW, I refer to VideoMode_SingleBuffer example, and I succeed in displaying on the screen, and now I turn on ThreadX and touchGFX, and follow the instruction (https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-dsi-video-mode), and I keep singlebuffer location 0x200D0000 with touchgfx, after turning on LTDC interrupt, I succeeded!