[go: up one dir, main page]

CN107331421A - A kind of SD card test system and method based on FPGA - Google Patents

A kind of SD card test system and method based on FPGA Download PDF

Info

Publication number
CN107331421A
CN107331421A CN201710477868.4A CN201710477868A CN107331421A CN 107331421 A CN107331421 A CN 107331421A CN 201710477868 A CN201710477868 A CN 201710477868A CN 107331421 A CN107331421 A CN 107331421A
Authority
CN
China
Prior art keywords
fpga
module
card
response
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710477868.4A
Other languages
Chinese (zh)
Inventor
张磊
胡亚平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 41 Research Institute
Original Assignee
CETC 41 Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CETC 41 Research Institute filed Critical CETC 41 Research Institute
Priority to CN201710477868.4A priority Critical patent/CN107331421A/en
Publication of CN107331421A publication Critical patent/CN107331421A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/56External testing equipment for static stores, e.g. automatic test equipment [ATE]; Interfaces therefor
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/02Detection or location of defective auxiliary circuits, e.g. defective refresh counters
    • G11C29/022Detection or location of defective auxiliary circuits, e.g. defective refresh counters in I/O circuitry
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/56External testing equipment for static stores, e.g. automatic test equipment [ATE]; Interfaces therefor
    • G11C29/56012Timing aspects, clock generation, synchronisation
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/56External testing equipment for static stores, e.g. automatic test equipment [ATE]; Interfaces therefor
    • G11C2029/5602Interface to device under test

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

本发明提出了一种基于FPGA的SD卡测试系统,FPGA内部控制电路包括时钟发生与管理模块、PRBS图形发生模块、发送模块、接收模块、命令控制模块、数据处理模块、序列同步模块以及接口控制模块;FPGA通过接口控制模块接收上位机的命令,并将命令或者数据送至数据处理模块;数据处理模块判断命令后进行下一步操作,当正常发送接收测试和命令测试时,PRBS图形发生模块以及序列同步模块不使能,接收数据直接由接收模块发送至数据处理模块;当上位机选择误码测试时,PRBS图形发生模块与序列同步模块启用。本发明的测试系统及方法可以对SD卡进行单条指令测试,灵活性高,而且满足长时间高速测试要求。

The present invention proposes a FPGA-based SD card testing system. The FPGA internal control circuit includes a clock generation and management module, a PRBS graphic generation module, a sending module, a receiving module, a command control module, a data processing module, a sequence synchronization module and an interface control module. module; the FPGA receives commands from the host computer through the interface control module, and sends the commands or data to the data processing module; the data processing module proceeds to the next step after judging the commands. The sequence synchronization module is not enabled, and the received data is directly sent from the receiving module to the data processing module; when the host computer selects the bit error test, the PRBS pattern generation module and the sequence synchronization module are enabled. The test system and method of the present invention can perform a single command test on the SD card, has high flexibility, and meets the long-time high-speed test requirements.

Description

一种基于FPGA的SD卡测试系统及方法A FPGA-based SD card testing system and method

技术领域technical field

本发明涉及测试技术领域,特别涉及一种基于FPGA的SD卡测试系统,还涉及一种基于FPGA的SD卡测试方法。The invention relates to the technical field of testing, in particular to an FPGA-based SD card testing system, and also relates to an FPGA-based SD card testing method.

背景技术Background technique

随着信息时代的到来,智能手机也成了人们办公、交流、娱乐的工具,伴随而来的就是大量手机软件的出现,这对各种移动设备的存储要求更高了,而SD(SecUre DigitalMemory Card)卡作为大容量存储器得到了越来越广泛地应用。With the advent of the information age, smart phones have become a tool for people to work, communicate, and entertain, accompanied by the emergence of a large number of mobile phone software, which requires higher storage for various mobile devices, and SD (SecUre Digital Memory) Card) cards have been used more and more widely as mass storage.

SD卡的性能好坏直接关系到人们生产和生活中正在进行的工作的安全性和可靠性,一方面由于闪存卡和U盘的结构简单、技术门槛低,并且有大量的闪存颗粒残次品销往中国;另一方面正品厂家由于移动存储产品的利润单薄,减少打假投入,这些主观和客观因素都造成伪劣闪存卡和U盘的泛滥成灾。所以,SD卡的性能验证和测试就显得尤其重要。The performance of the SD card is directly related to the safety and reliability of the ongoing work in people's production and life. On the other hand, due to the thin profit of mobile storage products, manufacturers of authentic products have reduced investment in anti-counterfeiting. These subjective and objective factors have caused the proliferation of fake and inferior flash memory cards and U disks. Therefore, the performance verification and testing of SD cards is particularly important.

