Skip to main content
Graduate
April 23, 2024
Solved

stm32F429BI + LCD does not switch-on the display

  • April 23, 2024
  • 13 replies
  • 7352 views

I am starting some test with this module
https://it.aliexpress.com/item/1005002482177244.html
with 7” lcd

I have found only one example that run but with Touchgfx

I have got the same ioc from this example to generate a new code and insert the functions to switch on lcd but still no result

I would like to use the normal functions

BSP_LCD_Init() ;

BSP_LCD_DisplayStringAt(10, 80, buf, LEFT_MODE);

BSP_LCD_DrawBitmap(0, 0, (uint8_t *)(&BackGround0));

 

 

 

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    >>Is there other parts to compare ?

    Convince me the SDRAM is working, write and read-back assorted walking bit test patterns.

    We've already seen the LTDC getting working colour data from functional memory. Hey park a suitable bit map in internal flash, or some colour bar test patterns in there.

    13 replies

    CiuffolyAuthor
    Graduate
    April 24, 2024

    Using  0xD0000000 and
    LTDC_PIXEL_FORMAT_RGB888 / DMA2D_INPUT_RGB888 / DMA2D_OUTPUT_RGB888
    instead of
    DMA2D_INPUT_ARGB8888 / DMA2D_INPUT_ARGB8888 / DMA2D_OUTPUT_ARGB8888

    I see these vertical lines

     

    20240424_234920.jpg

    Graduate II
    April 24, 2024

    Ok, but it's just reading, or failing to read, a consistent pattern from the Frame Buffer.

    Not really convinced that the SDRAM or running it at full bandwidth. Can you dump in a Memory View in debugger?

    Is the system still hanging when you write to the Frame Buffer?

    CiuffolyAuthor
    Graduate
    April 25, 2024

    Also if I set all the parameters like TouchGfx example the result is not good.

    Is there other parts to compare ?

    Ciuffolywwwaudiodesignguide_0-1714022257923.png

    Ciuffolywwwaudiodesignguide_1-1714022299845.png

    Ciuffolywwwaudiodesignguide_2-1714022331442.png

     

     

     

     

    CiuffolyAuthor
    Graduate
    April 25, 2024

    A new info, starting from TouchGfx project I have made 2 simple modifications

     

    //MX_TouchGFX_Init(); <<<<<<<<<<<<<<<<<

    BSP_LCD_Init(); // add now

    BSP_LCD_Clear(0x00FFFF00); // add now

     

     

    void StartDefaultTask(void const * argument)

    {

    HAL_TIM_PWM_Start(&htim4, TIM_CHANNEL_2);

    //MX_TouchGFX_Process(); <<<<<<<<<<<<<<<<<

     

    and now I see only vertical lines like in previous project

     

    so the problem could be in the BSP_LCD_Clear()

    Graduate II
    April 25, 2024

    Show BSP_LCD_Clear() source !

    And try explain why this all when TGFX is more more effective...

    Graduate II
    April 25, 2024

    >>Is there other parts to compare ?

    Convince me the SDRAM is working, write and read-back assorted walking bit test patterns.

    We've already seen the LTDC getting working colour data from functional memory. Hey park a suitable bit map in internal flash, or some colour bar test patterns in there.

    CiuffolyAuthor
    Graduate
    April 25, 2024

    Sorry for delay in the answer

     

    void BSP_LCD_Clear(uint32_t Color)

    {

    /* Clear the LCD */

    LL_FillBuffer(ActiveLayer, (uint32_t *)(hltdc.LayerCfg[ActiveLayer].FBStartAdress), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), 0, Color);

    }

     

    static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)

    {

    /* Register to memory mode with ARGB8888 as color Mode */

    hdma2d.Init.Mode = DMA2D_R2M;

     

     

    if(hltdc.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_RGB565)

    { /* RGB565 format */

    hdma2d.Init.ColorMode = DMA2D_RGB565;

    ColorIndex = ((ColorIndex & LCD_COLOR_RED)<<8) | ((ColorIndex & LCD_COLOR_GREEN )<<5) | ((ColorIndex & LCD_COLOR_BLUE) << 3);

    }

    else

    { /* ARGB8888 format */

    hdma2d.Init.ColorMode = DMA2D_ARGB8888;

    }

    hdma2d.Init.OutputOffset = OffLine;

     

    hltdc.Instance = DMA2D;

     

    /* DMA2D Initialization */

    if(HAL_DMA2D_Init(&hdma2d) == HAL_OK)

    {

    if(HAL_DMA2D_ConfigLayer(&hdma2d, LayerIndex) == HAL_OK)

    {

    if (HAL_DMA2D_Start(&hdma2d, ColorIndex, (uint32_t)pDst, xSize, ySize) == HAL_OK)

    {

    /* Polling For DMA transfer */

    HAL_DMA2D_PollForTransfer(&hdma2d, 10);

    }

    }

    }

    }

     

    CiuffolyAuthor
    Graduate
    April 25, 2024

    Now Work!

     

    Changed from
    DMA2D_OUTPUT_RGB888 / DMA2D_INPUT_RGB888 / LTDC_PIXEL_FORMAT_RGB888
    to
    DMA2D_OUTPUT_ARGB8888 / DMA2D_INPUT_ARGB8888 / LTDC_PIXEL_FORMAT_ARGB8888


    Ciuffolywwwaudiodesignguide_0-1714060244821.png

     

    This set

     

    #define HBP 80

    #define VBP 40

    #define HSW 1

    #define VSW 1

    #define HFP 190

    #define VFP 22

     

    #define LCD_Width 800

    #define LCD_Height 480

    #define LCD_Pixels 800*480

    #define LCD_MemoryAdd 0xD0000000

     

    hltdc.Init.HorizontalSync = HSW - 1;

    hltdc.Init.VerticalSync = VSW -1 ;

    hltdc.Init.AccumulatedHBP = HBP + HSW -1;

    hltdc.Init.AccumulatedVBP = VBP + VSW -1;

    hltdc.Init.AccumulatedActiveW = LCD_Width + HSW + HBP -1;

    hltdc.Init.AccumulatedActiveH = LCD_Height + VSW + VBP -1;

    hltdc.Init.TotalWidth = LCD_Width + HSW + HBP + HFP - 1;

    hltdc.Init.TotalHeigh = LCD_Height + VSW + VBP + VFP - 1;

     

     

    PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;

    PeriphClkInitStruct.PLLSAI.PLLSAIN = 60;

    PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;

    PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;