cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32F746g-disco LTDC-FMC

Hosting
Associate III
Posted on June 02, 2018 at 23:49

Hello! I'm trying to run an LCD installed on the board Stm32F746g-disco, memory and the display are successfully initialized, but I can not fill the display with color. What is wrong in my project? Maybe someone has a working draft for an example?

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on June 03, 2018 at 01:19

STM32Cube_FW_F7_V1.11.0\Projects\STM32746G-Discovery\Applications\Display\LTDC_PicturesFromSDCard

STM32Cube_FW_F7_V1.11.0\Projects\STM32746G-Discovery\Applications\STemWin\STemWin_HelloWorld

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

View solution in original post

10 REPLIES 10
Posted on June 03, 2018 at 01:19

STM32Cube_FW_F7_V1.11.0\Projects\STM32746G-Discovery\Applications\Display\LTDC_PicturesFromSDCard

STM32Cube_FW_F7_V1.11.0\Projects\STM32746G-Discovery\Applications\STemWin\STemWin_HelloWorld

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Hosting
Associate III
Posted on June 03, 2018 at 14:47

The problem was found. The CubeMX for Linux(for Windows did not check) does not generate the code for Initialize the low level hardware (MSP).

I hope the ST will soon solve this problem.

Posted on June 04, 2018 at 03:44

I think I'm having a similar problem - I want to generate a project using STM32CueMX that sets up the processor so I can write to the RAM buffer and have stuff on the screen. I've wasted days so far on it and am getting nowhere.

How did you solve it?

Did you get a CubeMX project for the STM32F746-DISCO board that initialises the SDRAM & display so you can use them?

Posted on June 04, 2018 at 11:28

Do you want to use internal memory of CPU or SDRAM? There are no problems with internal memory, the code is not generated for SDRAM IC low level hardware.

Posted on June 04, 2018 at 13:18

I want to use the SDRAM for the LCD Buffer.

Which code did you need to run? Was it pre-written in a function somewhere you could copy (eg the examples

Turvey.Clive

listed above) or did you find it elsewhere?

Posted on June 04, 2018 at 13:34