目前,测试SD卡的方式主要有两种,一种是使用SD卡控制器的电路模块或相应芯片,比如SD卡读卡器;第二种是将I/O口直接与SD卡接口进行连接,从而用软件模拟SD卡的时序来控制其读写,比如一些单片机有专门的SD卡接口。At present, there are two main ways to test the SD card, one is to use the circuit module of the SD card controller or the corresponding chip, such as an SD card reader; the second is to directly connect the I/O port to the SD card interface , so as to use software to simulate the timing of the SD card to control its reading and writing. For example, some single-chip microcomputers have a special SD card interface.

使用专用的SD卡控制芯片的方式增加了电路的复杂度,提高了设计成本。而直接用软件测试虽然降低了成本和复杂度,但是传输速率不高,无法满足高速率连续测试。The method of using a dedicated SD card control chip increases the complexity of the circuit and increases the design cost. Although direct software testing reduces the cost and complexity, the transmission rate is not high enough to meet high-speed continuous testing.

发明内容Contents of the invention

为解决上述现有技术的不足,本发明提出了一种基于FPGA的SD卡测试系统及方法,不仅可以对SD卡读写测试,还可以对SD卡进行单条指令测试和误码测试。In order to solve the above-mentioned deficiencies in the prior art, the present invention proposes a FPGA-based SD card testing system and method, which can not only test the SD card for reading and writing, but also perform single instruction testing and bit error testing on the SD card.

本发明的技术方案是这样实现的:Technical scheme of the present invention is realized like this:

一种基于FPGA的SD卡测试系统,FPGA内部控制电路包括时钟发生与管理模块、PRBS图形发生模块、发送模块、接收模块、命令控制模块、数据处理模块、序列同步模块以及接口控制模块;A FPGA-based SD card testing system, the FPGA internal control circuit includes a clock generation and management module, a PRBS graphic generation module, a sending module, a receiving module, a command control module, a data processing module, a sequence synchronization module and an interface control module;

FPGA通过接口控制模块接收上位机的命令,并将命令或者数据送至数据处理模块;The FPGA receives commands from the host computer through the interface control module, and sends the commands or data to the data processing module;

数据处理模块判断命令后进行下一步操作,当正常发送接收测试和命令测试时,PRBS图形发生模块以及序列同步模块不使能,接收数据直接由接收模块发送至数据处理模块;当上位机选择误码测试时,PRBS图形发生模块与序列同步模块启用。The data processing module proceeds to the next step after judging the command. When the normal sending and receiving test and command test are performed, the PRBS graphic generation module and the sequence synchronization module are not enabled, and the received data is directly sent from the receiving module to the data processing module; During the code test, the PRBS pattern generation module and the sequence synchronization module are enabled.

可选地,对SD卡单条指令测试分为两个阶段:第一个阶段为初始化阶段,第二个阶段为数据传输阶段。Optionally, the single instruction test of the SD card is divided into two stages: the first stage is an initialization stage, and the second stage is a data transmission stage.

可选地,所述初始化阶段具体过程如下:Optionally, the specific process of the initialization phase is as follows:

步骤1:FPGA先发送CMD0命令;Step 1: FPGA sends CMD0 command first;

步骤2:FPGA发送CMD8命令,等待SD卡响应;若超时后无响应,FPGA返回状态字0x01,并进行步骤3;若响应正确,则FPGA进行步骤3;若响应错误,则FPGA返回状态字0x02,停止测试;Step 2: FPGA sends CMD8 command and waits for SD card response; if there is no response after timeout, FPGA returns status word 0x01, and proceeds to step 3; if the response is correct, FPGA proceeds to step 3; if the response is wrong, FPGA returns status word 0x02 , to stop the test;

步骤3:FPGA发送CMD55+ACMD41命令等待SD卡响应;如果无响应,则FPGA返回状态字0x03,停止测试;如果响应为busy,则FPGA重复步骤3;如果响应为ready,则进行步骤4,并根据状态存储器中状态字判断出SD卡的类型;Step 3: The FPGA sends the CMD55+ACMD41 command and waits for the SD card to respond; if there is no response, the FPGA returns the status word 0x03 and stops the test; if the response is busy, the FPGA repeats step 3; if the response is ready, proceed to step 4, and Judge the type of the SD card according to the state word in the state memory;

步骤4:FPGA发送CMD2命令等待响应;无响应,则FPGA返回状态字0x04,停止测试;有响应,则FPGA存储响应值,该响应值为SD卡的CID信息,然后进入步骤5;Step 4: The FPGA sends the CMD2 command and waits for a response; if there is no response, the FPGA returns the status word 0x04 and stops the test; if there is a response, the FPGA stores the response value, which is the CID information of the SD card, and then enters step 5;

