Piziheng embedded: enable serial nor flash continuous read mode in i.mxrt boot fdcb
Ruffian balance 2021-06-04 10:43:08

Hello everyone , I'm ruffian Heng , It's a serious technical ruffian . What the ruffian Heng introduced to you today is stay FDCB Enable serial in NOR Flash Of Continuous read Pattern .

Previously on serial Flash Transmission timing article 《Fast Read Quad I/O SDR Pattern 》 And 《Fast Read Quad I/O DTR Pattern 》, What ruffian Heng introduced is actually a classic SPI Under the working mode category Non-Continuous read transmission mode , That is, any independent Fast Read Quad I/O Read data timing ( once CS Low effective period ), All must be Command Subsequence ( Command code 0xEB/0xEC/0xED/0xEE) Go ahead , And whether it SDR still DTR Pattern , All command codes are in 8 individual SCK By IO0 Signal transmission ( Don't look down on this 8 individual SCLK cycle , For small block read timing , Its proportion in the total transmission time can not be ignored ).

We know that XIP Under the circumstances CPU from Flash The instruction data is often very random and fragmented , Although there is L1 Cache And FlexSPI Prefetch Buffer Speed up , But if you want to further improve access performance , Only from Flash There's something in the underlying transport sequence .Flash There are five subsequences in the reading sequence CMD + ADDR + MODE + DUMMY + READ, Besides CMD and DUMMY The subsequence is fixed , Other subsequence parameter values may change , What will change cannot be optimized , So we have to find a way to CMD and DUMMY In subsequences . Today, ruffian Heng is going to introduce Continuous read The pattern is to take CMD Subsequence surgery :

One 、 What is? Continuous read Pattern ?

Continuous read As the name suggests, it is continuous reading . In serial Flash In the world , Continuous reading means to read the transmission sequence except for the first time CS The validity period must be transmitted Command Subsequence , All subsequent read and transfer sequences are omitted Command Subsequence . Below the ruffian balance i.MXRT Of FlexSPI Peripherals Non-Continuous read And Continuous read The difference between patterns :

1.1 FlexSPI Of XIP Enhanced Mode

We know NOR Flash Because it supports the master device to read the data at any address at random , So in principle it can be used as XIP equipment . But because it's a serial interface , So not directly XIP( There are no independent parallel address lines ,CPU No direct addressing ), need FlexSPI Peripherals are done at the bottom AHB Real time response of bus read access , The real-time response job is FlexSPI Of XIP characteristic .

FlexSPI Of XIP Feature can support any serial NOR Flash, Yes Flash The manufacturer's design doesn't require . In order to improve XIP Code execution efficiency ,FlexSPI It also integrates XIP Enhanced Mode characteristic ( In fact, that is Continuous read Pattern ), See the picture below ,CS1 Is included CMD Read timing of subsequences ( For the first time CS),CS2/3( Including all the following CS) comparison CS1 Less CMD Subsequence , This is it. Continuous read Access timing .

FlexSPI Of XIP Enhanced Mode Feature can't be used for any serial NOR Flash, This is right Flash The manufacturer's design has requirements , must Flash It supports Continuous read The pattern is good .

1.2 Fast Read Quad I/O Continuous read sequential

I understand XIP Enhanced Mode, Let's see LUT in Quad I/O Read SDR Continuous read Transmission sequence , It consists of CMD_SDR + RADDR_SDR + MODE8_SDR + DUMMY_SDR + READ_SDR + JMP_ON_CS + STOP Seven subsequences make up , As shown in the following table .

This Continuous read Compared to the transmission sequence Non-Continuous read There are two main differences in transmission timing :

1. primary MODE8_SDR Parameter values are different in subsequences : This parameter value is used to inform Flash The current transmission type of the device (Non-Continuous read/Continuous read), The specific value is determined by Flash Manufacturer definition . The picture below is based on Cypress S25FS-S series Flash As an example of ,0xA0 indicate Flash Entry required / keep Continuous read Pattern .
2. Added JMP_ON_CS Subsequence : The subsequence is FlexSPI Peripheral implementation Continuous read At the heart of , for the first time CS In the effective transmission sequence CMD_SDR Subsequence command codes are automatically stored in subsequence parameter values , So the subsequent transmission FlexSPI You don't have to send any more command codes .

LUT in Quad I/O Read DDR Continuous read The transmission sequence is as follows , The difference is the same as before SDR The analysis is consistent , I won't go into details here .

Two 、 Different Flash About Continuous read Feature design

Now follow ruffian Heng to see some mainstream Flash About Continuous read The design of features ( If you want to quickly confirm a model Flash Whether this feature is supported or not , Find its data book search "Continuous read" Let's see if we have the following sequence diagram ):

2.1 Cypress S25FS-S series

MODE Parameter values in subsequences M[7:4] By including / It doesn't contain Command Subsequence to control the length of the next read transmission sequence ,M[7:4] = 0xA entering / keep Continuous Read Pattern , Otherwise don't go in / sign out .

2.2 Adesto AT25SL series

MODE Parameter values in subsequences M[7:4] = 0xA entering / keep Continuous Read Pattern , Otherwise don't go in / sign out .

2.3 Core into IS25WP series

MODE Parameter values in subsequences M[7:4] = 0xA entering / keep AX Read Pattern ( Namely Continuous Read), Otherwise don't go in / sign out .

2.4 Huabang W25QxxJV-DTR series

MODE Parameter values in subsequences M[5:4] = 2'b10 entering / keep Continuous Read Pattern , Otherwise don't go in / sign out . If you want to quit Continuous Read Pattern ,Flash It is specially recommended in the data manual that the command code should be temporarily set to 0xFF, In order to make sure M4=1 bring Flash Go back to Non-Continuous Read Pattern .

2.5 Trillion easy innovation GD25Q series

MODE Parameter values in subsequences M[5:4] = 2'b10 entering / keep Continuous Read Pattern , Otherwise don't go in / sign out .

3、 ... and 、 stay i.MXRT1170-EVK On the actual combat (IS25WP128)

Understand the above about Continuous read After pattern knowledge , We're at NXP i.MXRT1170-EVK Practice on the board . Default connected Flash yes IS25WP128, This kind of Flash It's supporting Continuous read Mode , We're free to SDK Find one in the bag XIP routine , In the modification project evkmimxrt1170_flexspi_nor_config.c In the file FDCB The startup header is as follows ( The main thing is to change LUT surface ), After changing the download program, I'll go to Flash function , The efficiency of code execution should be improved ( Wait for the next one QPI The model article is finished , PI Ziheng will design a use case to measure the performance together ).

const flexspi_nor_config_t qspiflash_config_100mhz_sdr_cont = {
.memConfig =
.readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
// Enable Safe configuration
.controllerMiscOption = 0x10,
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_100MHz,
.sflashA1Size = 16u * 1024u * 1024u,
.lookupTable =
// Fast Read Quad I/O LUTs
// MODE8_SDR Fill in the values of the parameters 0xA0
// increase JMP_ON_CS Subsequence
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 256u * 1024u,
.isUniformBlockSize = false,

thus , stay FDCB Enable serial in NOR Flash Of Continuous read The introduction of the mode ruffian Heng is finished , Where is the applause ~~~

Welcome to subscribe to

The article will also be posted to my Blog Park home page CSDN Home page Zhihu Homepage WeChat official account On the platform .

WeChat search " Ruffian scale embedded " Or scan the QR code below , You can watch it for the first time on your mobile phone .

Please bring the original link to reprint ,thank
Similar articles