cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7B3i-EVAL Determining NOR Flash timing

CedricB
Associate II

Hello,

I have 2 EVAL board, one STM32H743i-EVAL2 and one STM32H7B3i-EVAL.

Both have the same NOR Flash chipset MT28EW128.

I'm using the function HAL_NOR_ReadBuffer to read data from the NOR.

but, "sometimes", the data I read are corrupt.

I made my project using an IOC that I configured myself by copying the configuration and timing I found in the BSP example.

The problem is that I cannot find all the configuration parameters in the IOC.

In the BSP example they configure these timing:

AddressSetupTime, AddressHoldTime, DataSetupTime, BusTurnAroundDuration, CLKDivision, DataLatency, AccessMode

But in the IOC I can only configure these 3: AddressSetupTime, DataSetupTime, BusTurnAroundDuration.

The other timing are automatically configured by the code generator and those timing does not match the BSP code example.

Also, I compared the FMC NOR timing of the BSP examples for STM32H743i-EVAL2 and STM32H7B3i-EVAL

To me, those timing does not match, despite the NOR chipset being the same on both board.

Let's take an example:

STM32H743i-EVAL2

Timing.AddressSetupTime = 9;

@ 200Mhz according to the FMC clock = 45ns

Timing.DataSetupTime = 5;

@ 200Mhz according to the FMC clock = 25ns

STM32H7B3i-EVAL

Timing.AddressSetupTime = 9;

@ 280Mhz according to the FMC clock = 32ns

@ 93.33Mhz according to the source code comment = 96ns

Timing.DataSetupTime = 20;

@ 280Mhz according to the FMC clock = 71ns

@ 93.33Mhz according to the source code comment = 214ns

And I can't figure out how to determine these timings depending on the NOR chipset datasheet which have several timing which doesn't match those I can find in the BSP example.

Also, why does the BPS example talk about 93.33Mhz for the NOR clock when 280Mhz is configured, I cannot find where is this "3" divisor. (or does this have to do with the CAS 3 latency of the SDRAM ?)

I'm afraid that when I will start making my own board with another NOR chipset, I might be stuck with determining those timings.

If anyone can explain me, or point me to a thread or documentation or tutorial talking about this subject, thank you very much.

3 REPLIES 3

On the H7 the FMC clock should be configurable as HCLK/2 or HCLK/3, it should be a specific setting, unrelated to RAS/CAS

Mainly as the Pin's IO Drivers (transistor level) are rated much above 100 MHz

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

FMC_BTRx CLKDIV (x = BANK)

0693W00000QLlkWQAT.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

> The problem is that I cannot find all the configuration parameters in the IOC.

Then simply don't use Cube/CubeMX. You surely want control which is rarely achieved by clicking. Start from the FLASH DS and the FMC chapter in RM, calculate your parameters, set up the couple of FMC registers needed, and verify by measuring.

JW