步骤5:FPGA发送CMD3命令等待响应;无响应,则FPGA返回状态字0x05,停止测试;有相应,则FPGA存储响应值,该响应值为卡的相对地址,在传输阶段需要用到该值,然后进入步骤6;Step 5: FPGA sends the CMD3 command and waits for a response; if there is no response, the FPGA returns the status word 0x05 and stops the test; if there is a response, the FPGA stores the response value, which is the relative address of the card, which is needed in the transmission phase. Then go to step 6;

步骤6:初始化阶段完成进入数据传输阶段,等待上位机指令。Step 6: After the initialization phase is completed, enter the data transmission phase and wait for the instructions from the host computer.

可选地,所述数据传输阶段完全由上位机发送操作指令,FPGA控制实现SD卡测试;Optionally, in the data transmission stage, the host computer sends operation instructions completely, and the FPGA control realizes the SD card test;

上位机操作包括传输速率选择、SD卡模式选择、误码测试以及PRBS码型选择;The host computer operation includes transmission rate selection, SD card mode selection, bit error test and PRBS pattern selection;

FPGA中的数据处理模块进行数据的传输以及状态判断,上位机根据状态字显示状态。The data processing module in the FPGA performs data transmission and state judgment, and the host computer displays the state according to the state word.

可选地,所述时钟发生与管理模块测试SD卡在不同传输速率下的性能;Optionally, the clock generation and management module tests the performance of the SD card at different transfer rates;

上位机设置好传输速率后将控制字发送至下位机,时钟发生与管理模块根据控制字产生所需要的时钟发送至SD卡的时钟引脚;在不同速率下选择相同的PRBS序列,经过相同一段时间后根据误码率判断传输性能。After setting the transmission rate, the upper computer sends the control word to the lower computer, and the clock generation and management module generates the required clock according to the control word and sends it to the clock pin of the SD card; select the same PRBS sequence at different rates, and go through the same period After a period of time, the transmission performance is judged according to the bit error rate.

本发明还提出了一种基于FPGA的SD卡测试方法,FPGA内部控制电路包括时钟发生与管理模块、PRBS图形发生模块、发送模块、接收模块、命令控制模块、数据处理模块、序列同步模块以及接口控制模块;The present invention also proposes a method for testing SD cards based on FPGA. The FPGA internal control circuit includes a clock generation and management module, a PRBS graphic generation module, a sending module, a receiving module, a command control module, a data processing module, a sequence synchronization module and an interface. control module;

FPGA通过接口控制模块接收上位机的命令,并将命令或者数据送至数据处理模块;The FPGA receives commands from the host computer through the interface control module, and sends the commands or data to the data processing module;

数据处理模块判断命令后进行下一步操作,当正常发送接收测试和命令测试时,PRBS图形发生模块以及序列同步模块不使能,接收数据直接由接收模块发送至数据处理模块;当上位机选择误码测试时,PRBS图形发生模块与序列同步模块启用。The data processing module proceeds to the next step after judging the command. When the normal sending and receiving test and command test are performed, the PRBS graphic generation module and the sequence synchronization module are not enabled, and the received data is directly sent from the receiving module to the data processing module; During the code test, the PRBS pattern generation module and the sequence synchronization module are enabled.

可选地,对SD卡单条指令测试分为两个阶段:第一个阶段为初始化阶段,第二个阶段为数据传输阶段。Optionally, the single instruction test of the SD card is divided into two stages: the first stage is an initialization stage, and the second stage is a data transmission stage.

可选地,所述初始化阶段具体过程如下:Optionally, the specific process of the initialization phase is as follows:

步骤1:FPGA先发送CMD0命令;Step 1: FPGA sends CMD0 command first;

步骤2:FPGA发送CMD8命令,等待SD卡响应;若超时后无响应,FPGA返回状态字0x01,并进行步骤3;若响应正确,则FPGA进行步骤3;若响应错误,则FPGA返回状态字0x02,停止测试;Step 2: FPGA sends CMD8 command and waits for SD card response; if there is no response after timeout, FPGA returns status word 0x01, and proceeds to step 3; if the response is correct, FPGA proceeds to step 3; if the response is wrong, FPGA returns status word 0x02 , to stop the test;

步骤3:FPGA发送CMD55+ACMD41命令等待SD卡响应;如果无响应,则FPGA返回状态字0x03,停止测试;如果响应为busy,则FPGA重复步骤3;如果响应为ready,则进行步骤4,并根据状态存储器中状态字判断出SD卡的类型;Step 3: The FPGA sends the CMD55+ACMD41 command and waits for the SD card to respond; if there is no response, the FPGA returns the status word 0x03 and stops the test; if the response is busy, the FPGA repeats step 3; if the response is ready, proceed to step 4, and Judge the type of the SD card according to the state word in the state memory;

