Ruffian Heng embedded: enable the continuous read mode of serial nor flash in the fdcb of i.mxrt startup head

Time:2021-7-28

Hello, I’m ruffian Heng, a serious technical ruffian. What ruffian Heng introduced to you today isEnable the continuous read mode of serial nor flash in fdcb

Previous articles on serial flash transmission timingFast read Quad I / O SDR modeAndFast read Quad I / O DTR modeIn fact, the non continuous read transmission mode introduced by PI Ziheng belongs to the classic SPI working mode category, that is, any independent fast read Quad I / O data reading sequence (primary CS low validity period) must be preceded by the command subsequence (command code 0xeb / 0xec / 0xed / 0xEE), regardless of SDR or DTR mode, The command code is transmitted by IO0 signal within 8 SCK cycles (don’t underestimate these 8 SCLK cycles. For the reading timing of small data blocks, its proportion in the total transmission time can not be ignored).

We know that in the case of XIP, the CPU fetches instruction data from flash is often very random and fragmented. At this time, although L1 cache and flexspi prefetch buffer are accelerated, if you want to further improve the access performance, you can only think of ways from the underlying flash transmission sequence. There are five subsequences CMD + add + mode + dummy + read in the flash read sequence. Except that the CMD and dummy subsequences are fixed, the parameter values of other subsequences may change, and those that change cannot be optimized, so we can only find ways to write in the CMD and dummy subsequences. The continuous read mode to be introduced by ruffian Heng today is to operate on CMD subsequence:

1、 What is the continuous read mode?

Continuous read, as the name suggests, is continuous reading. In the serial flash world, continuous reading means that the command subsequence must be transmitted in the read transmission sequence except for the first CS validity period, and the command subsequence is omitted in the subsequent read transmission sequence. The following is a comparison between the non continuous read and continuous read modes in combination with the flexspi peripherals of i.mxrt:

1.1 XIP enhanced mode of flexspi

We know that NOR flash can be used as a XIP device in principle because it supports the master device to randomly read data at any address. However, because it is a serial interface, it can not directly XIP (there is no independent parallel address line, and the CPU can not address directly). Flexspi peripherals need to complete the real-time response of AHB bus reading and access at the bottom. This real-time response is the XIP feature of flexspi.

The XIP feature of flexspi can support any serial nor flash, and there are no requirements for the design of flash manufacturers. In order to improve the execution efficiency of XIP code, the XIP enhanced mode feature (actually continuous read mode) is also integrated in flexspi. As shown in the figure below, CS1 is the read timing containing CMD subsequences (i.e. the first CS). CS2 / 3 (including all subsequent CS) has less CMD subsequences than CS1, which is the continuous read access timing.

  The XIP enhanced mode feature of flexspi cannot be used for any serial nor flash, which requires the design of flash manufacturers. Flash itself must support continuous read mode

1.2 fast read Quad I / O continuous read timing

After understanding the XIP enhanced mode, let’s look at the quad I / O read SDR continuous read transmission sequence in LUT, which is composed of CMD_ SDR + RADDR_ SDR + MODE8_ SDR + DUMMY_ SDR + READ_ SDR + JMP_ ON_ CS + stop consists of seven subsequences, as shown in the table below.

Compared with non continuous read transmission sequence, this continuous read transmission sequence has two main differences:

1. Original mode8_ The parameter values in the SDR subsequence are different: this parameter value is used to inform the flash device of the current transmission type (non continuous read / continuous read). The specific value is defined by the flash manufacturer. The following figure takes cypress s25fs-s series flash as an example. 0xa0 indicates that flash needs to enter / maintain continuous read mode.

The quad I / O read DDR continuous read transmission sequence in LUT is as follows, and the difference is consistent with the previous analysis under SDR, which will not be repeated here.

2、 Continuous read feature design by different flash manufacturers

Now follow ruffian Heng to see the design of continuous read feature by several mainstream flash manufacturers(If you want to quickly confirm whether a certain flash model supports this feature, find its data manual and search “continuous read” to see if there is the following sequence diagram):

2.1 cypress s25fs-s series

The parameter value m [7:4] in the mode subsequence controls the length of the next read transmission sequence by including / excluding the command subsequence. If M [7:4] = 0xa, enter / maintain the continuous read mode, otherwise do not enter / exit.

2.2 adesto at25sl series

If the parameter value m [7:4] = 0xa in the mode subsequence, enter / maintain the continuous read mode, otherwise do not enter / exit.

2.3 core is25wp series

If the parameter value m [7:4] = 0xa in the mode subsequence, enter / maintain ax read mode (i.e. continuous read), otherwise do not enter / exit.

2.4 Huabang w25qxxjv DTR series

If the parameter value m [5:4] = 2’b10 in the mode subsequence, it will enter / maintain the continuous read mode (also called read command bypass mode on some models, such as w25qxxjw-dtr), otherwise it will not enter / exit. If you want to exit the continuous read mode, it is specially recommended in the flash data manual that the command code in the next time sequence be temporarily set to 0xff to ensure that M4 = 1, so that flash can completely return to the non continuous read mode.

Note: if the silk screen suffix of Huabang flash model is IQ, the continuous read mode is not supported; If it is im, it is supported.

2.5 trillion easy innovation gd25q series

If the parameter value m [5:4] = 2’b10 in the mode subsequence, enter / maintain the continuous read mode, otherwise do not enter / exit.

3、 Actual combat on i.mxrt1170-evk (is25wp128)

After knowing the above knowledge about continuous read mode, let’s practice it on NXP i.mxrt1170-evk board. The default connected flash is is25wp128. This flash supports continuous read mode. We can find a XIP routine in the SDK package and modify the evkmimxrt1170 in the project_ flexspi_ nor_ The fdcb startup header in the config. C file is as follows (mainly to change the LUT table). After changing the downloaded program and running in flash, the code execution efficiency should be improved (after the next QPI mode article is written, the ruffian Heng will design a use case to measure the performance together).

  • Note: it is OK to enable the continuous read mode of flash when i.mxrt is cold started, but the soft reset (NVIC_ I.mxrt under systemreset () may not start again, and some special processing needs to be done in APP / Rom. please pay attention to the subsequent articles of ruffian Heng.
const flexspi_ nor_ config_ t qspiflash_ config_ 100mhz_ sdr_ cont = {

So far, the continuous read mode that enables serial nor flash in fdcb has been introduced. Where is the applause~~~

Subscription welcome

The article will be published to me at the same timeBlog Park home pageCSDN home pageZhihu home pageWeChat official accountOn the platform.

Wechat search“Ruffian scale“Or scan the QR code below to see it for the first time on the mobile phone.