cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I-discovery : Print "Hello, world" on LCD

Fred830d
Visitor

I want to display "Hello, world" on the onboard screen of my STM32F429I-discovery board. Searching around the internet showed that the BSP has a library called "stm32f429i_discovery_lcd.h" that suits this purpose. Simply including the library with

#include "stm32f429i_discovery_lcd.h"

yielded build errors, because the compiler could not find the library file. In addition, even after adding the file location to my project's include path, I got warnings stating that "static SDRAM_HandleTypeDef SdramHandle" is not defined, which suggested to me that some associated source files might not be included in the build.

After a long time I finally just decided to include the BSP/Components directory and the BSP/STM32F429I-Discovery directory to my project, add the include paths, and add the two folders to the source location.

Fred830d_0-1746091539664.png

With this code, I had hoped that the screen would turn red, but unfortunately, it does literally nothing:

#include "main.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stm32f429i_discovery_lcd.h"  
/*More stuff */

/* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_CRC_Init();
  MX_DMA2D_Init();
  MX_FMC_Init();
  MX_LTDC_Init();
  /* USER CODE BEGIN 2 */
  BSP_LCD_Init();
  BSP_LCD_LayerDefaultInit(0, LCD_FRAME_BUFFER);
  BSP_LCD_SelectLayer(0);
  BSP_LCD_Clear(LCD_COLOR_WHITE);
  BSP_LCD_SetBackColor(LCD_COLOR_RED);

I have not touched the .ioc file, I just assumed that the onboard screen was ready to use "out of the box".

Can anyone help me display "Hello world" on the screen?

3 REPLIES 3

@Fred830d wrote:

BSP has a library called "stm32f429i_discovery_lcd.h" ?


That's not a library - that's just a header file.

Basically, a header file just gives the compiler information about the interface to the library - it does not implement the library's functions.

 


@Fred830d wrote:

yielded build errors, because the compiler could not find the library file. 


Of course - because you have not included the implementation of the library.

 


@Fred830d wrote:

Can anyone help me display "Hello world" on the screen?


Is there not an example which uses the LCD ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Hi Andrew

I found an example in my /STM32Cube/Repository/STM32Cube_FW_F4_V1.28.1/Projects/STM32F429I Discovery/Examples/BSP directory, and tried copying the code that involves the LCD from main.c over to my project and run it. The LCD still never displays anything. I have also tried playing with the configuration values of FMC, LTDC, DMA2D to see if that helped. It didn't. I suppose these configuration settings are actually important for the LCD to work properly. Here are the current settings: -

Fred830d_0-1746100127009.png

I appreciate any help I can get. I cannot find anything on the internet about this.

 

 

Did you try just running the example as-is?

Have you tried using TouchGFX ?

https://www.st.com/en/evaluation-tools/32f429idiscovery.html#tools-software

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.