步骤4:FPGA发送CMD2命令等待响应;无响应,则FPGA返回状态字0x04,停止测试;有响应,则FPGA存储响应值,该响应值为SD卡的CID信息,然后进入步骤5;Step 4: The FPGA sends the CMD2 command and waits for a response; if there is no response, the FPGA returns the status word 0x04 and stops the test; if there is a response, the FPGA stores the response value, which is the CID information of the SD card, and then enters step 5;

步骤5:FPGA发送CMD3命令等待响应;无响应,则FPGA返回状态字0x05,停止测试;有相应,则FPGA存储响应值,该响应值为卡的相对地址,在传输阶段需要用到该值,然后进入步骤6;Step 5: FPGA sends the CMD3 command and waits for a response; if there is no response, the FPGA returns the status word 0x05 and stops the test; if there is a response, the FPGA stores the response value, which is the relative address of the card, which is needed in the transmission phase. Then go to step 6;

步骤6:初始化阶段完成进入数据传输阶段,等待上位机指令。Step 6: After the initialization phase is completed, enter the data transmission phase and wait for the instructions from the host computer.

可选地,所述数据传输阶段完全由上位机发送操作指令,FPGA控制实现SD卡测试;Optionally, in the data transmission stage, the host computer sends operation instructions completely, and the FPGA control realizes the SD card test;

上位机操作包括传输速率选择、SD卡模式选择、误码测试以及PRBS码型选择;The host computer operation includes transmission rate selection, SD card mode selection, bit error test and PRBS pattern selection;

FPGA中的数据处理模块进行数据的传输以及状态判断,上位机根据状态字显示状态。The data processing module in the FPGA performs data transmission and state judgment, and the host computer displays the state according to the state word.

可选地,通过时钟发生与管理模块测试SD卡在不同传输速率下的性能;上位机设置好传输速率后将控制字发送至下位机,时钟发生与管理模块根据控制字产生所需要的时钟发送至SD卡的时钟引脚;在不同速率下选择相同的PRBS序列,经过相同一段时间后根据误码率判断传输性能。Optionally, test the performance of the SD card at different transmission rates through the clock generation and management module; the upper computer sends the control word to the lower computer after setting the transmission rate, and the clock generation and management module generates the required clock according to the control word. To the clock pin of the SD card; select the same PRBS sequence at different rates, and judge the transmission performance according to the bit error rate after the same period of time.

本发明的有益效果是:The beneficial effects of the present invention are:

(1)可以对SD卡进行单条指令测试;(1) A single instruction test can be performed on the SD card;

(2)灵活性高,可以逐条指令测试SD卡,而且满足长时间高速测试要求。(2) The flexibility is high, the SD card can be tested one by one, and it can meet the long-term high-speed test requirements.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明的一种基于FPGA的SD卡测试系统的原理框图;Fig. 1 is the functional block diagram of a kind of SD card testing system based on FPGA of the present invention;

图2为本发明的FPGA内部控制电路结构图。Fig. 2 is the FPGA internal control circuit structural diagram of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明涉及SD卡的测试系统及测试方法,不仅可以对SD卡读写测试,还可以对SD卡进行单条指令测试和误码测试。本发明使用FPGA代替专用芯片,灵活度高,满足高速率测试,而且可以对SD卡进行单条指令测试,读写测试时还可以插入伪随机序列,测试系统的误码率。The invention relates to a testing system and a testing method of an SD card, which can not only test the reading and writing of the SD card, but also perform a single instruction test and a code error test on the SD card. The present invention uses FPGA instead of special-purpose chip, has high flexibility, satisfies high-speed test, and can carry out single command test on SD card, can also insert pseudo-random sequence during read-write test, and test the bit error rate of the system.

如图1所示,本发明的SD卡测试系统通过FPGA发送控制命令至SD卡,将接收到的命令响应或者数据经过分析后上传至上位机显示。其中,硬件部分采用3U大小的PCI板卡结构,上位机操作系统为WIN7。As shown in Figure 1, the SD card testing system of the present invention sends control commands to the SD card through the FPGA, and uploads the received command responses or data to the upper computer for display after analysis. Among them, the hardware part adopts a 3U PCI board structure, and the upper computer operating system is WIN7.

如图2所示,本发明的FPGA内部控制电路主要包括时钟发生与管理模块、PRBS图形发生模块、发送模块、接收模块、命令控制模块、数据分析模块、序列同步模块以及PCI9054接口控制模块。As shown in Figure 2, the FPGA internal control circuit of the present invention mainly includes clock generation and management module, PRBS pattern generation module, sending module, receiving module, command control module, data analysis module, sequence synchronization module and PCI9054 interface control module.

FPGA通过接口控制模块接收上位机的命令,并将命令或者数据送至数据处理模块。The FPGA receives commands from the host computer through the interface control module, and sends commands or data to the data processing module.

