cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4x9 FMC Speed Issues

ricardomadera
Associate II
Posted on December 08, 2016 at 19:01

So I finally got my IL9325 TFT display running via FMC but it is running much slower than I expected. The SPI based displays on arduinos seem to be performing better than this parallel setup. I measured my data pulse width to be around 20us. Is this the limit of the FMC(settings below)? I am running my clock at 168Mhz, HSE=24Mhz M = 12, N = 168 , P = 2, Q = 7, AHB =1, APB1 = 4, APB2 = 2. If the FMC should be running faster, what should I be looking into?

FMC_NORSRAMTimingInitStructure.FMC_AddressSetupTime = 15; /* Address Setup Time */  FMC_NORSRAMTimingInitStructure.FMC_AddressHoldTime = 0;  FMC_NORSRAMTimingInitStructure.FMC_DataSetupTime = 15; /* Data Setup Time */  FMC_NORSRAMTimingInitStructure.FMC_BusTurnAroundDuration = 0;  FMC_NORSRAMTimingInitStructure.FMC_CLKDivision = 0;  FMC_NORSRAMTimingInitStructure.FMC_DataLatency = 0;  FMC_NORSRAMTimingInitStructure.FMC_AccessMode = FMC_AccessMode_A; /* FSMC Access Mode */  FMC_NORSRAMInitStructure.FMC_Bank = FMC_Bank1_NORSRAM4;  FMC_NORSRAMInitStructure.FMC_DataAddressMux = FMC_DataAddressMux_Disable;  FMC_NORSRAMInitStructure.FMC_MemoryType = FMC_MemoryType_SRAM;  FMC_NORSRAMInitStructure.FMC_MemoryDataWidth = FMC_NORSRAM_MemoryDataWidth_16b;  FMC_NORSRAMInitStructure.FMC_BurstAccessMode = FMC_BurstAccessMode_Disable;  FMC_NORSRAMInitStructure.FMC_WaitSignalPolarity = FMC_WaitSignalPolarity_Low;  FMC_NORSRAMInitStructure.FMC_WrapMode = FMC_WrapMode_Disable;  FMC_NORSRAMInitStructure.FMC_WaitSignalActive = FMC_WaitSignalActive_BeforeWaitState;  FMC_NORSRAMInitStructure.FMC_WriteOperation = FMC_WriteOperation_Enable;  FMC_NORSRAMInitStructure.FMC_WaitSignal = FMC_WaitSignal_Disable;  FMC_NORSRAMInitStructure.FMC_AsynchronousWait = FMC_AsynchronousWait_Disable;  FMC_NORSRAMInitStructure.FMC_ExtendedMode = FMC_ExtendedMode_Disable;  FMC_NORSRAMInitStructure.FMC_WriteBurst = FMC_WriteBurst_Disable;  FMC_NORSRAMInitStructure.FMC_ReadWriteTimingStruct = &FMC_NORSRAMTimingInitStructure;  FMC_NORSRAMInit(&FMC_NORSRAMInitStructure);  /* FSMC Write Timing */  FMC_NORSRAMTimingInitStructure.FMC_AddressSetupTime = 5;//2;//1; /* Address Setup Time */  FMC_NORSRAMTimingInitStructure.FMC_AddressHoldTime = 0;  FMC_NORSRAMTimingInitStructure.FMC_DataSetupTime = 5;//2;//1; /* Data Setup Time */  FMC_NORSRAMTimingInitStructure.FMC_BusTurnAroundDuration = 0x00;  FMC_NORSRAMTimingInitStructure.FMC_CLKDivision = 0;  FMC_NORSRAMTimingInitStructure.FMC_DataLatency = 0x00;  FMC_NORSRAMTimingInitStructure.FMC_AccessMode = FMC_AccessMode_A; /* FSMC Access Mode */  FMC_NORSRAMInitStructure.FMC_WriteTimingStruct = &FMC_NORSRAMTimingInitStructure; FMC_NORSRAMInit(&FMC_NORSRAMInitStructure);�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

#fmc #stm32f429/39 #fmc-speed #fmc-setup

Note: this post was migrated and contained many threaded conversations, some content may be missing.
27 REPLIES 27
ST Renegade
Senior
Posted on December 08, 2016 at 19:12

Hello lampii,

I don't have experiences with your type of memory, I've played only with SDRAM's and NAND Flash, however take a look on application note 

http://www.st.com/content/ccc/resource/technical/document/application_note/ae/02/78/1b/b9/2d/43/4d/DM00129600.pdf/files/DM00129600.pdf/jcr:content/translations/en.DM00129600.pdf

, where you can find how to configure your SRAM... this can help a lot in my opinion.

Good luck,

Renegade

ricardomadera
Associate II
Posted on December 08, 2016 at 19:16

Hello Renegade,

Thank you for the response. I will take a look at AN4570 to see if I can find any clues.

My setup is essentially the same as the 8080 diagram on

http://www.st.com/content/ccc/resource/technical/document/application_note/85/ad/ef/0f/a3/a6/49/9a/CD00201397.pdf/files/CD00201397.pdf/jcr:content/translations/en.CD00201397.pdf

.
ricardomadera
Associate II
Posted on December 08, 2016 at 19:27

Hmm. My setup is very similar and it was derived from 2790. But i don't understand why my pulse width is at 20us rather than ns. I modified my system_stm32f4xx.c file to incorporate the clock settings above. These were selected using the CubeMX, but I should note that I am using the SPL.

Posted on December 08, 2016 at 19:30

Wouldn't you need two structures here for the read/write, you are initializing things twice, the last call reconfiguring the read/write identically.

Your description of the bus speed is very slow, you'd want to review your internal clock setting, and perhaps export and verify via MCO pin and a scope.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ricardomadera
Associate II
Posted on December 08, 2016 at 20:14

Hi Clive, 

Thanks for pointing that out! I fixed the initialization but I still get the same behavior.

I also went through each of my clocks usings MCO1&2.

HSE = 24Mhz

SysClock/2 = 83.3Mhz

PLLCLK/2 = 83.3Mhz

PLL2SCLK = reported no waveform

ricardomadera
Associate II
Posted on December 08, 2016 at 20:40

Interesting let me look into PLL2SCLK initialization. I used Cube MX to compute the PLL values and prescalers but I am running a SPL library project as I am more familiar with it than HAL. According to Cube MX, I can't set the frequency to 180Mhz because I am using a 24Mhz HSE rather than a 25Mhz (its in the mail). I am operating under the assumption that the value for SYSCLK/HCLK from CubeMX is set to SystemCoreClock. 

Posted on December 08, 2016 at 20:22

Any Ideas why PLL2SCLK would not show a waveform? I am able to use APB2 peripherals.

Posted on December 08, 2016 at 20:33

Most probably your PLLI2SCLK is not enabled, thus you see no waveform on the output. Have a look into CubeMX.

Try one thing, generate a project using CubeMX and configure your timings according to the app note I gave you and run your project from there. If you achieve your result, comare the code with yours and make the adjustments... in my opinion this is the fastest approach.

Btw. the F4x9 should allow frequency up to 180 MHz, isn't it?

Renegade

Posted on December 08, 2016 at 20:45

You are right Renegade. I am not using PLLI2SCK. So if my clock values are correct, what else could be slowing down my FMC to 20uS?