cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure CubeMX to enable LCD in STM32F469i-disco

Wojciech Sura
Associate II
Posted on June 24, 2018 at 22:57

I'm hopelessly trying to configure CubeMX to enableLCD TFT on STM32F469i-disco board (bought recently if that matters). The best effect so far is the following:


_legacyfs_online_stmicro_images_0690X0000060N6OQAU.png

What I did:

1. Used CubeMX to generate configuration with all peripherials configured

2. Switched off all I did not need (for instance the RTOS, USART etc.)

3. Selectively copied BSP drivers from the CubeF4 examples. I added all dependencies (components, fonts), such that project builds correctly

4. I try to draw cross through the whole screen, important part of the main.c follows (I stripped comments to improve clarity):

int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_CRC_Init(); MX_DMA2D_Init(); MX_DSIHOST_DSI_Init(); MX_FMC_Init(); MX_I2C1_Init(); MX_I2C2_Init(); MX_LTDC_Init(); MX_QUADSPI_Init(); MX_SAI1_Init(); MX_SDIO_SD_Init(); MX_TIM1_Init(); MX_FATFS_Init(); BSP_SDRAM_Init(); BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE); BSP_LCD_DisplayOn(); BSP_TS_Init(800,480); BSP_LCD_LayerDefaultInit(0, 0xC0000000); BSP_LCD_SelectLayer(0); BSP_LCD_DisplayOn(); BSP_LCD_Clear(LCD_COLOR_DARKCYAN); BSP_LCD_SetTextColor(0x00000000); BSP_LCD_DrawLine(0, 0, 799, 399); BSP_LCD_DrawLine(0, 399, 799, 0); while (1) { } }

This is the best effect I could achieve, at least the lines are visible, but obviously this is not what I'm counting on.

I attached the CubeMX configuration file to this post. I'm kinda new in microcontroller programming (a background with Arduino only), so I have no clue, what might I misconfigured. As the source is really simple, I guess, there's something in CubeMX, that I have misconfigured or not configured, but I'm running out of ideas. I looked at the CubeF4 demos, but they lack CubeMX configuration files. Also, I failed to deduce from the sources, how to configure the LTDC in CubeMX.

I can attach the whole project if needed (though there is nothing more than HAL and BSP copied from F4).

What am I missing? How can I fix the configuration? Is there a place in the Internet that shows how to configure CubeMX for LCD?

#stm32f469-discovery #stm32f469-dsi #lcd
15 REPLIES 15
Jerry Hancock
Associate II

hello, I have a number of programs running with the LCD with touchscreen using HAL on the 469i-disco. I would have to strip my confidential code, but if you send me a note, I'll send you a working project.

Jerry

This is a rather old post, not sure who you're replying too, the desire seemed to be for CubeMX to generate workable project code, or .IOC file. The HAL trees are full of workable projects that could be used as a shell from which to build a LCD + TOUCH combo.

The bigger issue is one where straight HAL examples vs CubeMX generated stuff don't merge well.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JLABO.1
Associate II

Sorry to dig up this old thread but I ran into the same issue, and wasted a couple hours scratching my head before figuring out it was a LTDC clock issue.

Anyway to fix this, set PLLSAI N multiplier to 192, /R to 7 and the subsequent divider to 2. It gives you a 27.428571MHz LCD-TFT clock and then your LCD works like a charm.

BUT be aware that it will ruin your 48MHz clock and SAI-A clocks. If you need the 48MHz clocks (USB, SDIO) simply change PLL48CLK Mux to PLLQ, set the PLL N multiplier to 144, and /Q to 6.

It would have been nice if ST added more granularity to the PLLSAI dividers so we don't loose nearly 40MHz core clock to keep the 48MHz clock running.

Hope this will help someone in the future.

Could you share a simple code to switch-on the lcd on a STM32F469-DISCO ?

Hello @Ciuffoly www.audiodesignguide 

Take a look at those exemples.

Best regards.

II

Hello @Ciuffoly www.audiodesignguide ,

We appreciate your enthusiasm and interest in the topic, but it is important to keep the forum organized, and we don't recommended to reopen old threads. We invite you to open a new thread where you can explain exactly your problem and we'll try to support you 🙂

Osman SOYKURT
ST Software Developer | TouchGFX