数据处理模块判断命令后进行下一步操作,当正常发送接收测试和命令测试时,PRBS模块以及序列同步模块不使能,接收数据直接由接收模块发送至数据处理模块;当上位机勾选误码测试功能时,PRBS模块与序列同步模块启用。The data processing module proceeds to the next step after judging the command. When the receiving test and command test are sent normally, the PRBS module and the sequence synchronization module are not enabled, and the received data is directly sent from the receiving module to the data processing module; when the upper computer checks the error code When testing the function, the PRBS module and the sequence synchronization module are enabled.

对SD卡单条指令测试主要分为两个阶段:第一个阶段为初始化阶段,第二个阶段为数据传输阶段。The SD card single command test is mainly divided into two stages: the first stage is the initialization stage, and the second stage is the data transmission stage.

初始化阶段需要按照顺序操作,具体过程如下:The initialization phase needs to be operated in order, and the specific process is as follows:

步骤1:FPGA先发送CMD0命令。Step 1: FPGA sends CMD0 command first.

步骤2:FPGA发送CMD8命令,等待卡响应;若超时后无响应返回状态字0x01(若超时后无响应,FPGA返回状态字0x01),并进行步骤3;若响应正确则进行步骤3;若响应错误则FPGA返回状态字0x02,停止测试;Step 2: FPGA sends CMD8 command and waits for card response; if there is no response after timeout, return status word 0x01 (if there is no response after timeout, FPGA returns status word 0x01), and proceed to step 3; if the response is correct, proceed to step 3; if response If there is an error, the FPGA will return the status word 0x02 and stop the test;

步骤3:FPGA发送CMD55+ACMD41命令等待卡响应;如果无响应则FPGA返回状态字0x03,停止测试;如果响应为busy则重复步骤3;如果响应为ready,则进行步骤4,并根据状态存储器中状态字判断出卡的类型。Step 3: FPGA sends CMD55+ACMD41 command and waits for card response; if there is no response, FPGA returns status word 0x03 and stops testing; if the response is busy, repeat step 3; if the response is ready, proceed to step 4, and The status word judges the type of the card.

步骤4:FPGA发送CMD2命令等待响应;无响应则FPGA返回状态字0x04,停止测试;有响应则FPGA存储响应值,该响应值为卡的CID信息,然后进入步骤5;Step 4: The FPGA sends the CMD2 command and waits for a response; if there is no response, the FPGA returns the status word 0x04, and the test is stopped; if there is a response, the FPGA stores the response value, which is the CID information of the card, and then enters step 5;

步骤5:FPGA发送CMD3命令等待响应。无响应则FPGA返回状态字0x05,停止测试;有相应则FPGA存储响应值,该响应值为卡的相对地址,在传输阶段需要用到该值。然后进入步骤6。Step 5: FPGA sends CMD3 command and waits for response. If there is no response, the FPGA returns the status word 0x05, and the test is stopped; if there is a response, the FPGA stores the response value, which is the relative address of the card, which is needed in the transmission phase. Then go to step 6.

步骤6:初始化阶段完成进入数据传输阶段,等待上位机指令。Step 6: After the initialization phase is completed, enter the data transmission phase and wait for the instructions from the host computer.

数据传输阶段完全由上位机发送操作指令,FPGA控制实现SD卡测试。上位机操作包括传输速率选择、SD卡模式选择、误码测试以及PRBS码型选择等。FPGA数据处理模块主要进行数据的传输以及状态判断,上位机根据状态字显示状态,状态字对应状态如表1所示。In the data transmission stage, the upper computer sends operation instructions completely, and the FPGA controls to realize the SD card test. The host computer operation includes transmission rate selection, SD card mode selection, bit error test and PRBS pattern selection, etc. The FPGA data processing module mainly performs data transmission and state judgment. The host computer displays the state according to the state word, and the corresponding state of the state word is shown in Table 1.

表1Table 1

测试SD卡在不同传输速率下的性能主要通过时钟发生与管理模块。上位机设置好传输速率后将控制字发送至下位机,时钟发生与管理模块根据控制字产生所需要的时钟发送至SD卡的时钟引脚。在不同速率下选择相同的PRBS序列经过相同一段时间后根据误码率判断传输性能。The performance of the SD card under different transmission rates is mainly tested through the clock generation and management module. After setting the transmission rate, the upper computer sends the control word to the lower computer, and the clock generation and management module generates the required clock according to the control word and sends it to the clock pin of the SD card. After selecting the same PRBS sequence at different rates for the same period of time, the transmission performance is judged according to the bit error rate.

本发明测试系统进行PRBS误码测试的具体步骤如下:The concrete steps that test system of the present invention carries out PRBS bit error test are as follows:

