cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 Discovery - on-board LCD and CubeMX problem

xerxes931
Associate
Posted on March 06, 2016 at 12:54

Hi. I've been playing around with the example project LTDC/LTDC_Display_1_Layer from the STM32F7 CubeMX package. Everything works fine, I modified the project a little bit and so on. 

However, when I tried to create a similar project from the beginning, it didn't work. I made sure many times that all the parameters were the same as in the example project - system clock frequencies, deviders, multipliers, as well as the LTDC configuration - pixel format, HSYNC, VSYNC and so on. However when I looked into the stm32f7xx_hal_msp.c files I noticed that the one generated automatically by CubeMX used completely different GPIO's than the one from the example project. 

So now I know why my project doesn't work, but I don't know why does the CubeMX autogenerated LTDC config use different GPIO's than the ones that seem to work, why is it so? Do I have to change all the GPIO's in LTDC config menu in CubeMX manually, according to the Discovery board schematics, or am I doing something wrong?

On the left - function HAL_LTDC_MspInit from the example project (working one), on the right - the same function generated by CubeMX (not working), why are the GPIO ports and numbers different?

http://x3.cdn03.imgwykop.pl/c3201142/comment_vd6lL1yOpeLgwe72kvlrbK3LzrYqXy9k.jpg

4 REPLIES 4
Amel NASRI
ST Employee
Posted on March 07, 2016 at 16:56

Hi rybak.marcin,

Did you tried to configure the same GPIOs as the ones used in the example with CubeMX?

Does it work as expected?

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Walid FTITI_O
Senior II
Posted on March 07, 2016 at 18:35

Hi rybak.marcin,

To get a similar configuration with CubeMx as the example you mentionned, you should give attention to the following requirements:

-Use the last version of CubeMx 4.13.0

- Select the STM32F746 Discovery as a board.

- Selct the RGB565 as LTDC type ( same as example)

Following the previous recommendations , you should find the same GPIOs configuration.

-Hannibal-

xerxes931
Associate
Posted on March 07, 2016 at 21:39

Okay, now I see that there is something I don't understand in CubeMX. When I create a project in CubeMX, selecting the STM32F746 - Disco board, and select ''Graphic LCD Display'' from the list on the left, then enable LTDC on RGB565 mode, GPIO's seem to be the same as the ones in the example. However when I use ''Clear Pinouts'' from the Pinout menu, and then configure the LTDC in RGB565 again, it gets completely different GPIO's. How is it that the same peripherial get different pinout, depending on whether I enable it just after creating the project or after clearing pinouts?

Walid FTITI_O
Senior II
Posted on March 08, 2016 at 15:58

 Hi rybak.marcin

,

Basically, the pins are GPIOs which can be assigned to alternate functions, e.g. LCD_HSYNC. Every alternate function has it's default pin and alternative pins to which the function can be remapped. It is possible to remap some alternate functions to some other pins.  The specific alternate function assignments for each pin are detailed in the device datasheet, Table 10 “STM32F745xx and STM32F746xx pin and ball definitionâ€�.

Example :  LCD_CLK can be mapped on PI14, or PE14 or PG7

-Hannibal-