Framebuffer test for STM32H735G-DK does not work
Hi,
My aim is to bring up custom display with the STM32H735G-DK board. As a first simple step I am using the existing display with an internal (small) framebuffer following the instructions given here: 3. Display with framebuffer in internal RAM | TouchGFX Documentation
See code snippets below, I am just trying to set some RGB888 colors in the framebuffer and loop through repeatedly by calling a simple method from the main(). But any other color than black or white just fails, typically shows as grey strips on the display...
Maybe I have missed something around how the RGB888 colors are stored..
Code to declare frame buffer:
// The display on the STM32H735G-DK is a RGB888 with 480 x 272 px.
// Lets use a small framebuffer for a portion of the display that
// could fit into internal RAM.
uint32_t *framebuffer[480*100];
uint32_t bufferSize = sizeof(framebuffer)/sizeof(framebuffer[0]);Method called from main()
static void FillDisplay(void)
{
// BLACK - works OK
uint32_t RGB888_color = 0x00000000;
for (uint32_t i = 0; i < bufferSize; i++)
{
*(uint32_t*)(framebuffer + i)= RGB888_color;
}
// WHITE works OK
HAL_Delay(1500);
RGB888_color = 0xFFFFFFFF;
for (uint32_t i = 0; i < bufferSize; i++)
{
*(uint32_t*)(framebuffer + i)= RGB888_color;
}
// PINK does not work..
HAL_Delay(1500);
RGB888_color = 255 << 16 | 0 << 8 | 255 << 0;
for (uint32_t i = 0; i < bufferSize; i++)
{
*(uint32_t*)(framebuffer + i)= RGB888_color;
}
}Code that executes in the main():
/* USER CODE BEGIN 2 */
// Enable the display with setting high pins
// for LCD_DISP and LCD_BL_CTRL for STM32H735G-DK
HAL_GPIO_WritePin(GPIOD, LCD_DISP_Pin,1);
HAL_GPIO_WritePin(GPIOG, LCD_BL_CTRL_Pin,1);
// Set frame buffer to LTDC
HAL_LTDC_SetAddress(&hltdc, (uint32_t)framebuffer, LTDC_LAYER_1);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
FillDisplay();
HAL_Delay(1500);
}
/* USER CODE END 3 */
What am I missing here...?
Many thanks in advance for any hints