步骤一:误码测试使能后,当FPGA发送写SD卡指令时,PRBS序列发生器使能,同时比特计数器和字节计数器工作,每计数一个字节将数据发送至FIFO;Step 1: After the bit error test is enabled, when the FPGA sends the command to write to the SD card, the PRBS sequencer is enabled, and the bit counter and the byte counter work at the same time, and the data is sent to the FIFO for each byte counted;

步骤二:根据所选SD卡模式(单线或者四线),确定发送数据方式,选择不同的并串转换。单线用8转1FIFO实现,四线用8转4FIFO实现。Step 2: According to the selected SD card mode (single-wire or four-wire), determine the way to send data, and select different parallel-to-serial conversions. The single line is implemented with 8-to-1 FIFO, and the four-line is implemented with 8-to-4 FIFO.

步骤三:当字节计数计到512时(即SD卡一个BLOCK的字节数)停止PRBS序列发生器。Step 3: Stop the PRBS sequence generator when the byte count reaches 512 (that is, the number of bytes in one BLOCK of the SD card).

步骤四:FPGA发送读SD卡指令(要与写指令中地址相同),同时启动PRBS接收。Step 4: The FPGA sends the command to read the SD card (the address must be the same as that in the write command), and at the same time start PRBS reception.

步骤五:通过定时中断将PRBS接收对比结果(比特数,误码数)发送至上位机,上位机计算结果显示。Step 5: Send the PRBS reception comparison result (number of bits, number of bit errors) to the host computer through a timing interrupt, and the calculation result of the host computer is displayed.

说明:以上是SD卡单块读写误码测试,连续测试时FPGA发送连续读写命令即可。Note: The above is the bit error test of reading and writing of a single SD card, and the FPGA can send continuous read and write commands during the continuous test.

本发明还提出了一种基于FPGA的SD卡测试方法,其工作原理与上述测试系统相同,这里不再赘述。The present invention also proposes a method for testing an SD card based on FPGA, the working principle of which is the same as that of the above-mentioned testing system, and will not be repeated here.

本发明可以对SD卡进行单条指令测试,在数据收发时可以插入伪随机序列进行误码测试;可以人工控制SD卡读写速率。The invention can perform a single instruction test on the SD card, and can insert a pseudo-random sequence to perform a code error test when sending and receiving data; and can manually control the reading and writing rate of the SD card.

本发明灵活性高,可以逐条指令测试SD卡,而且满足长时间高速测试要求;数据传输过程可插入伪随机序列进行误码测试。The invention has high flexibility, can test the SD card one by one, and meets the long-time high-speed test requirement; the pseudo-random sequence can be inserted in the data transmission process for error code testing.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of the present invention. within the scope of protection.

Claims (10)

