HARDWARE-SOFTWARE COMPLEX FOR FUNCTIONAL AND PARAMETRIC TESTS OF ARM MICROCONTROLLERS STM 32 F 1 XX

The article presents the hardware-software complex for functional and parametric tests of ARM microcontrollers STM32F1XX. The complex is based on PXI devices by National Instruments and LabVIEW software environment. Data exchange procedure between a microcontroller under test and the complex hardware is describes. Some test results are also presented.


Introduction
Detection of functional and parametric failures is the main objective during testing of very large-scale integration (VLSI).Specialized technique is required which is able to provide functional tests of basic elements of a VLSI under test, and to measure its parameters with required accuracy.A microcontroller (MCU) is a VLSI which consists of a microprocessor core and a large set of peripheral units such as memory, universal ports, timers/counters, interrupt controller, interface ports, etc. Testing of these units is quite complex procedure and is implemented by specialized algorithms.A hardware-software complex is required to provide a MCU testing [1].It is important to receive and to store test results information.This article provides a description of the hardware-software complex which is based on PXI equipment by National Instruments and designed for functional and parametric testing of ARM MCU STM32F1ХХ.

Equipment and software
To implement the hardware-software complex National Instruments PXI module equipment [3] was used: -PXI-4110, power supply board [4]; -PXI-7841R, FPGA-based fee collection data reconfigurable board [5]; -PXI-4071, multimeter board [6].PXI-4110, PXI-7841R and PXI-4071 units are placed into PXI-1073 chassis which provides connection between the complex and a PC.The complex hardware is controlled by LabVIEW software environment with use of LabVIEW FPGA module.
The hardware-software complex also includes a sample chip PCB snap-in and a switching board.
The complex designed can be used not only for MCU testing but also for wide range of electronics: microprocessors, analog ICS [7], optoelectronic devices [8], transistor test structures [9] and so on.

Solution
A sample of MCU placed onto the PCB snap-in is connected to the switchboard, which provides connection between MCU pins and NI system channels, and also allows to set any logical state onto a MCU pins (pull-up, pull-down, high logical level, low logical level, connection to another line, Z-state) without NI system involving [10].
Hardware structure with MCU under test is presented in Figure 1.The virtual device has been implemented in the LabVIEW software environment.This software controls MCU under test and provides information from NI complex gathering and processing.The virtual device contains the following software blocks: -reception and primary processing of information; -errors counting; -supply current monitor ; -restart control; -hangs control; -internal ADC testing.
MCU internal USART and SPI interfaces are used to transmit the information about test results from MCU under test to LabVIEW virtual device.These interfaces are implemented by PXI-7841R board based on FPGA.MCU supply current monitor is performed by two PXI-4110 boards under LabVIEW virtual device control.Input and output currents measurement is carried out by PXI-4071 multimeter board.Output voltages of low and high logical levels are measured by integrated analog input channels of PXI-7841R board.
USART and SPI testing were performed using of a control word transfer correctness checking.One USART interface was configured as an output for the information transfer from MCU to PXI board.Two remaining USART interfaces are connected to each otherinput of one unit is connected to output of another and vice versa.Two SPI interfaces are also connected to each other.One SPI interface can transfer the information from MCU to PXI board without affecting to the test results.Chess code, inversion chess code, field of zeros and field of ones are used as control words.Difference between received and transmitted information in a same operating cycle is considered as an interface module fault.
Hardware-software complex satisfies requirements of speed and reliability for synchronization with MCU USART and SPI interfaces (no errors when receiving data blocks coming from a test chip to the virtual device).To ensure the reliability of data transmission it is possible to transmit information immediately in parallel with USART block and SPI block.This procedure completely excludes the possibility of transmission failure.Selection of the package is carried out by using of gate signals that indicate RAM and FLASH memory testing consists of writing a 32-bit control word to all memory cells with subsequent reading [11,12].Read word is compared to a reference; if they are not equal failure of a memory cell is recorded.After testing all memory with one word, the test is continued with another word.There are four types of control word: chess code, inversion chess code, field of zeros and field of ones.10 Kbytes of SRAM and 40 Kbytes of FLASH are tested.
For the interrupt controller testing an external signal supplies from the PXI board to the one of MCU input which operates in the external interrupt input mode.The MCU interrupt controller handles the interrupt and provides a pulse to one of I/O ports which configured as an output.The pulse is detected by the PXI board and is transmitted to LabVIEW virtual device.Absence of a pulse at an output informs about an error of interrupt controller.
Two timers/counters send meander signal to the PXI board and then to the virtual device.Virtual device compares frequency of pulses from the timers/counters with reference frequency.In case of difference between two frequencies an error is registered.
The MCU internal ADC testing procedure is also developed.It is necessary to perform a large number of USART and SPI transmission cycles to obtain the full-scale transfer function on the one hand, and relatively large number of samples required to improve accuracy on the other hand.We decided to implement the procedure of ADC sampling averaging by MCU software code, and to transfer the averaged data.This procedure allows to reduce the amount of USART and SPI transmission cycles, as well as gives opportunity to unload partially the ADC data processing unit which is implemented in the LabVIEW software environment.As a result the full-scale transfer function is measured for 11 seconds against 47 seconds with LabVIEW ADC sampling averaging.
Linearly increasing voltage (from 0 V to 3.3 V) is applied from one of PXI analog output channels to ADC input.ADC samples input voltage and sends the resulting code back to the virtual device through PXI board using USART or SPI.Using the transfer function the conversion parameters of ADC can be calculated.A part of measured transfer function together with the ideal one is shown in Figure 2.
The supply current monitor block allows to adjust supply voltage of MCU under test, as well as to monitor the current consumption.In case of exceeding the power consumption the block detects an error and turns off the power supply.

Application and development
The hardware-software complex has been successfully implemented in NRNU MEPhI, Moscow.Seven MCU samples were tested in different applications and environment conditions by using this complex [13][14][15].Some test results obtained by using the hardware-software complex are presented below.
The time dependence of STM32F103C8T6 internal ADC integral nonlinearity is presented in Figure 3. Figure 4 show time dependencies of dynamic (a) and static (b) supply current of the STM32F103C8T6 respectively.
The hardware-software complex can be adapted for testing of other MCU types by minor changes.

Conclusions
The hardware-software complex for ARM microcontroller STM32F1XX functional and parametric test is developed.The complex is implemented based on National Instruments equipment on a PXI-1073 chassis.The software is developed in LabVIEW.
The hardware-software complex has been successfully tested on the STM32F103C8T6 microcontroller.It is planned to adapt this system to test other types of microcontrollers.
parcel and type of the test block.Interface blocks operate in the following speeds: USART -115200 bit/s; SPI -4000000 bit/s.

Figure 2 .
Figure 2. Real and ideal transfer functions of ADC.

2 Object of the research
a Corresponding author: ayegor@spels.ru