Background technology
Chip for cell phone accounts for more than 50% of mobile phone total cost, and wherein, baseband chip is part most crucial in mobile phone, is also the highest part of technology content.Baseband chip provides other all functions except radio frequency.In evolution, formed the comparatively fixing chip architecture of DSP+ARM.
General arm processor is all supported the JTAG debugging at present.JTAG is the debug standard of ARM, and its concept of finally wanting is boundary scan (Boundary-Scan).The basic thought of boundary scan technique is to increase a shift register cell on the close input and output pin of chip.When chip is in debugging mode, for the output pin of chip, also can " catch " output signal on (CAPTURE) this pin by the boundary scan register that is attached thereto.Under normal running status, these boundary scan register are transparent to chip, so normal operation can not be affected.Like this, boundary scan register provide one easily mode in order to observation with control the chip of required debugging.
GPIO (general programmable input/output interface, General Programmable Input Output) be the signal port pin of conventional configuration in digital baseband chip, when microcontroller or chipset do not have enough I/O ports, or when system need to adopt the far-end serial communication or control, the GPIO product can provide extra control ﹠ monitor function.
(client identifies module to SIM, Subscriber Identity Model) card is a card that includes large scale integrated circuit in inside, the card storage inside contents such as digital mobile phone client's information, encryption key, it can differentiate client identity for the GSM network, and the voice messaging the when client is conversed is encrypted.Similar with SIM card, USIM (UMTS client identifies module, UMTS Subscriber Identity Module) card is to answer the requirement in 3G epoch and produce, and larger with SIM card phase specific capacity, function is abundanter.
The SIM/USIM card controller is requisite in the 3G baseband chip SIM/USIM to be controlled and the module of data interaction, and for example storage or delete telephone number, short message etc. in the SIM/USIM card is all completed by the SIM/USIM card controller.SIM and USIM are a kind of of ISO smart card,
Chip testing is a step of crucial importance in the baseband chip R﹠D process, and the quality of testing scheme greatly affects R﹠D cycle and the R﹠D costs of chip.Good testing scheme can improve the rate of finished products of chip, shortens the R﹠D cycle, reduces R﹠D costs.As important module in baseband chip, the testing scheme of SIM/USIM card controller is also very important.
In the prior art, all need the PCB test board of an ARM debugger, a special use, the SIM/USIM test card of a special use of needs based on the baseband chip measuring technology of ARM, see also shown in Figure 1.Wherein the card outside have 6 control signal pins, card controller is controlled and data interaction card by CLK and two holding wires of I/O, mutual data format sees also shown in Figure 2: the data on the I/O holding wire are arranged in order to high-order (MSB) from low level (LSB), a partial data byte comprises: 1 low level start bit, 8 bit data positions, 1 digit pair check digit, 2 position of rests (high level); CLK is the clock signal of rule; In idle condition, CLK and I/O are defaulted as high level, Low level effective.The data interaction pattern is semiduplex mode, and namely synchronization can only carry out one-way data transmission (the card controller synchronization can only be received data or send out data).
See also again shown in Figure 3ly, in the scheme of above-mentioned prior art, need the special pcb board that test is special-purpose of making, buy the SIM test card of a special use.And the fabrication cycle of pcb board is long usually, and the SIM test card is also more expensive, and this has just caused, and test process is more loaded down with trivial details, test period is long, testing cost is higher, has brought certain inconvenience for running smooth of test job.
Summary of the invention
The objective of the invention is to have overcome above-mentioned shortcoming of the prior art, provide a kind of and do not need special-purpose PCB test board and SIM/USIM test card, simple and practical, testing process automatic quick, test error is less, portability is strong, stable and reliable working performance, the scope of application SIM/USIM card controller automatic test circuit structure and method in the ARM digital baseband chip comparatively widely.
In order to realize above-mentioned purpose, in ARM digital baseband chip of the present invention, SIM/USIM card controller automatic test circuit structure and method are as follows:
this realizes the circuit structure based on SIM/USIM card controller automatic test in the digital baseband chip of ARM, comprise Test Host and ARM simulator, its main feature is, also comprise the test circuit module that carries the ARM digital baseband chip in described circuit structure, the clock CLK signal pin of the SIM/USIM card controller in described ARM digital baseband chip is connected with a GPIO pin on this ARM digital baseband chip, and the data I of this SIM/USIM card controller/O signal pin is connected with the 2nd GPIO pin on this ARM digital baseband chip, described Test Host is connected with this ARM digital baseband chip by this ARM simulator.
This realization is connected with the jtag interface of this ARM digital baseband chip based on the ARM simulator in the circuit structure of SIM/USIM card controller automatic test in the digital baseband chip of ARM.
This realization is PC based on the Test Host in the circuit structure of SIM/USIM card controller automatic test in the digital baseband chip of ARM.
This utilizes above-mentioned circuit structure realization based on the method for SIM/USIM card controller automatic test in the digital baseband chip of ARM, and its main feature is that described method comprises the following steps:
(1) the ARM digital baseband chip carries out initialization process to the register in described SIM/USIM card controller and GPIO control register;
(2) the ARM digital baseband chip reads the input signal values on a described GPIO pin, detects on described clock CLK signal pin whether clock signal is arranged;
(3) the described SIM/USIM card controller register of ARM digital baseband chip configuration, and drive described data I/predefined sequence of test data of O signal pin transmission;
(4) the ARM digital baseband chip is sampled to the input signal values on a described GPIO pin and the 2nd GPIO pin, and the sampling test point information that obtains is carried out storage operation;
(5) the ARM digital baseband chip carries out correctness according to the sampling test point information of a GPIO pin of storing and the 2nd GPIO pin and relatively judges processing;
The result that (6) will relatively judge is returned to Test Host, and finishes.
This realization comprises the following steps based in the method for SIM/USIM card controller automatic test in the digital baseband chip of ARM, the register in the SIM/USIM card controller and GPIO control register being carried out initialization process:
(11) the clock CLK set of frequency with the register in described SIM/USIM card controller is the twice of data I/O speed;
(12) sense that the GPIO control register makes a GPIO pin and the 2nd GPIO pin is set and is set to input.
This realization comprises the following steps based on the storage operation of carrying out in the method for SIM/USIM card controller automatic test in the digital baseband chip of ARM:
(21) create clock sampling signal array and data I/O sampled signal array in the memory block of ARM digital baseband chip;
(22) will deposit in described clock sampling signal array the sampled signal values that obtains of sampling of the input signal values on a GPIO pin;
(23) will deposit in described data I/O sampled signal array the sampled signal values that obtains of sampling of the input signal values on the 2nd GPIO pin.
This realization relatively judges processing based on the correctness of carrying out in the method for SIM/USIM card controller automatic test in the digital baseband chip of ARM, comprises the following steps:
(31) calculate for the sampling test point information in the clock sampling signal array of being stored in the spacing value that occurs between adjacent actual clock sampling signal test point that level changes;
(32) calculate for the sampling test point information in data I/O sampled signal array of being stored in the spacing value that occurs between adjacent real data I/O sampled signal test point that level changes;
(33) according to the SIM/USIM host-host protocol, calculate the spacing value between the adjacent theoretical clock sampling signal test point that the level variation occurs for clock sampling signal test point information corresponding in predefined sequence of test data;
(34) according to the SIM/USIM host-host protocol, calculate the spacing value between the adjacent gross data I/O sampled signal test point that the level variation occurs for data I corresponding in predefined sequence of test data/O sampled signal test point information;
(35) spacing value between described adjacent actual clock sampling signal test point is compared with spacing value between corresponding adjacent theoretical clock sampling signal test point, simultaneously the spacing value between described adjacent real data I/O sampled signal test point and the spacing value between adjacent theoretical clock sampling signal test point are compared;
(36) if comparative result in default reasonable error scope, result is correct; Otherwise result is mistake.
adopted SIM/USIM card controller automatic test circuit structure and method in the ARM digital baseband chip of this invention, due to its general GPIO pin that carries based on the ARM digital baseband chip, the arm processor that has utilized simultaneously the ARM digital baseband chip to carry, directly test code is imported in this ARM digital baseband chip by jtag interface by the ARM simulator, and allow this ARM digital baseband chip automatically perform test code, and output test result, thereby realized the automatic test of SIM/USIM controller, special-purpose PCB beta version and SIM/USIM test card have been saved, not only simple and practical, and saved testing cost, and make testing process full-automatic, simplified testing process, shortened the cycle of test, simultaneously due to the sampling clock of ARM digital baseband chip usually all at dozens or even hundreds of megahertz, thereby guaranteed the high accuracy of sampled data, stable and reliable working performance, and test code only needs to revise a little, just can conveniently be transplanted on different hardware platforms, thereby obtained comparatively desirable portability, the scope of application is comparatively extensive, for further developing of digital baseband chip measuring technology established solid foundation.
Embodiment
In order more clearly to understand technology contents of the present invention, describe in detail especially exemplified by following examples.
see also shown in Figure 4, this realizes the circuit structure based on SIM/USIM card controller automatic test in the digital baseband chip of ARM, comprise Test Host and ARM simulator, wherein, also comprise the test circuit module that carries the ARM digital baseband chip in described circuit structure, the clock CLK signal pin of the SIM/USIM card controller in described ARM digital baseband chip is connected with a GPIO pin on this ARM digital baseband chip, and the data I of this SIM/USIM card controller/O signal pin is connected with the 2nd GPIO pin on this ARM digital baseband chip, described Test Host is connected with this ARM digital baseband chip by this ARM simulator.
Wherein, described ARM simulator can be connected with the jtag interface of this ARM digital baseband chip, moreover, can also be connected by other suitable data transmission interface; This Test Host can be PC simultaneously, also can have the equipment such as Industry Control single-chip microcomputer that function is controlled in test for other.
In the middle of reality is used, because the SIM/USIM card controller has two signal pins: clock CLK and data I/O.Data interactive mode is semiduplex mode.Data interaction speed on the I/O signal is generally between 10~100kbit/s, and message transmission rate is slower, and clock CLK is generally 372 times of I/O speed.Usually baseband chip all can carry GPIO for the user.
In circuit structure of the present invention, use two GPIO to be connected with CLK, I/O, by the value on sampling GPIO, in conjunction with SIM/USIM card host-host protocol in 3GPP, verify the correctness of CLK and I/O signal, thereby reach the purpose of test SIM/USIM card controller.
In the circuit structure of Fig. 4, technical scheme of the present invention in fact only needs a Daepori to lead to PC, an ARM simulator, a pedestal and the baseband chip with ARM to get final product.Do not need special PCB test board and SIM test card.
Because chip carries arm processor, support the JTAG debug standard, therefore just can test code (C language or ARM assembler language) be poured in baseband chip by the JTAG mouth by the ARM simulator, so just can observe and debug all functions of baseband chip.By this method, only need to allow chip automatically perform at PC end input test routine, output test result at the PC end at last, so just realized the automatic test of SIM/USIM controller.
Due to the sampling clock of general baseband chip usually all in dozens or even hundreds of megahertz left and right, the hundred times of SIM/USIM card transmission rate, in a bit data length of SIM/USIM card, the GPIO mouth generally can be sampled many times, so the accuracy of sampled data is high.
See also shown in Figure 5ly, this utilizes above-mentioned circuit structure to realize comprising the following steps method based on SIM/USIM card controller automatic test in the digital baseband chip of ARM again:
(1) the ARM digital baseband chip carries out initialization process to the register in described SIM/USIM card controller and GPIO control register, comprises the following steps:
(a) the clock CLK set of frequency with the register in described SIM/USIM card controller is the twice of data I/O speed;
(b) sense that the GPIO control register makes a GPIO pin and the 2nd GPIO pin is set and is set to input;
(2) the ARM digital baseband chip reads the input signal values on a described GPIO pin, detects on described clock CLK signal pin whether clock signal is arranged;
(3) the described SIM/USIM card controller register of ARM digital baseband chip configuration, and drive described data I/predefined sequence of test data of O signal pin transmission;
(4) the ARM digital baseband chip is sampled to the input signal values on a described GPIO pin and the 2nd GPIO pin, and the sampling test point information that obtains is carried out storage operation, comprises the following steps:
(a) create clock sampling signal array and data I/O sampled signal array in the memory block of ARM digital baseband chip;
(b) will deposit in described clock sampling signal array the sampled signal values that obtains of sampling of the input signal values on a GPIO pin;
(c) will deposit in described data I/O sampled signal array the sampled signal values that obtains of sampling of the input signal values on the 2nd GPIO pin;
(5) the ARM digital baseband chip carries out correctness according to the sampling test point information of a GPIO pin of storing and the 2nd GPIO pin and relatively judges processing, comprises the following steps:
(a) calculate for the sampling test point information in the clock sampling signal array of being stored in the spacing value that occurs between adjacent actual clock sampling signal test point that level changes;
(b) calculate for the sampling test point information in data I/O sampled signal array of being stored in the spacing value that occurs between adjacent real data I/O sampled signal test point that level changes;
(c) according to the SIM/USIM host-host protocol, calculate the spacing value between the adjacent theoretical clock sampling signal test point that the level variation occurs for clock sampling signal test point information corresponding in predefined sequence of test data;
(d) according to the SIM/USIM host-host protocol, calculate the spacing value between the adjacent gross data I/O sampled signal test point that the level variation occurs for data I corresponding in predefined sequence of test data/O sampled signal test point information;
(e) spacing value between described adjacent actual clock sampling signal test point is compared with spacing value between corresponding adjacent theoretical clock sampling signal test point, simultaneously the spacing value between described adjacent real data I/O sampled signal test point and the spacing value between adjacent theoretical clock sampling signal test point are compared;
(f) if comparative result in default reasonable error scope, result is correct; Otherwise result is mistake;
The result that (6) will relatively judge is returned to Test Host, and finishes.
In the middle of reality is used, with circuit structure of the present invention connect complete after, just can be at PC end editor and modification test code (C language or ARM assembler language).After compiling is passed through, by the ARM simulator, test code is poured in baseband chip from jtag interface.Based on the debug standard of ARM JTAG, just can configure and read any register in chip, comprise SIM/USIM controller and GPIO controller.After like this test code being poured into baseband chip, chip can automatically perform instructions, outputs test result at the PC end at last.
Testing process of the present invention is divided into five steps.
The first step: initialization SIM/USIM card controller register and GPIO control register.
Second step: read the value of GPIO0, detect on CLK whether clock signal is arranged.
The 3rd step: configure SIM/USIM card controller register, send the data of fixed sequence program by I/O.
The 4th step: the value of sampling GPIO0 and GPIO1, and deposit respectively array CLK[in], I/O[] in.
The 5th step: whether the array value that calculates GPIO0 and GPIO1 is correct.
(1) at initial period, initialization SIM/USIM and GPIO control register arrange the various functions parameter.Be the twice of I/O with the CLK set of frequency of SIM/USIM control register, GPIO0 and GPIO1 direction are set to input, so just can obtain by sampling GPIO0 and GPIO1 the value of CLK and I/O signal.
(2) after first step initialization SIM/USIM control register, CLK can send the clock signal of a fixed frequency, and the level upset of clock signal is frequent.Because GPIO0 is connected with CLK, so only need read the input value of GPIO0 at second step, sees if there is variation (0 becomes 1 or 1 becomes 0) and just can learn whether clock is arranged.
In (3) the 3rd steps, configuration SIM/USIM card controller register makes and sends the one piece of data sequence on I/O.
In (4) the 4th steps, constantly read the input value (data on namely sample CLK and I/O) of GPIO0 and GPIO1 at T0, and deposit continuously array CLK[in] and I/O[] in.At two complete CLK in the clock cycle, GPIO0 and the GPIO1 number of times sampling (different hardware test platform sampling numbers slightly have difference) that can fix.
See also shown in Figure 6ly, suppose that a certain hardware platform can fixed sample in the clock cycle 6 times at two continuous CLK, can obtain so following two groups of sampled datas:
CLK[]={1,1,0,0,1,1,0,0},I/O[]={1,1,1,1,0,0,0,0}。
(5) the 5th steps, the sampled value of observing CLK obtained in the previous step and I/O, CLK changes the 1st, 3,5,7 test point as can be known, and I/O changes the 1st, 5 test point.Can obtain thus other a pair of array, i.e. spacing value between the test point that changes of numerical value:
CLK_DURATION[]={2,2,2}——(3-1,5-3,7-5)
I/O_DURATION[]={4}——(5-1)。
Because the SIM/USIM host-host protocol is fixed, and the data sequence that sends is controlled, so just can calculated in advance go out the interval between the test point that CLK and I/O signal change, and and the actual test point that changes between the interval compare, just can verify the correctness of the upper data of CLK and I/O, thus the function of checking SIM/USIM card controller.
Illustrate as follows:
Suppose that the upper data sequence that sends of I/O is 0X55.According to the SIM/USIM card host-host protocol shown in Fig. 2, in above the 4th step, by reading the input value of GPIO0 and GPIO1, obtain two groups of sampling arrays:
CLK[]={1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0};
I/O[]={0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}。
In above the 5th step, by calculating CLK[] and I/O[], just can obtain the spacing value between test point that CLK and I/O signal change:
CLK_DURATION[]={2,2,2,2,2,2,2,2,2,2,2,2};
I/O_DURATION={4,4,4,4,4,4,4,4,8,8}。
With CLK_DURATION[] and I/O_DURATION[] correct result that goes out with calculated in advance compares, if in the reasonable error scope, shows test results correct, if exceed, shows mistake.
Simultaneously because the CLK frequency is the twice of I/O, so the minimum interval value of I/O should be the twice of CLK minimum interval value, by this multiple relation, therefore can verify again the accuracy of CLK and I/O signal frequency, the function correctness of checking SIM/USIM card controller register.
In above-mentioned testing process, it is not 0 to be exactly the characteristics of 1 value that the 4th step and the 5th wherein goes on foot the input value utilized cleverly GPIO, thereby has realized the function of verification of correctness.
The ardware feature of different PC, ARM simulator and baseband chip is different, actual minimum interval value can be different, namely at two continuous CLK in the clock cycle, some hardware platform GPIO can read 6 times, what have can only read 5 times, but spacing value necessarily becomes the multiple relation, according to this characteristic, test program of the present invention only need be revised the minimum interval value, arrives different hardware test platforms with regard to portable.
SIM/USIM card controller automatic test circuit structure and method in above-mentioned ARM digital baseband chip have been adopted, due to its general GPIO pin that carries based on the ARM digital baseband chip, the arm processor that has utilized simultaneously the ARM digital baseband chip to carry, directly test code is imported in this ARM digital baseband chip by jtag interface by the ARM simulator, and allow this ARM digital baseband chip automatically perform test code, and output test result, thereby realized the automatic test of SIM/USIM controller, special-purpose PCB beta version and SIM/USIM test card have been saved, not only simple and practical, and saved testing cost, and make testing process full-automatic, simplified testing process, shortened the cycle of test, simultaneously due to the sampling clock of ARM digital baseband chip usually all at dozens or even hundreds of megahertz, thereby guaranteed the high accuracy of sampled data, stable and reliable working performance, and test code only needs to revise a little, just can conveniently be transplanted on different hardware platforms, thereby obtained comparatively desirable portability, the scope of application is comparatively extensive, for further developing of digital baseband chip measuring technology established solid foundation.
In this specification, the present invention is described with reference to its specific embodiment.But, still can make various modifications and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, specification and accompanying drawing are regarded in an illustrative, rather than a restrictive.