2022-02-03 08:00 AM
Hi,
I'm a french embedded developer.
I'm working with a STM32F429 custom board with a LCD screen, a 64Mbits SDRAM (IS42S16400J), and STemWin v5.32 library. I'm using STM32cubeIDE 1.7.0.
I start from scratch.
The LCD screen is a PH320240T-023-I02Q, based on ILI9341, i think. In CubeIde, I use FMC, LTCD and DMA2D for the LCD.
After a few days and some headache:
I know this board works, because I have the binary file of the old project.
I need to make some modification, but the source files of the old project can't be used.
I just want to have some text on the LCD, using GUI_DispStringHCenterAt.
If i understand, LCD_X_DisplayDriver is called by the display driver for several purposes.
In this function,
case LCD_X_SHOWBUFFER:
layer_prop[LayerIndex].pending_buffer = ((LCD_X_SHOWBUFFER_INFO *)pData)->Index;
break;
I think It's used to refresh the display buffer.
But, using break point, LCD_X_SHOWBUFFER seems not working.
so pending_buffer = -1 (always)
and HAL_LTDC_LineEvenCallback doesn't refresh buffer, because pending_buffer is not >= 0 (call in IRQ handler)
void HAL_LTDC_LineEvenCallback(LTDC_HandleTypeDef *hltdc)
{
U32 Addr;
U32 layer;
for (layer = 0; layer < GUI_NUM_LAYERS; layer++)
{
if (layer_prop[layer].pending_buffer >= 0)
{
/* Calculate address of buffer to be used as visible frame buffer */
Addr = layer_prop[layer].address + \
layer_prop[layer].xSize * layer_prop[layer].ySize * layer_prop[layer].pending_buffer * layer_prop[layer].BytesPerPixel;
__HAL_LTDC_LAYER(hltdc, layer)->CFBAR = Addr;
__HAL_LTDC_RELOAD_CONFIG(hltdc);
/* Notify STemWin that buffer is used */
GUI_MULTIBUF_ConfirmEx(layer, layer_prop[layer].pending_buffer);
/* Clear pending buffer flag of layer */
layer_prop[layer].pending_buffer = -1;
}
}
HAL_LTDC_ProgramLineEvent(hltdc, 0);
}
I think I need some help.
Thanks for reading.
2022-02-08 11:53 PM
My problem is solved.
SDRAM was not correctly initialized.