2023-02-07 06:00 AM
I needed help getting started with Stm32 L496 processor interface with IS29GL064 nor flash mem.
It's my first time interfacing with any external memory. I have decided to use FMC controller to drive this flash mem.
But unaware of how to setup the configuration details. I searched the net and STCommunity. I got to know that CLK setup and configuration bits play a key role here. But could not figure out the exact values.
I am able to generate the FMC code thru stm32CubeMX.
I did a trial test to read manufacturer id from the flash, but I got no response.
I feel I am unable to correctly configure the control information.(datasetup time, addrr hold time etc)
Below is the code I have used in keil ide.
hnor1.Instance = FMC_NORSRAM_DEVICE;
hnor1.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
/* hnor1.Init */
hnor1.Init.NSBank = FMC_NORSRAM_BANK1;
hnor1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE;
hnor1.Init.MemoryType = FMC_MEMORY_TYPE_NOR;
hnor1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16;
hnor1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE;
hnor1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
hnor1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS;
hnor1.Init.WriteOperation = FMC_WRITE_OPERATION_DISABLE;
hnor1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE;
hnor1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE;
hnor1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_ENABLE;
hnor1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE;
hnor1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;
hnor1.Init.WriteFifo = FMC_WRITE_FIFO_ENABLE;
hnor1.Init.PageSize = FMC_PAGE_SIZE_NONE;
/* Timing */
Timing.AddressSetupTime = 15;
Timing.AddressHoldTime = 0;
Timing.DataSetupTime = 250;
Timing.BusTurnAroundDuration = 15;
Timing.CLKDivision = 16;
Timing.DataLatency = 17;
Timing.AccessMode = FMC_ACCESS_MODE_A;
Can anyone please help me?
2023-02-23 07:39 AM
Hello @KMINH.1 ,
I advise you to get inspired from the available example FMC_NOR in the STM32CubeL4 MCU package.
I hope this example help you!
Kaouthar
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.
2023-02-23 09:29 AM
Surely some of the timing parameters are in CYCLES not "time", based on how you're clocking the FMC and dividing down that clock. Some of these times in this context look ridiculously long.
On the L4, use of QSPI NOR would make so much more sense..
2023-02-27 04:50 AM
Thanks Kaouthar, Tesla for the response.
I am reading the FMC example from the link. I will comeback when am done tetsing.
Tesla, I am using asynchronous flash. So I think FMC clock is not needed, I hope ( may be I am wrong).
Also, I am trying to replace parallel nor flash. So I have no choice, but to use parallel interface.