SPI Flash test system and method based on FT4222
Technical field
The present invention relates to a kind of SPI NAND Flash method of testings based on FT4222, belong to SPI NAND Flash surveys
Examination field.
Background technology
SPI NAND Flash tests are generally connected by two blocks of FPGA plates, and one piece is used as Host ends, and one piece is used as Device
Whether end, the various functions for performing different instruction testing Device ends during test by Host ends are correct.The method has 2 disadvantages
End, one is due to that the bin file that Host ends perform is burnt in ROM, therefore, it is necessary to which frequently burning, number in test process
It is tired.Second, this test can only survey function and the response of SPI under normal circumstances, some special circumstances or test content can not
Realize, underaction.
Then, Host behaviors are simulated using FT4222, the instruction that needs are performed is edited in text document, during test only
Need to change the content in text document, then by software program Load File and perform, instruction can take in any combination
Match somebody with somebody, and convenient modification, improve efficiency.
SPI protocol is a simple easily communication protocol, can all be existed on various main control chips, for connecting periphery mould
Block.Storage chip is widely used at present, and demand is big, and SPI NAND Flash have an application in various equipment, and Flash
Stability needs a large amount of tests to ensure, and SPI NAND Flash test needs substantial amounts of data reading-writing for a long time, at random
The complicated operations such as block access, so needing the method for a system to test Flash.
The content of the invention
For above-mentioned technical problem, the present invention is intended to provide a kind of SPI NAND Flash test sides based on FT4222
Method, the method for testing can test simple SPI NAND Flash reading and writing, erasing, BurnIn test (stability survey
Examination), while can also reach some special test purposes by changing test software programs code.
To achieve the above object, the present invention adopts the following technical scheme that:
SPI Flash test system based on FT4222, the test system include processor module, SPI NAND Flash
Communication connection between module, FT4222 chip modules and each module.
Connected between processor module and the FT4222 chip module by USB.
The processor module is instructed through USB transmission to FT4222 chip modules for generating test instruction, the test,
By FT4222 chip modules self-carried USB and the translation function of SPI protocol, instruction to be measured is converted into SPI forms, is transmitted to SPI
After NAND Flash module operating instructions, then by FT4222 chip modules result is transferred back on the processor module, from
And the correctness of decision instruction operation.
SPI Flash method of testing based on FT4222, the test statement that the method for testing inputs according to tester, adjust
With the FT4222 chipsets in debugging acid, for the SPI NAND Flash module configuration testing conditions of different parameters, most
Test statement is loaded into FT4222 chip modules afterwards to test the SPI NAND Flash modules.
Further, methods described specifically includes following steps:
Step 1, the instruction of test required for being inputted in processor module;
Step 2, after script file inputs, open and call debugging acid, obtain the chip being connected with processor and set
It is standby, choose FT4222 chipsets;Then SPI NAND flash modules parameters are set and test required condition, by described in
Instruction document to be measured is loaded into, and SPI NAND Flash test job is realized by the built-in function of FT4222 chip modules;
Step 3, the correctness of waveform check command operation result is observed by logic analyser.
The processor module is PC.
It is described that the instruction of test is specially required for input in processor module:A text document is created first, it is defeated
The instruction of test required for entering, if a plurality of combination needs branch to input, form is two byte hexadecimal numbers, with space every
Open, be arranged in order down, inputted with new line.
The logic analyser gathers data signal from FPGA.
The present invention has following innovation:
Host behaviors are simulated using FT4222, the instruction that needs are performed is edited in text document, is only needed during test
The content in text document to be changed, then by software program Load File and is performed, instruction can arrange in pairs or groups in any combination, and
And convenient modification, improve efficiency.
SPI protocol is a simple easily communication protocol, can all be existed on various main control chips, for connecting periphery mould
Block.Storage chip is widely used at present, and demand is big, and SPI NAND Flash have an application in various equipment, and Flash
Stability needs a large amount of tests to ensure, and SPI NAND Flash test needs substantial amounts of data reading-writing for a long time, at random
The complicated operations such as block access, so needing the method for a system to test Flash.
The method of testing can test simple SPI NAND Flash reading and writing, erasing, BurnIn test (stability
Test), while can also reach some special test purposes by changing test software programs code, such as H2Test is simulated,
The read-write of random block, various data pattern combination and test flash read-write efficiency etc., and in testing can be with
Increase test event on demand, reach automatic test function.
Brief description of the drawings
Fig. 1 is the system construction drawing of method of testing of the present invention.
Embodiment
The present invention provides a kind of SPI NAND Flash test systems based on FT4222, as shown in figure 1, the test system
System includes the communication connection between processor module, SPI NAND Flash modules, FT4222 chip modules and each module;Institute
State and connected between processor module and FT4222 chip modules by USB.
The processor module is instructed through USB transmission to FT4222 chip modules for generating test instruction, the test,
By FT4222 chip modules self-carried USB and the translation function of SPI protocol, instruction to be measured is converted into SPI forms, is transmitted to SPI
After NAND Flash module operating instructions, then by FT4222 chip modules result is transferred back on the processor module, from
And the correctness of decision instruction operation.
Based on above-mentioned test system, the present invention provides a method of testing, and the method for testing inputs according to tester
Test statement, the FT4222 chipsets in debugging acid are called, configured for the SPI NAND Flash modules of different parameters
Test condition, test statement is finally loaded into FT4222 chip modules the SPI NAND Flash modules are tested.
Specifically, methods described specifically includes following steps:
Step 1, the instruction of test required for being inputted in processor module;A plurality of single instructing combination is got up to edit
Automatic test is carried out into script, reduces cumbersome manual operation, the advantage of script;
Step 2, after script file inputs, open and call debugging acid, obtain the chip being connected with processor and set
It is standby, choose FT4222 chipsets;Then SPI NAND flash modules parameters are set and test required condition, by described in
Instruction document to be measured is loaded into, and SPI NAND Flash test job is realized by the built-in function of FT4222 chip modules;(with pin
The manner is run, and editability is strong, easy to operate)
Step 3, tested according to the operating process on interface, waveform check command is observed by logic analyser and transported
The correctness of row result.
The data signal that above-mentioned logic analyser gathers from FPGA, as chip enables, command/address latches, and read-write makes
Can, the information such as data, the correctness of check command operation result.
Programmable circuit used by the present embodiment, the design that circuit is completed with hardware description language are burnt on FPGA
Tested, programmable circuit here is conventional selection, is for testing SPI Flash here as IC design verifications.
The processor module is PC.
It is described that the instruction of test is specially required for input in processor module:A text document is created first, it is defeated
The instruction of test required for entering, if a plurality of combination needs branch to input, form is two byte hexadecimal numbers, with space every
Open, be arranged in order down, inputted with new line.
Embodiment:
1) text document is created first, the instruction of test required for inputting, if a plurality of combination needs branch to input,
Form is two byte hexadecimal numbers, is separated, is arranged in order down with space, inputted with new line.Such as:
Write order 0x02+column addr+ data
Read command 0x03/0x3b/0x6b/0xeb/0xbb+column addr+ length (two byte hexadecimals)
0x13/0x10+block/page addr
Erasing order 0xd8+block addr
2) after script file input, Debug Tool is opened, click on Scan button, open
FT4222device, then set on interface various flash parameters and test needed for condition, after the completion of click on load
File button, the instruction document created just now is loaded into, calls FT4222 built-in function to realize SPI NAND by programming
Flash test job.
3) operation result is shown in right side blank region, while can observe waveform check command by logic analyser and transport
The correctness of row result.
The method of testing can test simple SPI NAND Flash reading and writing, erasing, BurnIn test (stability
Test), at the same can also by changing test software programs code, such as it is a plurality of it is single instruct it is regular, can on demand or
Say it is according to Flash working characteristics, example is exactly described by next sentence.Combine to reach some special test mesh
, such as H2Test is simulated, and flash whole districts block sequential write read check, the read-write of random block, the write-read behaviour that address changes at random
Make, various data pattern combinations, different pieces of information such as full 0, complete 1 and random number etc., and test flash read-write effect
Can, flash write-read speed stability etc., and test event can be increased on demand in testing, reach automatic test
Function.
Described above is only the preferred embodiment of the present invention, it should be pointed out that:For the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
It is considered as protection scope of the present invention.