if (HAL_SDRAM_Init(&hsdram1, &SdramTiming) != HAL_OK)
 {
 _Error_Handler(__FILE__, __LINE__);
 }
}
static uint32_t FMC_Initialized = 0;
static void HAL_FMC_MspInit(void){
 /* USER CODE BEGIN FMC_MspInit 0 */
 /* USER CODE END FMC_MspInit 0 */
 GPIO_InitTypeDef GPIO_InitStruct;
 if (FMC_Initialized) {
 return;
 }
 FMC_Initialized = 1;
 /* Peripheral clock enable */
 __HAL_RCC_FMC_CLK_ENABLE();
 
 /** FMC GPIO Configuration 
 PE1 ------> FMC_NBL1
 PE0 ------> FMC_NBL0
 PG15 ------> FMC_SDNCAS
 PD0 ------> FMC_D2
 PD1 ------> FMC_D3
 PF0 ------> FMC_A0
 PF1 ------> FMC_A1
 PF2 ------> FMC_A2
 PF3 ------> FMC_A3
 PG8 ------> FMC_SDCLK
 PF4 ------> FMC_A4
 PH5 ------> FMC_SDNWE
 PH3 ------> FMC_SDNE0
 PF5 ------> FMC_A5
 PD15 ------> FMC_D1
 PD10 ------> FMC_D15
 PC3 ------> FMC_SDCKE0
 PD14 ------> FMC_D0
 PD9 ------> FMC_D14
 PD8 ------> FMC_D13
 PF12 ------> FMC_A6
 PG1 ------> FMC_A11
 PF15 ------> FMC_A9
 PF13 ------> FMC_A7
 PG0 ------> FMC_A10
 PE8 ------> FMC_D5
 PG4 ------> FMC_BA0
 PF14 ------> FMC_A8
 PF11 ------> FMC_SDNRAS
 PE9 ------> FMC_D6
 PE11 ------> FMC_D8
 PE14 ------> FMC_D11
 PE7 ------> FMC_D4
 PE10 ------> FMC_D7
 PE12 ------> FMC_D9
 PE15 ------> FMC_D12
 PE13 ------> FMC_D10
 */
 /* GPIO_InitStruct */
 GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_0|GPIO_PIN_8|GPIO_PIN_9 
 |GPIO_PIN_11|GPIO_PIN_14|GPIO_PIN_7|GPIO_PIN_10 
 |GPIO_PIN_12|GPIO_PIN_15|GPIO_PIN_13;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
 /* GPIO_InitStruct */
 GPIO_InitStruct.Pin = GPIO_PIN_15|GPIO_PIN_8|GPIO_PIN_1|GPIO_PIN_0 
 |GPIO_PIN_4;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
 /* GPIO_InitStruct */
 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_15|GPIO_PIN_10 
 |GPIO_PIN_14|GPIO_PIN_9|GPIO_PIN_8;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
 /* GPIO_InitStruct */
 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 
 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_15 
 |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_11;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
 /* GPIO_InitStruct */
 GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_3;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
 HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
 /* GPIO_InitStruct */
 GPIO_InitStruct.Pin = GPIO_PIN_3;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
 /* USER CODE BEGIN FMC_MspInit 1 */
 /* USER CODE END FMC_MspInit 1 */
}
void HAL_SDRAM_MspInit(SDRAM_HandleTypeDef* sdramHandle){
 /* USER CODE BEGIN SDRAM_MspInit 0 */
 /* USER CODE END SDRAM_MspInit 0 */
 HAL_FMC_MspInit();
 /* USER CODE BEGIN SDRAM_MspInit 1 */
 /* USER CODE END SDRAM_MspInit 1 */
}
static uint32_t FMC_DeInitialized = 0;
static void HAL_FMC_MspDeInit(void){
 /* USER CODE BEGIN FMC_MspDeInit 0 */
 /* USER CODE END FMC_MspDeInit 0 */
 if (FMC_DeInitialized) {
 return;
 }
 FMC_DeInitialized = 1;
 /* Peripheral clock enable */
 __HAL_RCC_FMC_CLK_DISABLE();
 
 /** FMC GPIO Configuration 
 PE1 ------> FMC_NBL1
 PE0 ------> FMC_NBL0
 PG15 ------> FMC_SDNCAS
 PD0 ------> FMC_D2
 PD1 ------> FMC_D3
 PF0 ------> FMC_A0
 PF1 ------> FMC_A1
 PF2 ------> FMC_A2
 PF3 ------> FMC_A3
 PG8 ------> FMC_SDCLK
 PF4 ------> FMC_A4
 PH5 ------> FMC_SDNWE
 PH3 ------> FMC_SDNE0
 PF5 ------> FMC_A5
 PD15 ------> FMC_D1
 PD10 ------> FMC_D15
 PC3 ------> FMC_SDCKE0
 PD14 ------> FMC_D0
 PD9 ------> FMC_D14
 PD8 ------> FMC_D13
 PF12 ------> FMC_A6
 PG1 ------> FMC_A11
 PF15 ------> FMC_A9
 PF13 ------> FMC_A7
 PG0 ------> FMC_A10
 PE8 ------> FMC_D5
 PG4 ------> FMC_BA0
 PF14 ------> FMC_A8
 PF11 ------> FMC_SDNRAS
 PE9 ------> FMC_D6
 PE11 ------> FMC_D8
 PE14 ------> FMC_D11
 PE7 ------> FMC_D4
 PE10 ------> FMC_D7
 PE12 ------> FMC_D9
 PE15 ------> FMC_D12
 PE13 ------> FMC_D10
 */
 HAL_GPIO_DeInit(GPIOE, GPIO_PIN_1|GPIO_PIN_0|GPIO_PIN_8|GPIO_PIN_9 
 |GPIO_PIN_11|GPIO_PIN_14|GPIO_PIN_7|GPIO_PIN_10 
 |GPIO_PIN_12|GPIO_PIN_15|GPIO_PIN_13);
 HAL_GPIO_DeInit(GPIOG, GPIO_PIN_15|GPIO_PIN_8|GPIO_PIN_1|GPIO_PIN_0 
 |GPIO_PIN_4);
 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_15|GPIO_PIN_10 
 |GPIO_PIN_14|GPIO_PIN_9|GPIO_PIN_8);
 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 
 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_15 
 |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_11);
 HAL_GPIO_DeInit(GPIOH, GPIO_PIN_5|GPIO_PIN_3);
 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_3);
 /* USER CODE BEGIN FMC_MspDeInit 1 */
 /* USER CODE END FMC_MspDeInit 1 */
}
void HAL_SDRAM_MspDeInit(SDRAM_HandleTypeDef* sdramHandle){
 /* USER CODE BEGIN SDRAM_MspDeInit 0 */
 /* USER CODE END SDRAM_MspDeInit 0 */
 HAL_FMC_MspDeInit();
 /* USER CODE BEGIN SDRAM_MspDeInit 1 */
 /* USER CODE END SDRAM_MspDeInit 1 */
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Posted on June 04, 2018 at 13:38

The examples are a pretty good point to fork from, the BSP contains various components

STM32Cube_FW_F7_V1.11.0\Drivers\BSP\STM32746G-Discovery\stm32746g_discovery_sdram.c

STM32Cube_FW_F7_V1.11.0\Drivers\BSP\STM32746G-Discovery\stm32746g_discovery_lcd.c

Mashed together a port for this in hours rather than days.

https://community.st.com/0D70X000006T1SJSA0

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 04, 2018 at 13:48

Thanks

Turvey.Clive.002

‌ and

Shalagin.Oleg

‌ - I'll try again tomorrow and see if that fixes things (night time here now). I feel like STM32CubeMX should generate this code for me...

Posted on June 04, 2018 at 14:09

One might hope, I think there is supposed to be a board level template, but a lot of the people working the forum aren't using CubeMX for assorted reasons.

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