2024-04-23 09:26 AM
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));
Solved! Go to Solution.
2024-04-25 07:00 AM - edited 2024-04-25 08:20 AM
Show BSP_LCD_Clear() source !
And try explain why this all when TGFX is more more effective...
2024-04-25 07:46 AM
>>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.
2024-04-25 08:29 AM
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);
}
}
}
}
2024-04-25 08:55 AM
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
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;
2024-04-25 09:12 AM
Last source
www.audiodesignguide.com/sw1/stm32F429BI-test5.zip
I will update soon with touch screen test
2024-04-26 09:38 AM
Last source with Touch screen test and the complete BSP_LCD library to print text and load BMP
www.audiodesignguide.com/sw1/stm32F429BI-test7.zip