Skip to main content
Explorer II
September 22, 2025
Solved

Can I use the STM32F407VET6 FSMC to write to a ILI9341 display driver to control an LCD?

  • September 22, 2025
  • 1 reply
  • 417 views

Sorry, I'm very new to microcontrollers in general and was wondering if I would need more SRAM or if I could successfully just write to the display driver's memory and not worry about a big frame buffer. I hope to use LVGL to control a 320x240 16 bit colour depth display using this method, any help on this topic would be greatly appreciated, thank you.

For reference, the reason I'm interested in doing this is because I'm using the STM32 F4VE Black board and I can see it has a TFT interface.

Best answer by mƎALLEm

Hello,

Yes you can use FSMC to drive ILI9341 display.

A video from Youtube.

You can also refer to the implementation and inspire from the ILI9341 driver on the STM324G_EVAL

You can also refer to the BSP example and use: https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Projects/STM324xG_EVAL/Examples/BSP/Src/lcd.c

The FSMC intilization is provided in stm324xg_eval.c / LCD_IO_Init() that calls FSMC_BANK3_Init():

static void FSMC_BANK3_Init(void) 
{ 
 SRAM_HandleTypeDef hsram;
 FSMC_NORSRAM_TimingTypeDef SRAM_Timing;
 
 /*** Configure the SRAM Bank 3 ***/ 
 /* Configure IPs */
 hsram.Instance = FMC_NORSRAM_DEVICE;
 hsram.Extended = FMC_NORSRAM_EXTENDED_DEVICE;

 SRAM_Timing.AddressSetupTime = 5;
 SRAM_Timing.AddressHoldTime = 1;
 SRAM_Timing.DataSetupTime = 9;
 SRAM_Timing.BusTurnAroundDuration = 0;
 SRAM_Timing.CLKDivision = 2;
 SRAM_Timing.DataLatency = 2;
 SRAM_Timing.AccessMode = FSMC_ACCESS_MODE_A;
 
 hsram.Init.NSBank = FSMC_NORSRAM_BANK3;
 hsram.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE;
 hsram.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM;
 hsram.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_16;
 hsram.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE;
 hsram.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW;
 hsram.Init.WrapMode = FSMC_WRAP_MODE_DISABLE;
 hsram.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
 hsram.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
 hsram.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
 hsram.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE;
 hsram.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
 hsram.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
 hsram.Init.PageSize = FSMC_PAGE_SIZE_NONE;

 /* Initialize the SRAM controller */
 FSMC_BANK3_MspInit();
 HAL_SRAM_Init(&hsram, &SRAM_Timing, &SRAM_Timing); 
}

You may need to change the FSMC timings if needed.

Hope that helps.

 

1 reply

mƎALLEm
mƎALLEmBest answer
Technical Moderator
September 22, 2025

Hello,

Yes you can use FSMC to drive ILI9341 display.

A video from Youtube.

You can also refer to the implementation and inspire from the ILI9341 driver on the STM324G_EVAL

You can also refer to the BSP example and use: https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Projects/STM324xG_EVAL/Examples/BSP/Src/lcd.c

The FSMC intilization is provided in stm324xg_eval.c / LCD_IO_Init() that calls FSMC_BANK3_Init():

static void FSMC_BANK3_Init(void) 
{ 
 SRAM_HandleTypeDef hsram;
 FSMC_NORSRAM_TimingTypeDef SRAM_Timing;
 
 /*** Configure the SRAM Bank 3 ***/ 
 /* Configure IPs */
 hsram.Instance = FMC_NORSRAM_DEVICE;
 hsram.Extended = FMC_NORSRAM_EXTENDED_DEVICE;

 SRAM_Timing.AddressSetupTime = 5;
 SRAM_Timing.AddressHoldTime = 1;
 SRAM_Timing.DataSetupTime = 9;
 SRAM_Timing.BusTurnAroundDuration = 0;
 SRAM_Timing.CLKDivision = 2;
 SRAM_Timing.DataLatency = 2;
 SRAM_Timing.AccessMode = FSMC_ACCESS_MODE_A;
 
 hsram.Init.NSBank = FSMC_NORSRAM_BANK3;
 hsram.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE;
 hsram.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM;
 hsram.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_16;
 hsram.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE;
 hsram.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW;
 hsram.Init.WrapMode = FSMC_WRAP_MODE_DISABLE;
 hsram.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
 hsram.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
 hsram.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
 hsram.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE;
 hsram.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
 hsram.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
 hsram.Init.PageSize = FSMC_PAGE_SIZE_NONE;

 /* Initialize the SRAM controller */
 FSMC_BANK3_MspInit();
 HAL_SRAM_Init(&hsram, &SRAM_Timing, &SRAM_Timing); 
}

You may need to change the FSMC timings if needed.

Hope that helps.

 

"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."