Baseband self-test method of WiFi chip, WiFi chip and wireless communication equipment
Automatic baseband self-testing is achieved through built-in components of WiFi chip, which solves the problems of complexity, long time and high cost of existing testing methods, improves testing efficiency and reduces costs.
Patent Information
- Application Number
- CN202510301606.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-20
AI Technical Summary
The testing methods of existing WiFi chip baseband systems are complex, time-consuming and costly, and it is difficult to meet production needs.
It uses built-in self-test controller, WiFi frame generator, accumulator, comparator and other components of the WiFi chip to realize an automated baseband self-test method without the need for external professional testing equipment.
Simplify the test process, reduce manual intervention, improve test efficiency, reduce test costs, and avoid waste of resources caused by duplicate tests through built-in memory and multiplexer design.
Smart Images

Figure CN120185733A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing, and in particular, to a baseband self-test method for a WiFi chip, a WiFi chip, and a wireless communication device. Background Art
[0002] With the rapid development of wireless communication technology, WiFi (Wireless Fidelity) technology has become an indispensable part of modern life and is widely used in various scenarios such as homes, offices, and public places, providing people with convenient and high-speed wireless network access services. As the core component of WiFi technology, the performance stability and reliability of a WiFi chip are directly related to the communication quality of the wireless network and the user experience.
[0003] A WiFi chip usually includes a baseband system, which is responsible for processing key tasks such as encoding, decoding, modulation, and demodulation of wireless signals and is a key link to ensure the smooth progress of wireless communication. To ensure that the performance of the WiFi chip meets the design requirements, it is necessary to strictly test the baseband system during the production process.
[0004] Currently, the testing of the baseband system of a WiFi chip mainly relies on communication with external testing equipment. This testing method generally includes the following steps: First, connect the WiFi chip to a professional testing device; then, send a preset test signal to the WiFi chip through the testing device; next, the baseband system of the WiFi chip processes the received test signal and returns the processing result to the testing device; finally, the testing device analyzes the returned processing result to determine whether the performance of the baseband system meets the design requirements.
[0005] However, this testing method has many deficiencies:
[0006] Complex testing method: Due to the numerous functions of the baseband system of the WiFi chip, the testing process needs to cover various possible working scenarios and signal types, resulting in an extremely complex testing method. Testers need to have profound professional knowledge and rich practical experience to accurately conduct the testing and analyze the results.
[0007] Long testing time: To ensure the comprehensiveness and accuracy of the testing, the testing process often takes a large amount of time. This not only increases the production cost but also extends the product's market launch cycle, having an adverse impact on market competitiveness and user satisfaction.
[0008] High testing cost: Professional testing equipment is expensive and needs to be maintained and upgraded regularly to ensure its performance is synchronized with the latest WiFi technology standards. In addition, additional consumables and labor costs may be incurred during the testing process, further increasing the testing cost.
[0009] In summary, the existing test methods for the baseband system of WiFi chips have problems such as complex test methods, long test time, and high test cost, and urgent improvement is needed. Summary of the Invention
[0010] Embodiments of the present application provide a baseband self-test method for a WiFi chip, a WiFi chip, and a wireless communication device, which can automatically test the baseband of the WiFi chip, reduce the test complexity and lower the test cost. The technical solutions are as follows:
[0011] In a first aspect, embodiments of the present application provide a baseband self-test method for a WiFi chip. The WiFi chip includes: a self-test controller, a WiFi frame generator, an accumulator, a comparator, a TX controller, an RX controller, a physical layer controller, a multiplexer, a memory, a digital-to-analog converter, an analog-to-digital converter, a variable gain amplifier, and a CPU;
[0012] Among them, the self-test controller is respectively connected to the input end of the WiFi frame generator, the output end of the comparator, the CPU, and the output end of the analog-to-digital converter. The input end of the analog-to-digital converter is connected to the output end of the variable gain amplifier, and the variable gain amplifier is connected to a radio frequency antenna;
[0013] The output end of the WiFi frame generator is respectively connected to the first input end of the accumulator and the input end of the TX controller; the first output end of the accumulator is connected to the first input end of the comparator, and the second output end of the accumulator is connected to the second input end of the comparator;
[0014] The output end of the TX controller is connected to the physical layer controller, and the physical layer controller is respectively connected to the input end of the digital-to-analog converter and the input end of the memory;
[0015] The input end of the RX controller is connected to the physical layer controller, and the output end of the RX controller is connected to the second input end of the accumulator;
[0016] The first input end of the multiplexer is connected to the memory, the second input end of the multiplexer is connected to the analog-to-digital converter, and the output end of the multiplexer is connected to the physical layer controller;
[0017] Among them, the method includes:
[0018] The self-test controller configures the upper limit of the loop count in response to the configuration instruction of the CPU, and clears the current count value when detecting a test start instruction;
[0019] The adjustable gain amplifier receives an analog noise signal from the air interface, amplifies the analog noise signal, and sends the amplified analog noise signal to the analog-to-digital converter;
[0020] The analog-to-digital converter performs analog-to-digital conversion on the amplified analog noise signal to obtain an analog-digital signal, and sends the converted analog-digital signal to the self-test controller;
[0021] The self-test controller is used to intercept a specified length of bit values at a specified position of the received noise digital signal to generate a random number, and send the generated random number to the WiFi frame generator;
[0022] The WiFi frame generator determines the PPDU type, rate, and frame length of this test according to the received multiple random numbers, generates the current WiFi data frame that conforms to the 802.11 protocol according to the determined parameter values, and sends the current WiFi data frame to the TX controller and the accumulator;
[0023] The TX controller transmits the current WiFi data frame to the physical layer controller;
[0024] The accumulator obtains the current transmission accumulation value according to the summation result of the current WiFi data frame and the previous WiFi data frame, and sends the current transmission accumulation value to the comparator;
[0025] The physical layer controller digitally modulates the WiFi data frame to obtain modulated data, and sends the modulated data to the memory;
[0026] The memory stores the current modulated data in response to the write instruction of the CPU, and serves as the current received test data;
[0027] The memory is used to send the current received test data to the physical layer controller through the first input terminal of the multiplexer in response to the read instruction of the CPU;
[0028] The physical layer controller is used to demodulate the current test data to obtain the current demodulated data, and send the current demodulated data to the RX controller;
[0029] The RX controller forwards the current demodulated data to the accumulator;
[0030] The accumulator obtains the current reception accumulation value according to the summation result of the current demodulated data and the previous demodulated data, and sends the current reception accumulation value to the comparator;
[0031] The comparator determines whether the currently received accumulated value is equal to the currently transmitted accumulated value; if they are equal, it sends a signal indicating that the current test has passed to the self-test controller, and if they are not equal, it sends a signal indicating that the current test has failed to the self-test controller;
[0032] When the self-test controller receives the signal indicating that the current test has passed from the comparator, it notifies the CPU of the signal indicating that the current test has been successful, and determines whether the current test count is less than the upper limit of the loop count. If so, it increments the current count value by 1, instructs the WiFi frame generator to generate the next WiFi data frame to perform the next test, and if not, it stops the test; when receiving the test failure signal from the comparator, it notifies the CPU of the test failure signal;
[0033] In response to the test failure signal, the CPU reads the current test data from the memory for analysis.
[0034] In a second aspect, the present application provides a WiFi chip, which includes: a self-test controller, a WiFi frame generator, an accumulator, a comparator, a TX controller, an RX controller, a physical layer controller, a multiplexer, a memory, a digital-to-analog converter, an analog-to-digital converter, a variable gain amplifier, and a CPU;
[0035] Among them, the self-test controller is respectively connected to the input end of the WiFi frame generator, the output end of the comparator, the CPU, and the output end of the analog-to-digital converter. The input end of the analog-to-digital converter is connected to the output end of the variable gain amplifier, and the variable gain amplifier is connected to the radio frequency antenna;
[0036] The output end of the WiFi frame generator is respectively connected to the first input end of the accumulator and the input end of the TX controller; the first output end of the accumulator is connected to the first input end of the comparator, and the second output end of the accumulator is connected to the second input end of the comparator;
[0037] The output end of the TX controller is connected to the physical layer controller, and the physical layer controller is respectively connected to the input end of the digital-to-analog converter and the input end of the memory;
[0038] The input end of the RX controller is connected to the physical layer controller, and the output end of the RX controller is connected to the second input end of the accumulator;
[0039] The first input end of the multiplexer is connected to the memory, the second input end of the multiplexer is connected to the analog-to-digital converter, and the output end of the multiplexer is connected to the physical layer controller.
[0040] In a third aspect, the present application provides a wireless communication device, including a WiFi chip. The wireless communication device can be a wireless router, a mobile phone, a tablet computer, a personal computer, a laptop computer, etc.
[0041] The beneficial effects brought by the technical solutions provided in some embodiments of the present application at least include:
[0042] This solution uses built-in components such as a self-test controller, a WiFi frame generator, an accumulator, a comparator, etc. to implement an automated test process. Without external professional test equipment, the test can be started only by configuring test parameters through the CPU, greatly simplifying the complexity of the test method. Through the preset upper limit of the number of loops and the automatically generated WiFi data frames, the test process can be carried out automatically, reducing manual intervention and improving the test efficiency.
[0043] The self-test system can quickly generate WiFi data frames that conform to the 802.11 protocol, and perform data transmission and reception tests through the built-in physical layer controller, TX controller, and RX controller. The design of the accumulator and comparator makes the verification process of the test results more efficient, and can quickly determine whether the test passes, thus shortening the time of a single test. The loop test mechanism allows multiple tests to be continuously carried out before reaching the upper limit of the number of loops, further improving the test efficiency and shortening the overall test time.
[0044] Since this solution does not require external professional test equipment and can complete the test only by using the components inside the WiFi chip, the procurement cost of the test equipment is greatly reduced. The automated test process reduces the need for manual testing and lowers the labor cost. Through the design of the built-in memory and multiplexer, the storage and reuse of test data are realized, avoiding the waste of resources caused by repeated testing and further reducing the test cost. Description of the Drawings
[0045] 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 required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 is the structural diagram of the WiFi chip provided by the embodiment of the present application;
[0047] Figure 2 is the schematic flowchart of the baseband self-test method of the WiFi chip provided by the embodiment of the present application;
[0048] Figure 3 is the schematic diagram of the first mapping table provided by the embodiment of the present application;
[0049] Figure 4 is a schematic diagram of the second mapping table provided by an embodiment of the present application;
[0050] Figure 5 is a data structure diagram of the frame header provided by an embodiment of the present application;
[0051] Figure 6 is a data structure diagram of the FrameControl field provided by an embodiment of the present application;
[0052] Figure 7 is a schematic diagram of the third mapping table provided by an embodiment of the present application. Detailed implementation manners
[0053] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0054] Please refer to Figure 1 , a schematic structural diagram of a chip pin configuration circuit provided by an embodiment of the present invention.
[0055] In Figure 1 , the WiFi chip includes: a self-test controller, a WiFi frame generator, an accumulator CS, a comparator CMP, a TX controller, an RX controller, a physical layer controller PHY, a multiplexer MUX, a memory, a digital-to-analog converter ADC, an analog-to-digital converter DAC, a variable gain amplifier VGA, and a CPU.
[0056] The connection relationships of the above-mentioned various components include:
[0057] The self-test controller is respectively connected to the input end of the WiFi frame generator, the output end of the comparator, the CPU, and the output end of the analog-to-digital converter. The input end of the analog-to-digital converter is connected to the output end of the variable gain amplifier, and the variable gain amplifier is connected to a radio frequency antenna;
[0058] The output end of the WiFi frame generator is respectively connected to the first input end of the accumulator and the input end of the TX controller; the first output end of the accumulator is connected to the first input end of the comparator, and the second output end of the accumulator is connected to the second input end of the comparator;
[0059] The output end of the TX controller is connected to the physical layer controller, and the physical layer controller is respectively connected to the input end of the digital-to-analog converter and the input end of the memory;
[0060] The input end of the RX controller is connected to the physical layer controller, and the output end of the RX controller is connected to the second input end of the accumulator;
[0061] The first input end of the multiplexer is connected to the memory, the second input end of the multiplexer is connected to the analog-to-digital converter, and the output end of the multiplexer is connected to the physical layer controller.
[0062] Among them, the input end of the self-test controller receives a test start instruction from the outside.
[0063] The output end of the self-test controller: is connected to the input end of the WiFi frame generator for sending a random number generation instruction; is connected to the output end of the comparator for receiving a test result signal (pass or fail); is connected to the CPU for sending a test success or failure signal and receiving a configuration instruction from the CPU; is connected to the output end of the analog-to-digital converter for receiving a noise digital signal.
[0064] The input end of the WiFi frame generator: receives a random number generation instruction from the self-test controller; its output end: is connected to the first input end of the checksum accumulator for sending the generated WiFi data frame; is connected to the input end of the TX controller for sending the generated WiFi data frame.
[0065] The first input end of the accumulator: receives the WiFi data frame from the WiFi frame generator, and the second input end: receives the demodulated data from the RX controller; the output end: the first output end: sends the accumulated value to the comparator; the second output end: sends the received accumulated value to the comparator.
[0066] The input end of the comparator: receives the sent accumulated value and the received accumulated value from the checksum accumulator; the output end: sends a test result signal (pass or fail) to the self-test controller.
[0067] The input end of the TX controller: receives the WiFi data frame from the WiFi frame generator; the output end: is connected to the physical layer controller for sending the WiFi data frame to the physical layer for digital modulation.
[0068] The input end of the RX controller: is connected to the physical layer controller and receives the demodulated data; the output end: sends the demodulated data to the checksum accumulator.
[0069] Input terminal of the physical layer controller: Connected to the TX controller, receiving WiFi data frames for digital modulation. Connected to the output terminal of the multiplexer, receiving test data from the memory for demodulation. Output terminal: Connected to the input terminal of the digital-to-analog converter, sending modulated data to the digital-to-analog converter for conversion. Connected to the input terminal of the memory, sending modulated data to the memory for storage. Connected to the input terminal of the RX controller, sending demodulated data.
[0070] First input terminal of the multiplexer: Connected to the memory, receiving stored test data. Second input terminal: Connected to the analog-to-digital converter. Output terminal: Sending test data to the physical layer controller for demodulation.
[0071] Input terminal of the memory: Connected to the physical layer controller, receiving modulated data. Output terminal: Sending stored test data to the physical layer controller through the first input terminal of the multiplexer.
[0072] Input terminal of the digital-to-analog converter (DAC): Connected to the physical layer controller, receiving modulated data for conversion. Output terminal: Connected to the adjustable gain amplifier (but this path is not directly involved when testing the noise signal).
[0073] Input terminal of the analog-to-digital converter (ADC): Connected to the output terminal of the adjustable gain amplifier, receiving the amplified analog noise signal. Output terminal: Sending the noise digital signal to the self-test controller.
[0074] Input terminal of the adjustable gain amplifier: Connected to the RF antenna, receiving the analog noise signal. Output terminal: Sending the amplified analog noise signal to the analog-to-digital converter.
[0075] The CPU is connected to the self-test controller, memory, etc., for configuring test parameters, receiving test results, analyzing test data, etc.
[0076] See Figure 2 as shown Figure 2 is the flowchart of the baseband test method for the WiFi chip provided by the embodiment of this application. The specific process includes the following steps:
[0077] S201. The self-test controller configures the upper limit of the loop count in response to the configuration instruction of the CPU. When detecting the test start instruction, it clears the current count value.
[0078] Among them, the self-test controller receives the configuration instruction sent by the CPU, and this instruction contains the upper limit value of the test loop count. The self-test controller parses this instruction and stores the upper limit value in the internal register. There is a count value in the self-test controller for tracking the current test times. Before each new test sequence starts, the self-test controller clears this count value to ensure counting starts from the first test.
[0079] Among them, a testmode register can be set inside the self - test controller. When the WiFi chip needs to perform baseband testing, the CPU modifies the value in the testmode register to 1; when the WiFi chip is working normally, the CPU modifies the value in the testmode register to 0.
[0080] S202. The variable - gain amplifier receives an analog noise signal from the air interface, amplifies the analog noise signal, and sends the amplified analog noise signal to the analog - to - digital converter.
[0081] Among them, the variable - gain amplifier (VGA) receives an analog noise signal from the air interface (i.e., the wireless environment) through its input terminal. The amplifier amplifies the received analog noise signal according to a preset or dynamically adjusted gain. The amplified analog noise signal is sent to the analog - to - digital converter (ADC).
[0082] In some embodiments of the present application, the variable - gain amplifier (VGA) is an electronic device that can adjust its gain (i.e., amplification factor) according to a control signal.
[0083] In this step, the self - test controller sets the gain level of the VGA to the maximum level, which can be achieved by sending a specific electrical signal or digital code to the control input terminal of the VGA. The maximum - level gain means that the VGA will amplify the input signal with its highest amplification ability. The analog noise signal, as the input signal of the VGA, may come from a noise generator, environmental noise received by the antenna, or other analog noise sources. This noise signal is continuous, time - varying, and contains various frequency components. When the analog noise signal is input to the VGA, the VGA amplifies the signal according to its current gain level (i.e., the maximum level). The amplification process involves increasing the amplitude of the input signal while trying to keep the waveform and frequency characteristics of the signal unchanged. The amplification circuit inside the VGA may include operational amplifiers, transistors, or other amplification components, which work under the action of the control signal to achieve signal amplification. The analog noise signal after being amplified by the VGA is output to the analog - to - digital converter (ADC). The amplitude of the output signal is larger than that of the input signal, but it maintains the randomness and frequency characteristics of the input signal. This amplified signal provides sufficient signal amplitude and dynamic range for subsequent analog - to - digital conversion and random - number generation.
[0084] S203. The analog - to - digital converter performs analog - to - digital conversion on the amplified analog noise signal to obtain an analog - digital signal, and sends the converted analog - digital signal to the self - test controller.
[0085] Among them, the analog-to-digital converter ADC receives the amplified analog noise signal from the variable gain amplifier VGA. The analog-to-digital converter converts the analog signal into a digital signal, that is, the noise digital signal. The converted noise digital signal is sent to the self-test controller for further processing.
[0086] S204. The self-test controller is used to intercept a specified length of bit values at a specified position of the received noise digital signal to generate a random number, and send the generated random number to the WiFi frame generator.
[0087] Among them, the self-test controller intercepts a segment of bit values at a specified position from the received noise digital signal. This segment of bit values is used as the basis for generating a random number, and a random number can be generated through a certain algorithm or directly using the bit values themselves. The generated random number is sent to the WiFi frame generator.
[0088] In some embodiments of the present application, after the analog-to-digital converter completes the conversion of the analog noise signal, it outputs a 16-bit noise digital signal. This signal is discrete and consists of a series of 0s and 1s, and each bit corresponds to a quantization level of the analog signal during the conversion process.
[0089] After receiving this 16-bit noise digital signal, the self-test controller needs to intercept a segment of bit values as a random number from it. According to the requirements, here we choose to intercept the lower 8-bit bit values. The lower 8 bits means starting from the lowest bit (i.e., the rightmost) of the 16-bit digital signal and continuously taking 8 bits.
[0090] The intercepted 8-bit bit values are directly used as random numbers. Since the noise signal itself is random, the converted digital signal also has a certain degree of randomness. Therefore, the intercepted lower 8-bit bit values also possess the characteristics of random numbers and can be used in subsequent tests or encryption and other scenarios that require random numbers.
[0091] The generated random number is then sent to the WiFi frame generator. The WiFi frame generator will use this random number to determine parameters such as the PPDU type, rate, and frame length of this test, so as to construct a WiFi data frame that conforms to the 802.11 protocol.
[0092] Through the above process, the self-test controller can effectively extract random numbers from the output of the analog-to-digital converter, providing a basis for subsequent WiFi frame generation and testing. This method utilizes the randomness of the noise signal to ensure the unpredictability and uniformity of the generated random numbers, meeting the requirements for random numbers in the test.
[0093] S205. The WiFi frame generator determines the PPDU type, rate, and frame length for this test based on the multiple random numbers received, generates the current WiFi data frame that complies with the 802.11 protocol according to the determined parameter values, and sends the current WiFi data frame to the TX controller and the accumulator.
[0094] Among them, the WiFi frame generator receives multiple random numbers from the self-test controller. Based on these random numbers, the WiFi frame generator determines parameters such as the PPDU (Physical Layer Protocol DataUnit) type, rate, and frame length for this test. Using these parameters, the WiFi frame generator constructs a WiFi data frame that complies with the 802.11 protocol. The generated WiFi data frame is sent to the TX controller and the accumulator.
[0095] In some embodiments of the present application, the WiFi frame generator determines the PPDU type, rate, and frame length for this test based on the multiple random numbers sent by the self-test controller, and generates the current WiFi data frame that complies with the 802.11 protocol according to the determined parameter values, including:
[0096] Obtain the first random number from the self-test controller, intercept the low 7-bit bit value in the first random number, query the matching PPDU type and rate in the preset first mapping table according to the intercepted bit value, and use the matching PPDU and rate as the PPDU field value and rate field value in the frame header; see attachment Figure 1 , the principle of weight allocation is to generate as many high-rate frames as possible to save test time and improve efficiency;
[0097] Obtain the second random number, intercept the low 6-bit bit value in the second random number, query the corresponding frame length in the preset second mapping table according to the intercepted bit value, and use the queried frame length as the frame length of the current WiFi frame header;
[0098] Obtain the third random number rand, intercept the bit value from the 3rd bit to the 4th bit in the third random number as the type field value, and intercept the 5th bit to the 8th bit in the third random number as the subtype field value, and determine whether the type field value and the subtype field value satisfy the mapping relationship between the type field value and the subtype field value specified in the preset third mapping table. If the judgment result is yes, continue to the next step; if the judgment result is no, re-obtain the third random number until the requirements are met;
[0099] Perform an AND operation between the third random number and 0xfc, and use the operation result as the lower 8 bits in the FrameControl field value, that is, limit the ProtocolVersion field value = 0, because the WiFi chip only supports data frames of protocol version 0;
[0100] Obtain a fourth random number, perform an AND operation between the fourth random number and 0xbf, and use the operation result as the upper 8 bits in the FrameControl field value, that is, limit the ProtectedFrame field value = 0 and do not perform encryption and decryption tests;
[0101] Obtain two new random numbers as the duration field value;
[0102] Obtain 6 random numbers as the Address1 field value; (MAC address matching is not performed in the self-test mode, so it can be random, and the A2 field value / A3 field value / A4 field value can be random)
[0103] Judge whether the Address2 field value is set in the frame header according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value. If the judgment result is no, continue to the next step; if yes, re-obtain 6 random numbers as the Address2 field value;
[0104] Judge whether the Address3 field value is set in the frame header according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value. If the judgment result is no, continue to the next step; if the judgment result is yes, obtain 6 random numbers as the Address3 field value;
[0105] Judge whether the SequenceControl field value is set in the frame header according to the type field value. If the judgment result is no, continue to the next step; if the judgment result is yes, obtain 2 random numbers as the SequenceControl field value;
[0106] Judge whether the Address4 field value is set in the frame header according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value. If the judgment result is no, continue to the next step; if the judgment result is yes, re-obtain 6 random numbers as the Address4 field value;
[0107] Determine whether the QosControl field value is set in the frame header according to the type field value and the subtype field value. If the judgment result is no, continue to the next step. If the judgment result is yes, obtain two random numbers again as the QosControl field value;
[0108] Determine whether the HTControl field value is set in the frame header according to the HTCOrder field value in the FrameControl field value. If the judgment result is no, continue to the next step. If the judgment result is yes, obtain four random numbers again as the HTCorder field value;
[0109] Obtain multiple random numbers until the length of the frame header is reached, thereby generating the frame header of the current WiFi data frame (the FCS field value is not generated in the frame header);
[0110] Then obtain multiple random numbers to generate the frame body of the current WiFi data frame, and assemble the frame header and the frame body to generate the current WiFi data frame.
[0111] Among them, the process of generating the WiFi data frame is described in detail below:
[0112] See Figure 5 As shown in the schematic diagram of the data structure of the frame header of the WiFi data frame, the frame header includes multiple fields. See Figure 6 The schematic diagram of the data structure of the Frame Control field shown.
[0113] 1. Determine the PPDU type and rate.
[0114] Obtain the first random number: The WiFi frame generator obtains the first random number from the self-test controller.
[0115] Intercept the lower 7 bits: Intercept the bit value of the lower 7 bits in the first random number.
[0116] Query the mapping table: Query the matching PPDU type and rate in the preset first mapping table according to the intercepted bit value. This mapping table is preset according to the test requirements and the 802.11 protocol standard, and the weight distribution principle is to generate as many high-rate frames as possible to save test time. See Figure 3 , Figure 3 For the schematic diagram of the first mapping table.
[0117] Set the frame header fields: Use the matching PPDU type and rate as the PPDU field value and rate field value in the frame header.
[0118] 2. Determine the frame length.
[0119] Obtain the second random number: The WiFi frame generator obtains the second random number.
[0120] Extract the lower 6 bits: Extract the bit values of the lower 6 bits from the second random number.
[0121] Query the mapping table: Query the corresponding frame length in the preset second mapping table according to the extracted bit values.
[0122] Set the frame header field: Use the queried frame length as the frame length field value of the current WiFi frame header. See Figure 4 for the schematic diagram of the second mapping table.
[0123] 3. Set the FrameControl field.
[0124] Obtain the third random number: The WiFi frame generator obtains the third random number rand.
[0125] Extract the type and subtype fields: Extract the 3rd to 4th bits in rand as the type field value, and extract the 5th to 8th bits as the subtype field value.
[0126] Verify the mapping relationship: Determine whether the type field value and the subtype field value satisfy the mapping relationship specified in the preset third mapping table. See Figure 7 , for the schematic diagram of the third mapping table.
[0127] If satisfied, continue to the next step.
[0128] If not satisfied, re-obtain the third random number and verify until the requirements are met.
[0129] Set the lower 8 bits through AND operation: Perform an AND operation between the third random number and 0xfc, and use the result as the lower 8 bits in the FrameControl field value to ensure that the ProtocolVersion field value is 0.
[0130] Set the upper 8 bits through AND operation: Obtain the fourth random number, perform an AND operation between it and 0xbf, and use the result as the upper 8 bits in the FrameControl field value to ensure that the ProtectedFrame field value is 0 and no encryption / decryption test is performed.
[0131] 4. Set other frame header fields.
[0132] Obtain the duration field value: The WiFi frame generator obtains two new random numbers as the duration field value.
[0133] Obtain the Address1 field value: Obtain 6 random numbers as the Address1 field value (in the self-test mode, MAC address matching is not performed, so it can be random).
[0134] Judge and set the value of the Address2 field: Judge whether the Address2 field value is set in the frame header according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value.
[0135] If not, continue to the next step.
[0136] If so, re-obtain 6 random numbers as the Address2 field value.
[0137] Judge and set the value of the Address3 field: Similarly, judge and set the value of the Address3 field.
[0138] Judge and set the value of the SequenceControl field: Judge whether the SequenceControl field value is set in the frame header according to the type field value.
[0139] If not, continue to the next step.
[0140] If so, obtain 2 random numbers as the SequenceControl field value.
[0141] Judge and set the value of the Address4 field: Judge whether the Address4 field value is set in the frame header according to the relevant fields in the FrameControl field value, and set accordingly.
[0142] Judge and set the value of the QosControl field: Judge whether the QosControl field value is set in the frame header according to the type field value and subtype field value, and set accordingly.
[0143] Judge and set the value of the HTControl field: Judge whether the HTControl field value is set in the frame header according to the HTCOrder field value in the FrameControl field value, and set accordingly.
[0144] 5. Generate the frame header and frame body.
[0145] Generate the frame header: Continue to obtain multiple random numbers until the length of the frame header is reached, thereby generating the frame header of this WiFi data frame (the FCS field value is not generated in the frame header).
[0146] Generate the frame body: Obtain multiple random numbers to generate the frame body of this WiFi data frame.
[0147] Assemble the frame: Assemble the frame header and frame body to generate this WiFi data frame.
[0148] Through the above process, the WiFi frame generator can flexibly generate WiFi data frames compliant with the 802.11 protocol based on multiple random numbers sent by the self-test controller for subsequent communication tests.
[0149] S206. The TX controller transmits the current WiFi data frame to the physical layer controller.
[0150] Among them, the TX controller receives the WiFi data frame from the WiFi frame generator. The TX controller passes the data frame to the physical layer controller PHY for subsequent modulation and transmission.
[0151] S207. The accumulator obtains the current transmission accumulation value based on the summation result of the current WiFi data frame and the previous WiFi data frame, and sends the current transmission accumulation value to the comparator.
[0152] Among them, the accumulator CS receives the current WiFi data frame from the WiFi frame generator. The accumulator CS accumulates the current data frame with the previous data frame (if any) to obtain the current transmission accumulation value. The accumulator CS sends the transmission accumulation value to the comparator CMP for subsequent comparison. It should be noted that at the first test, the previous data frame is initialized to 0;
[0153] S208. The physical layer controller digitally modulates the WiFi data frame to obtain modulated data, and sends the modulated data to the memory.
[0154] Among them, the physical layer controller PHY receives the WiFi data frame from the TX controller. The data frame is digitally modulated, such as QPSK, 16-QAM, etc., to obtain modulated data. The modulated data is sent to the memory for storage.
[0155] S209. The memory stores the current modulated data in response to the write instruction of the CPU, and serves as the current received test data.
[0156] Among them, the memory responds to the write instruction of the CPU and receives the modulated data from the physical layer controller. The memory stores the data as the current received test data.
[0157] S210. The memory is used to send the current received test data to the physical layer controller through the first input terminal of the multiplexer in response to the read instruction of the CPU.
[0158] Among them, the memory responds to the read instruction of the CPU and sends the stored current received test data to the physical layer controller through the first input terminal of the multiplexer.
[0159] S211. The physical layer controller is used to demodulate the current test data to obtain the current demodulated data and send the current demodulated data to the RX controller.
[0160] Among them, the physical layer controller receives the test data from the memory, demodulates the data to recover the original WiFi data frame, and the demodulated data is sent to the RX controller.
[0161] S212. The RX controller forwards the current demodulated data to the accumulator.
[0162] Among them, before forwarding the current demodulated data to the accumulator, the RX controller can perform some additional processing, such as: decoding verification, integrity verification, etc.
[0163] S213. The accumulator obtains the current received accumulation value according to the summation result of the current demodulated data and the previous demodulated data, and sends the current received cumulative value to the comparator.
[0164] Among them, after receiving the demodulated data from the RX controller, the accumulator adds it to the demodulated data stored last time. This accumulation process may be a simple numerical addition or a more complex mathematical operation, depending on the actual requirements. The accumulator stores the result of the current accumulation (i.e., the current received accumulation value) for subsequent use. At the same time, update the previous demodulated data to the current demodulated data to prepare for the next accumulation. The accumulator sends the current received accumulation value to the comparator through the internal data bus or communication interface for the next comparison operation. It should be noted that at the first test, the previous adjustment data is initialized to 0.
[0165] S214. The comparator determines whether the current received accumulation value is equal to the current sent accumulation value; if they are equal, it sends the current test pass signal to the self-test controller, and if they are not equal, it sends the current test fail signal to the self-test control.
[0166] Among them, the comparator receives the current received accumulation value from the accumulator and compares it with the current sent accumulation value calculated in S207.
[0167] If the two accumulation values are equal, it means that the data transmission and processing process in the current test is correct, and the comparator sends the current test pass signal to the self-test controller. If the two accumulation values are not equal, it means that there is a data transmission error or processing exception, and the comparator sends the current test fail signal to the self-test controller. The comparator sends the test pass or test fail signal to the self-test controller through the internal signal line or communication interface.
[0168] When the self - test controller receives the current test pass signal from the comparator, it notifies the CPU of the current test success signal, and determines whether the current test count is less than the loop count limit. If so, it increments the current count value by 1, instructs the WiFi frame generator to generate the next WiFi data frame to perform the next test. If not, it stops the test; when receiving the test failure signal from the comparator, it notifies the CPU of the current test failure signal.
[0169] Among them, the self - test controller receives the test pass or test failure signal from the comparator. If the received signal is a test pass signal, the self - test controller: sends the current test success signal to the CPU, notifying the CPU that the current test has passed. Checks whether the current test count is less than the loop count limit. If so, increments the current count value by 1, and instructs the WiFi frame generator to generate the next WiFi data frame to perform the next test. If not, stops the test process.
[0170] S216. In response to the current test failure signal, the CPU reads the current test data from the memory for analysis.
[0171] Among them, if the received signal is a test failure signal, the self - test controller sends the current test failure signal to the CPU, notifying the CPU that the current test has not passed. The self - test controller may also trigger some additional error - handling mechanisms, such as recording error logs, restarting the test process, etc.
[0172] In some embodiments of the present application, the accumulator receives the current WiFi data frame to be sent and the previously sent WiFi data frame stored as inputs. These data frames are usually represented in binary form and contain a series of data bits. The accumulator adds the current WiFi data frame and the previous WiFi data frame bit by bit. This summation operation may be implemented by a binary adder, which can add two binary numbers and produce a sum. The sum result may be a relatively long binary number, but the accumulator only needs the lower 8 bits as the current send accumulation value. Extracting the lower 8 bits is usually achieved through bit masking or shift operations to ensure that only the lowest 8 bits of the sum result are retained. The accumulator outputs the extracted lower 8 bits as the current send accumulation value for subsequent comparison processes.
[0173] The accumulator receives the data obtained from the current demodulation and the data obtained from the previous demodulation stored as input. The demodulated data is extracted from the received WiFi signal and is usually also represented in binary form. The accumulator adds the current demodulated data and the previous demodulated data bit by bit. Similar to the summation operation for sending the accumulated value, this is also implemented through a binary adder. The summation result may also be a relatively long binary number, but the accumulator only needs the lower 8 bits as the accumulated value for the current reception. The method of intercepting the lower 8 bits is the same as that for the sent accumulated value, using a bit mask or a shift operation. The accumulator outputs the intercepted lower 8 bits as the accumulated value for the current reception for subsequent comparison processes.
[0174] Intercepting the lower 8 bits as the accumulated value is a method of simplified processing, which can greatly reduce the amount of data to be calculated.
[0175] The embodiments of the present application have the following technical effects:
[0176] This solution utilizes built-in components such as a self-test controller, a WiFi frame generator, an accumulator, and a comparator to implement an automated test process. Without external professional test equipment, the test can be started only by configuring test parameters through the CPU, greatly simplifying the complexity of the test method. Through the preset upper limit of the number of loops and the automatically generated WiFi data frames, the test process can be carried out automatically, reducing manual intervention and improving test efficiency.
[0177] The self-test system can quickly generate WiFi data frames compliant with the 802.11 protocol and perform data transmission and reception tests through the built-in physical layer controller, TX controller, and RX controller. The design of the accumulator and the comparator makes the verification process of the test results more efficient, enabling a quick judgment on whether the test passes, thus shortening the time for a single test. The loop test mechanism allows multiple consecutive tests to be carried out before reaching the upper limit of the number of loops, further improving test efficiency and shortening the overall test time.
[0178] Since this solution does not require external professional test equipment and can complete the test only by using the components inside the WiFi chip, the procurement cost of the test equipment is greatly reduced. The automated test process reduces the need for manual testing and lowers the labor cost. Through the design of the built-in memory and multiplexer, the storage and reuse of test data are realized, avoiding resource waste caused by repeated tests and further reducing the test cost.
[0179] The above-described embodiments do not constitute a limitation on the protection scope of the technical solution. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the above embodiments shall be included within the protection scope of the technical solution.
Claims
1. A baseband self-test method for a WiFi chip, characterized in that: The WiFi chip includes: a self-test controller, a WiFi frame generator, an accumulator, a comparator, a TX controller, an RX controller, a physical layer controller, a multiplexer, a memory, a digital-to-analog converter, an analog-to-digital converter, an adjustable gain amplifier and a CPU; The self-test controller is respectively connected to the input end of the WiFi frame generator, the output end of the comparator, the CPU and the output end of the analog-to-digital converter, the input end of the analog-to-digital converter is connected to the output end of the adjustable gain amplifier, and the adjustable gain amplifier is connected to the radio frequency antenna; The output end of the WiFi frame generator is connected to the first input end of the accumulator and the input end of the TX controller respectively; the first output end of the accumulator is connected to the first input end of the comparator, and the second output end of the accumulator is connected to the second input end of the comparator; The output end of the TX controller is connected to the physical layer controller, and the physical layer controller is respectively connected to the input end of the digital-to-analog converter and the input end of the storage; An input end of the RX controller is connected to the physical layer controller, and an output end of the RX controller is connected to a second input end of the accumulator; The first input end of the multiplexer is connected to the memory, the second input end of the multiplexer is connected to the analog-to-digital converter, and the output end of the multiplexer is connected to the physical layer controller; Wherein, the method comprises: The self-test controller configures the upper limit of the number of cycles in response to the configuration instruction of the CPU, and clears the current count value when a test start instruction is detected; The adjustable gain amplifier receives an analog noise signal from an air interface, amplifies the analog noise signal, and sends the amplified analog noise signal to the analog-to-digital converter; The analog-to-digital converter performs analog-to-digital conversion on the amplified analog noise signal to obtain an analog-to-digital signal, and sends the converted analog-to-digital signal to the self-test controller; The self-test controller is used to intercept a bit value of a specified length at a specified position of the received noise digital signal to generate a random number, and send the generated random number to the WiFi frame generator; The WiFi frame generator determines the PPDU type, rate and frame length of this test according to the received multiple random numbers, generates this WiFi data frame that complies with the 802.11 protocol according to the determined parameter values, and sends the current WiFi data frame to the TX controller and the accumulator; The TX controller transmits the current WiFi data frame to the physical layer controller; The accumulator obtains the current transmission cumulative value according to the sum of the current WiFi data frame and the previous WiFi data frame, and sends the current transmission cumulative value to the comparator; The physical layer controller digitally modulates the WiFi data frame to obtain modulated data, and sends the modulated data to the memory; The memory stores the modulated data in response to the write instruction of the CPU, and uses the received test data as the received test data; The memory is used to send the received test data to the physical layer controller through the first input terminal of the multiplexer in response to the read instruction of the CPU; The physical layer controller is used to demodulate the test data to obtain demodulated data, and send the demodulated data to the RX controller; The RX controller forwards the demodulated data to the accumulator; The accumulator obtains the current reception accumulated value according to the sum of the current demodulated data and the previous demodulated data, and sends the current reception accumulated value to the comparator; The comparator determines whether the received accumulated value is equal to the sent accumulated value; if they are equal, a test pass signal is sent to the self-test controller; if they are not equal, a test fail signal is sent to the self-test controller; When the self-test controller receives the test pass signal from the comparator, it notifies the CPU of the test success signal, and determines whether the current test number is less than the upper limit of the number of cycles. If yes, it adds 1 to the current count value, instructs the WiFi frame generator to generate the next WiFi data frame to perform the next test, and if no, stops the test; when receiving the test failure signal from the comparator, it notifies the CPU of the test failure signal; In response to the test failure signal, the CPU reads the test data from the memory for analysis.
2. The method according to claim 1, characterized in that A test mode register is provided in the self-test controller, and when it is detected that the value in the test mode register is equal to a preset value, it is determined that the baseband test instruction is received.
3. The method according to claim 1 or 2, characterized in that: The step of intercepting a bit value of a specified length at a specified position of the received noise digital signal to generate a random number comprises: The output bit width of the analog-to-digital converter is 16, and the length of the noise digital signal is 16 bits; The lower 8 bits of the received noisy digital signal are intercepted as random numbers.
4. The method according to claim 3, characterized in that: The gain level of the adjustable gain amplifier is set to the maximum level.
5. The method according to claim 1, 2 or 4, characterized in that: The accumulator obtains the current transmission accumulated value according to the sum of the current WiFi data frame and the previous WiFi data frame, including: The accumulator sums the current WiFi data frame and the previous WiFi data frame to obtain a sum result, and intercepts the lower 8 bits of the sum result as the accumulated value sent this time; The accumulator obtains the current received accumulated value according to the sum of the current demodulated data and the last demodulated data, including: The accumulator sums the demodulated data of this time and the demodulated data of the previous time to obtain a sum result, and intercepts the lower 8 bits in the sum result as the accumulated value of this reception.
6. The method according to claim 5, characterized in that The WiFi frame generator determines the PPDU type, rate and frame length of this test according to multiple random numbers sent by the self-test controller, and generates this WiFi data frame that complies with the 802.11 protocol according to the determined parameter values, including: Obtain a first random number from the self-test controller, intercept the lower 7-bit bit value in the first random number, query the matching PPDU type and rate in a preset first mapping table according to the intercepted bit value, and use the matching PPDU and rate as the PPDU field value and rate field value in the frame header; see Figure 1, the principle of weight allocation is to generate as many high-rate frames as possible to save test time and improve efficiency; Obtain a second random number, intercept the bit value of the lower 6 bits in the second random number, query the corresponding frame length in a preset second mapping table according to the intercepted bit value, and use the queried frame length as the frame length of this WiFi frame header; Obtain a third random number rand, intercept the bit values of the 3rd to 4th bits in the third random number as the type field value, and intercept the 5th to 8th bits in the third random number as the subtype field value, and determine whether the type field value and the subtype field value satisfy the mapping relationship between the type field value and the subtype field value specified in the preset third mapping table; if the determination result is yes, proceed to the next step; if the determination result is no, re-obtain the third random number until the requirement is met; Perform an AND operation between the third random number and 0xfc, and use the operation result as the lower 8 bits of the FrameControl field value, that is, limit the ProtocolVersion field value to 0, because the WiFi chip only supports data frames of protocol version 0; Get a fourth random number, perform an AND operation on the fourth random number and 0xbf, and use the operation result as the upper 8 bits of the FrameControl field value, that is, limit the ProtectedFrame field value to 0, and do not perform encryption and decryption test; Get two new random numbers as the duration field value; Get 6 random numbers as the Address1 field value; (MAC address matching is not performed in self-test mode, so it can be random, and the A2 field value / A3 field value / A4 field value can be random) Determine whether the frame header has an Address2 field value according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value. If the determination result is no, proceed to the next step. If yes, re-obtain 6 random numbers as the Address2 field value. Determine whether the Address3 field value is set in the frame header according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value. If the determination result is no, proceed to the next step. If the determination result is yes, obtain 6 random numbers as the Address3 field value. Determine whether the SequenceControl field value is set in the frame header according to the type field value. If the determination result is no, proceed to the next step. If the determination result is yes, obtain two random numbers as the SequenceControl field value. Determine whether the Address4 field value is set in the frame header according to the type field value, subtype field value, fromds field value, and tods field value in the FrameControl field value. If the determination result is no, proceed to the next step. If the determination result is yes, obtain 6 random numbers again as the Address4 field value. Determine whether the QosControl field value is set in the frame header according to the type field value and the subtype field value. If the determination result is no, proceed to the next step. If the determination result is yes, re-obtain two random numbers as the QosControl field value. According to the HTCOrder field value in the FrameControl field value, determine whether the HTControl field value is set in the frame header. If the determination result is no, proceed to the next step. If the determination result is yes, re-set 4 random numbers as the HTCorder field value. Obtain multiple random numbers until the length of the frame header is reached, thereby generating the frame header of this WiFi data frame (the FCS field value is not generated in the frame header); Then, multiple random numbers are obtained to generate the frame body of this WiFi data frame, and the frame header and the frame body are assembled to generate the WiFi data frame.
7. A WiFi chip, characterized in that: include: A self-test controller, a WiFi frame generator and a WiFi chip, wherein the WiFi chip includes: an accumulator, a comparator, a TX controller, an RX controller, a physical layer controller, a multiplexer, a memory, a digital-to-analog converter, an analog-to-digital converter, an adjustable gain amplifier and a CPU; The self-test controller is respectively connected to the input end of the WiFi frame generator, the output end of the comparator, the CPU and the output end of the analog-to-digital converter, the input end of the analog-to-digital converter is connected to the output end of the adjustable gain amplifier, and the adjustable gain amplifier is connected to the radio frequency antenna; The output end of the WiFi frame generator is connected to the first input end of the accumulator and the input end of the TX controller respectively; the first output end of the accumulator is connected to the first input end of the comparator, and the second output end of the accumulator is connected to the second input end of the comparator; The output end of the TX controller is connected to the physical layer controller, and the physical layer controller is respectively connected to the input end of the digital-to-analog converter and the input end of the storage; An input end of the RX controller is connected to the physical layer controller, and an output end of the RX controller is connected to a second input end of the accumulator; The first input end of the multiplexer is connected to the memory, the second input end of the multiplexer is connected to the analog-to-digital converter, and the output end of the multiplexer is connected to the physical layer controller; The self-test controller is used to configure the upper limit of the number of cycles, and when a test start instruction is detected, the current count value is cleared; The adjustable gain amplifier is used to receive an analog noise signal from an air interface, amplify the analog noise signal, and send the amplified analog noise signal to the analog-to-digital converter; The analog-to-digital converter is used to perform analog-to-digital conversion on the amplified analog noise signal to obtain an analog-to-digital signal, and send the converted analog-to-digital signal to the self-test controller; The self-test controller is further used to intercept a bit value of a specified length at a specified position of the received noise digital signal to generate a random number, and send the generated random number to the WiFi frame generator; The WiFi frame generator is used to determine the PPDU type, rate and frame length of this test according to the received multiple random numbers, generate this WiFi data frame that complies with the 802.11 protocol according to the determined parameter values, and send the current WiFi data frame to the TX controller and the accumulator; The TX controller is used to transmit the current WiFi data frame to the physical layer controller; The accumulator is used to calculate the checksum of the current WiFi data frame, and sum the calculated checksum and the last sent accumulated value to obtain the current sent accumulated value, and send the current sent accumulated value to the comparator; The physical layer controller is used to digitally modulate the WiFi data frame to obtain modulated data, and send the modulated data to the memory; The memory is used to store the current modulation data in response to the write instruction of the CPU, and to serve as the current reception test data; The memory is further used to send the received test data to the physical layer controller through the first input terminal of the multiplexer in response to the read instruction of the CPU; The physical layer controller is further configured to demodulate the test data to obtain demodulated data, and send the demodulated data to the RX controller; The RX controller is used to forward the demodulated data to the accumulator; The accumulator is used to calculate the checksum of the demodulated data, sum the calculated checksum and the accumulated value received last time to obtain the accumulated value received this time, and send the accumulated value received this time to the comparator; The comparator is used to determine whether the received accumulated value is equal to the sent accumulated value; if they are equal, a test pass signal is sent to the self-test controller; if they are not equal, a test fail signal is sent to the self-test controller; The self-test controller is further used to notify the CPU of the success signal of the test when receiving the test pass signal from the comparator, and to determine whether the current test number is less than the upper limit of the number of cycles, if yes, to increase the current count value by 1, to instruct the WiFi frame generator to generate the next WiFi data frame to perform the next test, if no, to stop the test; and to notify the CPU of the test failure signal when receiving the test failure signal from the comparator; The CPU is further configured to read the test data from the memory for analysis in response to the test failure signal.
8. A wireless communication device, comprising the WiFi chip according to claim 7.