2018-06-02 02:49 PM
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?
Solved! Go to Solution.
2018-06-02 04:19 PM
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
2018-06-02 04:19 PM
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
2018-06-03 05:47 AM
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.
2018-06-03 08:44 PM
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?
2018-06-04 04:28 AM
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.
2018-06-04 06:18 AM
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?2018-06-04 06:34 AM
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 */
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
2018-06-04 06:38 AM
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
2018-06-04 06:48 AM
Thanks
Turvey.Clive.002
andShalagin.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...2018-06-04 07:09 AM
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.