1. a kind of SD card test system based on FPGA, it is characterised in that FPGA internal control circuits, which include clock, to be occurred with managing Manage module, PRBS figures and occur module, sending module, receiving module, command control module, data processing module, sequence synchronization Module and interface control module;
FPGA receives the order of host computer by interface control module, and order or data are delivered into data processing module;
Data processing module judges to carry out next step operation after order, when normal transmission receives test and order test, PRBS Module occurs for figure and sequence synchronization module is not enabled, and receives data and is directly sent by receiving module to data processing module; When upper computer selecting error code testing, PRBS figures occur module and enabled with sequence synchronization module.
2. a kind of SD card test system based on FPGA as claimed in claim 1, it is characterised in that
Two stages are divided into the test of SD card individual instructions:First stage is initial phase, and second stage passes for data The defeated stage.
3. a kind of SD card test system based on FPGA as claimed in claim 2, it is characterised in that
The initial phase detailed process is as follows:
Step 1:FPGA first sends CMD0 orders;
Step 2:FPGA sends CMD8 orders, waits SD card response;If without response after time-out, FPGA returns to status word 0x01, and Carry out step 3;If response is correct, FPGA carries out step 3;If responding mistake, FPGA returns to status word 0x02, stops surveying Examination;
Step 3:FPGA sends CMD55+ACMD41 orders and waits SD card response;If without response, FPGA returns to status word 0x03, stops test;If response is busy, FPGA repeat steps 3;If response is ready, step 4, and root are carried out The type of SD card is judged according to status word in status register;
Step 4:FPGA sends CMD2 order wait-for-responses;Without response, then FPGA returns status word 0x04, stops test;There is sound Answer, then FPGA memory responses value, the response is the cid information of SD card, subsequently into step 5;
Step 5:FPGA sends CMD3 order wait-for-responses;Without response, then FPGA returns status word 0x05, stops test;There is phase Answer, then FPGA memory responses value, the response is the relative address of card, needs to use the value in the transmission stage, subsequently into step Rapid 6;
Step 6:Initial phase completes to enter data transfer phase, waits host computer instruction.
4. a kind of SD card test system based on FPGA as claimed in claim 2, it is characterised in that
The data transfer phase sends operational order by host computer completely, and FPGA controls realize that SD card is tested;
Host computer operation includes transmission rate selection, SD card model selection, error code testing and PRBS code selections;
Data processing module in FPGA carries out transmission and the condition adjudgement of data, and host computer is according to status word dispaly state.
5. a kind of SD card test system based on FPGA as claimed in claim 1, it is characterised in that
The clock occurs to test performance of the SD card under different transmission rates with management module;
Host computer sets after transmission rate and to send control word to slave computer, and clock occurs to be produced according to control word with management module Clock required for raw is sent to the clock pins of SD card;Identical PRBS Sequence is selected at different rates, by mutually same Transmission performance is judged according to the bit error rate after the section time.
6. a kind of SD card method of testing based on FPGA, it is characterised in that FPGA internal control circuits, which include clock, to be occurred with managing Manage module, PRBS figures and occur module, sending module, receiving module, command control module, data processing module, sequence synchronization Module and interface control module;
FPGA receives the order of host computer by interface control module, and order or data are delivered into data processing module;
Data processing module judges to carry out next step operation after order, when normal transmission receives test and order test, PRBS Module occurs for figure and sequence synchronization module is not enabled, and receives data and is directly sent by receiving module to data processing module; When upper computer selecting error code testing, PRBS figures occur module and enabled with sequence synchronization module.
7. a kind of SD card method of testing based on FPGA as claimed in claim 6, it is characterised in that
Two stages are divided into the test of SD card individual instructions:First stage is initial phase, and second stage passes for data The defeated stage.
8. a kind of SD card method of testing based on FPGA as claimed in claim 7, it is characterised in that
The initial phase detailed process is as follows:
Step 1:FPGA first sends CMD0 orders;
Step 2:FPGA sends CMD8 orders, waits SD card response;If without response after time-out, FPGA returns to status word 0x01, and Carry out step 3;If response is correct, FPGA carries out step 3;If responding mistake, FPGA returns to status word 0x02, stops surveying Examination;
Step 3:FPGA sends CMD55+ACMD41 orders and waits SD card response;If without response, FPGA returns to status word 0x03, stops test;If response is busy, FPGA repeat steps 3;If response is ready, step 4, and root are carried out The type of SD card is judged according to status word in status register;
Step 4:FPGA sends CMD2 order wait-for-responses;Without response, then FPGA returns status word 0x04, stops test;There is sound Answer, then FPGA memory responses value, the response is the cid information of SD card, subsequently into step 5;
Step 5:FPGA sends CMD3 order wait-for-responses;Without response, then FPGA returns status word 0x05, stops test;There is phase Answer, then FPGA memory responses value, the response is the relative address of card, needs to use the value in the transmission stage, subsequently into step Rapid 6;
Step 6:Initial phase completes to enter data transfer phase, waits host computer instruction.
9. a kind of SD card method of testing based on FPGA as claimed in claim 7, it is characterised in that
The data transfer phase sends operational order by host computer completely, and FPGA controls realize that SD card is tested;
Host computer operation includes transmission rate selection, SD card model selection, error code testing and PRBS code selections;
Data processing module in FPGA carries out transmission and the condition adjudgement of data, and host computer is according to status word dispaly state.
10. a kind of SD card method of testing based on FPGA as claimed in claim 6, it is characterised in that
Occur to test performance of the SD card under different transmission rates with management module by clock;Host computer sets transmission rate Control word is sent to slave computer afterwards, the clock that clock occurs with management module according to required for being produced control word is sent to SD card Clock pins;Identical PRBS Sequence is selected at different rates, and biography is judged according to the bit error rate after phase same amount of time Defeated performance.
CN201710477868.4A 2017-06-09 2017-06-09 A kind of SD card test system and method based on FPGA Pending CN107331421A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710477868.4A CN107331421A (en) 2017-06-09 2017-06-09 A kind of SD card test system and method based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710477868.4A CN107331421A (en) 2017-06-09 2017-06-09 A kind of SD card test system and method based on FPGA

Publications (1)

Publication Number Publication Date
CN107331421A true CN107331421A (en) 2017-11-07

Family

ID=60195272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710477868.4A Pending CN107331421A (en) 2017-06-09 2017-06-09 A kind of SD card test system and method based on FPGA

Country Status (1)

