2023-06-22 11:01 AM
Hello Everyone ;
we are new to STM32H7 ; we used before stm32f4 in many projects but STM32H7 we still new; so I am sorry to ask simple questions.
We have designed our board based on STM32H743BI and SDRAM IS42R32160F-7. After a couple of weeks of trying to access the Sdarm, we could not make it work; sometimes we could read and write a few bytes ; sometimes up to 1k bytes but not more, and always crashes. It could be a clock setting problem or timing problem; or a connection problem between the MCU and SDRAM.
The MCU crystal is 12MHZ our goal is to run the MCU at 480MHZ and SDRAM at 100 MHZ
Let's start step by step please ;
my first question is to verify the pins connection please and SDRAM BANK; we assume that is should be bank 1 and mapped at 0X70000000 address.
could you confirm it please?
/** FMC GPIO Configuration
PI9 ------> FMC_D30
PI10 ------> FMC_D31
PF0 ------> FMC_A0
PF1 ------> FMC_A1
PF2 ------> FMC_A2
PF3 ------> FMC_A3
PF4 ------> FMC_A4
PF5 ------> FMC_A5
PA7 ------> FMC_SDNWE
PC4 ------> FMC_SDNE0
PC5 ------> FMC_SDCKE0
PF11 ------> FMC_SDNRAS
PF12 ------> FMC_A6
PF13 ------> FMC_A7
PF14 ------> FMC_A8
PF15 ------> FMC_A9
PG0 ------> FMC_A10
PG1 ------> FMC_A11
PE7 ------> FMC_D4
PE8 ------> FMC_D5
PE9 ------> FMC_D6
PE10 ------> FMC_D7
PE11 ------> FMC_D8
PE12 ------> FMC_D9
PE13 ------> FMC_D10
PE14 ------> FMC_D11
PE15 ------> FMC_D12
PH8 ------> FMC_D16
PH9 ------> FMC_D17
PH10 ------> FMC_D18
PH11 ------> FMC_D19
PH12 ------> FMC_D20
PD8 ------> FMC_D13
PD9 ------> FMC_D14
PD10 ------> FMC_D15
PD14 ------> FMC_D0
PD15 ------> FMC_D1
PG2 ------> FMC_A12
PG4 ------> FMC_BA0
PG5 ------> FMC_BA1
PG8 ------> FMC_SDCLK
PH13 ------> FMC_D21
PH14 ------> FMC_D22
PH15 ------> FMC_D23
PI0 ------> FMC_D24
PI1 ------> FMC_D25
PI2 ------> FMC_D26
PI3 ------> FMC_D27
PD0 ------> FMC_D2
PD1 ------> FMC_D3
PG15 ------> FMC_SDNCAS
PE0 ------> FMC_NBL0
PE1 ------> FMC_NBL1
PI4 ------> FMC_NBL2
PI5 ------> FMC_NBL3
PI6 ------> FMC_D28
PI7 ------> FMC_D29
*/
is the pins connection right ?
Thank you in advanced
Regards
Hector
2023-06-22 11:54 AM
Hi Hector ..
I am using 256MB SDRAM with STM32H745XIT6 (DUAL CORE) with TouchGFX at BANK 2 without any problem.
here is my custom designed board with STM32H745XIT6 & 1024X600 TFT.
CM4 running Modbus Master RTU
CM7 running TouchGFX with 256MB SDRAM
Here is the configuration in MX
Please check the timings of interface .
Imran
2023-06-22 12:06 PM
Hello IMRAN
very nice project ;
Could you tell if my connection is right or not? in fact our goal is to use TFT LCD but we still not making the SDram working.
Thank you
2023-06-22 12:13 PM
Hello Hector ...
In quick view , your interface looks fine .
are you using any SOM or your self developed board for every thing .
I have lot of experience working with TFTs & TouchGFX .
I can b helpful to solve the issue.
Imran
2023-06-22 12:19 PM
We designed our som ; based on STM32H743 but we still testing the SDRAM . and we still not making it working . Could you help please to solve it?
2023-06-22 12:27 PM
Sure ,, I will ..
You can share snaps of you board & project files , here in this forum or directly to me.
Here is TouchGFX , running on SAMSUNG TAB3 7.0 ,, 1024x600 , LVDS LCD & TouchGFX (STM32F429i-DISCOVERY + SN75LVDS83B) :
Here is TouchGFX , running on CHINESE 800X480 TFT (DE Mode) & TouchGFX (STM32F767 WILDFIRE BOARD)
Tested Modbus on it with same usb cable coz I developed st-link board with usb hub chip and ft232rl. (Power + SWD + USB232/modbus)
Here is TouchGFX , running on 5.0" ,, 720X1280 ,, RGB + SPI TFT with STM32F429i-DISCOVERY
LCD PART No. TL050HDV31CT5-H1206A
The lcd driver chip/COG is NV3052
Here is TouchGFX , running on 5.0" ,, 800X480 ,, RGB TFT with STM32F429i-DISCOVERY,
Here is TouchGFX running on STM32F469i-DICOVERY
Here is TouchGFX running on HP S1932 18.5" Monitor's LVDS LCD with 1366x768 resolution .
The lcd part no. is LTM185AT04 or Equivalent . The driver is STM32F429i-DISCOVERY + SN75LVDS83B
Tested following lcds.
SAMSUNG TAB3 7.0" , 1024x600 TFT
THINKPAD T400 14.1" , 1280x800 TFT
GENERIC TFT MONITORS , from 14.1" to 18.5" Maximum tested resolution is 1366x768 TFT
imran
2023-06-22 12:31 PM - edited 2023-06-22 12:36 PM
Very great Job Mr IMRAN
2023-12-16 03:56 AM
Hello
nice job. I need help to do my work too. I use 1366*768 LCD with stm32h743iit6 but it flickers like the video I attached. Would you please help me with that?
https://drive.google.com/file/d/1slB_5LC5tWVdE61MoUpXk6XO0F--_Sts/view?usp=drive_link
2023-12-16 04:26 AM
Show details of display, timings and memory implementation.
Stuff that illustrates the CAUSE not the symptoms. Lead with detail.
2023-12-16 04:42 AM
thank you for your reply.
this is ltdc configurations. LTDC_CLK is set to 50MHz.
void MX_LTDC_Init(void)
{
/* USER CODE BEGIN LTDC_Init 0 */
/* USER CODE END LTDC_Init 0 */
LTDC_LayerCfgTypeDef pLayerCfg = {0};
/* USER CODE BEGIN LTDC_Init 1 */
/* USER CODE END LTDC_Init 1 */
hltdc.Instance = LTDC;
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
hltdc.Init.HorizontalSync = 0;
hltdc.Init.VerticalSync = 0;
hltdc.Init.AccumulatedHBP = 160;
hltdc.Init.AccumulatedVBP = 22;
hltdc.Init.AccumulatedActiveW = 1526;
hltdc.Init.AccumulatedActiveH = 790;
hltdc.Init.TotalWidth = 1526;
hltdc.Init.TotalHeigh = 790;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 1366;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 768;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
pLayerCfg.Alpha = 255;
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg.FBStartAdress = 0xC0000000;
pLayerCfg.ImageWidth = 1366;
pLayerCfg.ImageHeight = 768;
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
/* USER CODE END LTDC_Init 2 */
}
I use QSPI in memorymapped mode. QSPI_CLK=100MHZ
void MX_QUADSPI_Init(void)
{
/* USER CODE BEGIN QUADSPI_Init 0 */
/* USER CODE END QUADSPI_Init 0 */
/* USER CODE BEGIN QUADSPI_Init 1 */
/* USER CODE END QUADSPI_Init 1 */
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 4;
hqspi.Init.FifoThreshold = 4;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
hqspi.Init.FlashSize = 24;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_3;
hqspi.Init.FlashID = QSPI_FLASH_ID_1;
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN QUADSPI_Init 2 */
if (W25Q256FV_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
if (W25Q256FV_QSPI_EnableMemoryMappedMode(&hqspi) != HAL_OK)
{
Error_Handler();
}
HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
/* USER CODE END QUADSPI_Init 2 */
}
I use SDRAM with 133MHZ clock.
void MX_FMC_Init(void)
{
/* USER CODE BEGIN FMC_Init 0 */
FMC_SDRAM_CommandTypeDef FMC_SDRAMCommand;
/* USER CODE END FMC_Init 0 */
FMC_SDRAM_TimingTypeDef SdramTiming = {0};
/* USER CODE BEGIN FMC_Init 1 */
/* USER CODE END FMC_Init 1 */
/** Perform the SDRAM1 memory initialization sequence
*/
hsdram1.Instance = FMC_SDRAM_DEVICE;
/* hsdram1.Init */
hsdram1.Init.SDBank = FMC_SDRAM_BANK1;
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9;
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13;
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_PERIOD_2;
hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;
/* SdramTiming */
SdramTiming.LoadToActiveDelay = 2;
SdramTiming.ExitSelfRefreshDelay = 8;
SdramTiming.SelfRefreshTime = 5;
SdramTiming.RowCycleDelay = 7;
SdramTiming.WriteRecoveryTime = 4;
SdramTiming.RPDelay = 2;
SdramTiming.RCDDelay = 2;
previously I was using this project with 800*480 LCD and worked fine.then I changed it to 1366*768 by using LVDS, changing the timing in ltdc and changing LTDC_CLK but when I update a value in touchgfx in flickers like video. what can be wrong? is there any sample for highresulotion LCD with touchgfx and H7?