Country Link
CN (1) CN107331421A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288441A (en) * 2018-03-17 2018-07-17 广东迪艾生光电技术有限公司 Analog SD card read-write system and city lighting engineering control system applied by same
CN108648780A (en) * 2017-12-19 2018-10-12 北京时代民芯科技有限公司 A kind of memory testing system, method and storage medium
CN112542210A (en) * 2020-12-31 2021-03-23 深圳市芯天下技术有限公司 High-speed flash limit read-write speed testing device
CN113467425A (en) * 2021-07-05 2021-10-01 中国兵器装备集团自动化研究所有限公司 Autonomous control testing method and system applied to Loongson lower computer
CN114006837A (en) * 2021-10-25 2022-02-01 苏州浪潮智能科技有限公司 Error code testing method and device for network port of intelligent network card and intelligent network card
CN114513436A (en) * 2022-01-05 2022-05-17 浙江科睿微电子技术有限公司 SDIO device transmission rate detection method, system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645767A (en) * 2009-08-28 2010-02-10 中国电子科技集团公司第四十一研究所 K interface error code testing method and system thereof
CN102143023A (en) * 2011-03-24 2011-08-03 索尔思光电(成都)有限公司 Error code testing system based on FPGA (Field Programmable Gate Array)

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645767A (en) * 2009-08-28 2010-02-10 中国电子科技集团公司第四十一研究所 K interface error code testing method and system thereof
CN102143023A (en) * 2011-03-24 2011-08-03 索尔思光电(成都)有限公司 Error code testing system based on FPGA (Field Programmable Gate Array)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王超: "基于FPGA的Micro SD卡控制器研究", 《中国优秀硕士学位论文全文数据库(电子期刊)》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648780A (en) * 2017-12-19 2018-10-12 北京时代民芯科技有限公司 A kind of memory testing system, method and storage medium
CN108648780B (en) * 2017-12-19 2020-10-16 北京时代民芯科技有限公司 Memory test system, method and storage medium
CN108288441A (en) * 2018-03-17 2018-07-17 广东迪艾生光电技术有限公司 Analog SD card read-write system and city lighting engineering control system applied by same
CN112542210A (en) * 2020-12-31 2021-03-23 深圳市芯天下技术有限公司 High-speed flash limit read-write speed testing device
CN113467425A (en) * 2021-07-05 2021-10-01 中国兵器装备集团自动化研究所有限公司 Autonomous control testing method and system applied to Loongson lower computer
CN113467425B (en) * 2021-07-05 2022-09-09 中国兵器装备集团自动化研究所有限公司 Autonomous control testing method and system applied to Loongson lower computer
CN114006837A (en) * 2021-10-25 2022-02-01 苏州浪潮智能科技有限公司 Error code testing method and device for network port of intelligent network card and intelligent network card
CN114006837B (en) * 2021-10-25 2023-03-14 苏州浪潮智能科技有限公司 Error code testing method and device for network port of intelligent network card and intelligent network card
CN114513436A (en) * 2022-01-05 2022-05-17 浙江科睿微电子技术有限公司 SDIO device transmission rate detection method, system and storage medium
CN114513436B (en) * 2022-01-05 2023-10-03 浙江科睿微电子技术有限公司 SDIO device transmission rate detection method, system and storage medium

Similar Documents

Publication Publication Date Title
CN107331421A (en) A kind of SD card test system and method based on FPGA
CN115210589B (en) Chip testing device and testing method
CN107423169A (en) For testing the method and system of high-speed peripheral interconnection equipment
CN1645337A (en) Method and apparatus for testing a motherboard including a rapid peripheral component interconnection device
CN105335548B (en) A kind of MCU emulation mode for ICE
CN110865909B (en) EMMC interface testing device and method based on FPGA
CN109656841A (en) Mixing control method and device based on software simulation I2C and Hardware I2C
CN105843718A (en) Test board card as well as management card test system and method
CN114530188A (en) Semiconductor test method, system and storage medium
CN102467431A (en) SATA interface testing device and method
CN103149468A (en) Electron component parameter testing device
CN113014339B (en) Quality test method, device and equipment for PCIe external plug-in card receiving channel
CN114996069A (en) A motherboard testing method, device and medium
CN212541318U (en) Board card function test system
CN107480017A (en) The batch-testing device and method of PCIE outer plug-in cards
TW201423387A (en) System and method for testing a plurality of SAS expanders synchronously
CN107293330A (en) The method and simulation checking system of simulating, verifying are carried out to random access memory ram
US9158609B2 (en) Universal serial bus testing device
CN113434442A (en) A switch and data access method
CN103366830A (en) Testing device of memory card
CN100399752C (en) Test system and method for single board of digital communication signal processing
CN100511172C (en) Inter-board transparent transmission bus test device and method thereof
CN103365815B (en) The SD memory card interface that under support SD pattern, IP realizes
CN116701267A (en) Performance testing method and interface conversion device of a motherboard PCIE interface
CN107870834B (en) Testing jig for hard disk backboard

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171107