Radio frequency test method, system, and readable storage medium
Patent Information
- Application Number
- CN202610927573.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-24
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本申请的主要目的在于提供一种射频测试方法、系统及可读存储介质,旨在解决如何在不依赖有线接口的情况下实现射频测试模式的可靠切换的技术问题
本申请实施例通过蓝牙设备在与上位机之间建立蓝牙无线通信连接,上电后从引导程序区自动跳转至第一应用分区并执行正常蓝牙功能程序,保证了设备常规工作状态下的正常运行。当需要通过无线方式对设备进行射频性能测试时,上位机利用已存在的蓝牙无线链路发送射频测试命令,蓝牙设备接收到该命令后,无需借助任何UART串口、GPIO引脚等有线物理接口来传输控制指令,而是依靠内部存储架构中独立设置的第二应用分区以及引导程序区的跳转管理能力,从当前运行的第一应用分区切换至第二应用分区,执行其中预先存储的射频测试功能程序。在此过程中,第二应用分区用于存储射频测试功能程序,与第一应用分区中存储的正常蓝牙功能程序相互隔离,使得测试代码不会干扰正常功能代码的运行逻辑,同时也保证了接收到无线命令后能够快速、确定地完成模式跳转。引导程序区作为跳转的仲裁与执行核心,负责接收来自无线链路的测试命令并控制程序指针从第一应用分区转移到第二应用分区,避免了因同时存在两套功能代码而导致的执行冲突。整个过程完全依赖于蓝牙无线通信和芯片内部的分区跳转机制,不需要设备预留任何物理接触点或引出有线测试接口,从而在不依赖有线接口的情况下实现了射频测试模式的可靠切换。
Smart Images

Figure CN122932847A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication technology, and in particular to a radio frequency testing method, system, and readable storage medium. Background Technology
[0002] Bluetooth technology is widely used in various electronic devices such as smart wearables, wireless audio, and IoT sensors. To ensure product quality, the radio frequency performance of Bluetooth devices needs to be tested during the production process. This usually requires putting the device into a specific test mode to measure performance indicators such as transmit power, frequency accuracy, and receive sensitivity.
[0003] Radio frequency (RF) testing of Bluetooth devices typically employs the following method: The test equipment establishes a physical connection with the Bluetooth module via a wired interface, such as a UART (Universal Asynchronous Receiver / Transmitter) serial port or GPIO (General Purpose Input / Output) pins. Control commands are then sent through this wired connection to cause the module to enter or exit RF test mode. This method relies on physical contact points to achieve mode switching, ensuring the reliability and real-time performance of the control.
[0004] However, as Bluetooth devices evolve towards miniaturization and waterproofing / dustproofing, many products are no longer designed with wired interfaces, meaning communication between the device and external devices is solely via Bluetooth. In these products without physical interfaces, traditional wired control methods are impossible, making RF testing difficult. Therefore, how to reliably switch RF test modes without relying on a wired interface has become a pressing issue. Summary of the Invention
[0005] The main objective of this application is to provide a radio frequency (RF) testing method, system, and readable storage medium, aiming to solve the technical problem of how to reliably switch RF testing modes without relying on a wired interface.
[0006] To achieve the above objectives, this application provides a radio frequency (RF) testing method applied to a Bluetooth device. The Bluetooth device establishes a Bluetooth wireless communication connection with a host computer. The Bluetooth device has a bootloader area and an application area. The application area includes a first application partition and a second application partition. The first application partition stores normal Bluetooth function programs, and the second application partition stores RF testing function programs. The RF testing method includes the following steps: In response to the Bluetooth device being powered on, the system jumps from the bootloader area to the first application partition and executes the normal Bluetooth function program. Upon receiving the RF test command sent by the host computer, the system jumps to the second application partition and executes the RF test function program to perform RF testing.
[0007] In one embodiment, the Bluetooth device further includes a settings partition, and before the step of jumping to the second application partition, the method further includes: The test duration is obtained based on the RF test command, and the test duration is written to the setting partition; After the step of jumping to the second application partition, the method further includes: The test duration is read from the setting partition, and the timing duration is obtained from the start of timing after the RF test function program is executed; If the timing duration reaches the test duration, the system will switch from the first application partition back to the second application partition and restore normal Bluetooth functionality.
[0008] In one embodiment, prior to the step of jumping to the second application partition, the method further includes: The RF test plan is obtained based on the RF test command, and the RF test plan is written into the setting partition; The steps of executing the radio frequency test function program include: The RF test plan is read from the settings partition, and the RF test function program is executed based on the RF test plan.
[0009] In one embodiment, after the step of reading the test duration from the settings partition, the method further includes: If it fails to read the test duration from the settings partition, then obtain the preset default test duration; After the timeout period reaches the default test duration, the system jumps back from the first application partition to the second application partition to restore normal Bluetooth functionality.
[0010] In one embodiment, the Bluetooth device includes an application core and a network core, wherein the first application partition and the second application partition are located in the application area of the network core, and the step of receiving the radio frequency test command sent by the host computer includes: The application core receives the RF test command sent by the host computer and forwards the RF test command to the first application partition program currently running on the network core through the inter-core communication channel, so that after the network core receives the RF test command, it jumps to the second application partition and executes the RF test function program.
[0011] In one embodiment, after the step of forwarding the RF test command to the first application partition program currently running on the network core via the inter-core communication channel, the method further includes... After forwarding the RF test command, the application core enters a waiting state, wherein the waiting state is a state in which the application core continues to run but pauses processing Bluetooth-related functions; After the RF test function program is completed, the network core sends an exit test notification to the application core through the inter-core communication channel; The application kernel responds to the exit test notification and exits the waiting state.
[0012] In one embodiment, after the step of executing the RF test function procedure, the method further includes: If a termination test command is received from the host computer during the execution of the RF test function program, the system will jump back from the second application partition to the first application partition.
[0013] In addition, to achieve the above objectives, this application also provides an RF testing system, which includes a Bluetooth device and a host computer connected via Bluetooth wireless communication. The host computer is used to send radio frequency test commands; The Bluetooth device is used to perform the steps of the radio frequency test method described above.
[0014] In one embodiment, the radio frequency test system further includes radio frequency test fixtures; The radio frequency test fixture is used to receive Bluetooth radio frequency signals sent by the Bluetooth device and to evaluate the radio frequency performance of the Bluetooth device based on the received Bluetooth radio frequency signals.
[0015] In addition, to achieve the above objectives, this application also provides a Bluetooth device, including: a display unit and a processor, wherein the display unit is used to display visual training content, and the processor is used to execute the radio frequency testing method as described above.
[0016] In addition, to achieve the above objectives, this application also provides a readable storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the steps of the radio frequency testing method described above.
[0017] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the radio frequency testing method described above.
[0018] One or more technical solutions proposed in this application have at least the following technical effects: This embodiment establishes a Bluetooth wireless communication connection between the Bluetooth device and the host computer. After power-on, it automatically jumps from the bootloader area to the first application partition and executes the normal Bluetooth function program, ensuring normal operation of the device under normal working conditions. When it is necessary to perform RF performance testing on the device wirelessly, the host computer sends an RF test command using the existing Bluetooth wireless link. After receiving the command, the Bluetooth device does not need to use any wired physical interfaces such as UART serial ports or GPIO pins to transmit control instructions. Instead, it relies on the independently set second application partition in its internal storage architecture and the jump management capability of the bootloader area to switch from the currently running first application partition to the second application partition and execute the pre-stored RF test function program therein. During this process, the second application partition is used to store the RF test function program and is isolated from the normal Bluetooth function program stored in the first application partition. This ensures that the test code does not interfere with the running logic of the normal function code and also ensures that the mode switch can be completed quickly and definitively after receiving the wireless command. The bootloader area, acting as the arbitration and execution core for jumps, is responsible for receiving test commands from the wireless link and controlling the program pointer to move from the first application partition to the second application partition, avoiding execution conflicts caused by the simultaneous existence of two sets of functional code. The entire process relies entirely on Bluetooth wireless communication and the chip's internal partitioning mechanism, requiring no physical contact points or wired test interfaces from the device, thus achieving reliable switching of RF test modes without relying on a wired interface. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the first embodiment of the radio frequency testing method of this application; Figure 2 This is a schematic diagram of the Bluetooth device firmware architecture involved in an embodiment of the radio frequency testing method of this application; Figure 3 This is a schematic diagram of the radio frequency (RF) test process involved in one embodiment of the RF test method of this application; Figure 4 This is a schematic diagram of the system architecture of the RF test system of this application; Figure 5This is a schematic diagram of the system architecture involved in one embodiment of the radio frequency test system of this application; Figure 6 This is a schematic diagram of the hardware operating environment involved in the radio frequency testing method apparatus in the embodiments of this application.
[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0023] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] In the manufacturing process of modern electronic products, radio frequency (RF) performance testing of Bluetooth modules is a crucial step. Traditional RF testing methods typically require specialized RF test programs, followed by the reprogramming of the Bluetooth module with a normal program after the test is completed. Furthermore, wired communication is needed to control the Bluetooth module to enter or exit RF test mode. However, this traditional method is unsuitable for products that only support Bluetooth communication and not wired communication.
[0025] To address the aforementioned issues, several improvements have been proposed. For example, the Direct Test Mode (DTM) can be integrated into the network core's bootloader, with a decision on whether to enter DTM mode made during the bootloader phase after a reset. However, this approach suffers from the following problems and drawbacks: ① Bootloader cannot be upgraded: In most Bluetooth chip architectures, the bootloader is located in a read-only storage area or is strictly protected, and does not have the ability to be upgraded online, or the upgrade risk is extremely high.
[0026] ② DTM functional defects lead to product scrapping: Since the DTM test function is placed in the bootloader, once the DTM function has defects or the test parameters need to be updated, the entire bootloader cannot be modified, which may cause a large number of products to fail to complete RF testing, resulting in serious production accidents.
[0027] ③ High functional coupling: Coupling the testing function with the startup and bootstrap function violates the principle of high cohesion and low coupling in software engineering, increasing code complexity and maintenance difficulty.
[0028] ④ Reset operation required: Existing solutions require chip reset to achieve mode switching, which takes a long time and may affect the status of other peripherals.
[0029] Therefore, a more flexible, reliable, upgradeable, and reset-free Bluetooth mode switching solution is needed to address the above issues.
[0030] To address the aforementioned issues, the main solution of this application is as follows: A Bluetooth wireless communication connection is established between the Bluetooth device and the host computer. The Bluetooth device is equipped with a bootloader area and an application area. The application area includes a first application partition and a second application partition. The first application partition is used to store normal Bluetooth function programs, and the second application partition is used to store RF test function programs. In response to the Bluetooth device being powered on, the device jumps from the bootloader area to the first application partition to execute the normal Bluetooth function programs. Upon receiving an RF test command sent by the host computer, the device jumps to the second application partition to execute the RF test function programs to perform RF testing.
[0031] This application establishes a Bluetooth wireless communication connection between the Bluetooth device and the host computer. Upon power-up, the device automatically jumps from the bootloader area to the first application partition and executes the normal Bluetooth function program, ensuring normal operation of the device under normal working conditions. When it is necessary to perform RF performance testing on the device wirelessly, the host computer sends an RF test command using the existing Bluetooth wireless link. After receiving the command, the Bluetooth device does not need to rely on any wired physical interfaces such as UART serial ports or GPIO pins to transmit control instructions. Instead, it relies on the independently set second application partition in its internal storage architecture and the jump management capability of the bootloader area to switch from the currently running first application partition to the second application partition and execute the pre-stored RF test function program therein. During this process, the second application partition is used to store the RF test function program and is isolated from the normal Bluetooth function program stored in the first application partition. This ensures that the test code does not interfere with the running logic of the normal function code and also ensures that the mode switch can be completed quickly and definitively after receiving the wireless command. The bootloader area, acting as the arbitration and execution core for jumps, is responsible for receiving test commands from the wireless link and controlling the program pointer to move from the first application partition to the second application partition, avoiding execution conflicts caused by the simultaneous existence of two sets of functional code. The entire process relies entirely on Bluetooth wireless communication and the chip's internal partitioning mechanism, requiring no physical contact points or wired test interfaces from the device, thus achieving reliable switching of RF test modes without relying on a wired interface.
[0032] Based on this, this application proposes a first embodiment of a radio frequency (RF) testing method. In this embodiment, the RF testing method is applied to a Bluetooth device, which establishes a Bluetooth wireless communication connection with a host computer. The Bluetooth device is provided with a bootloader area and an application area. The application area includes a first application partition and a second application partition. The first application partition is used to store normal Bluetooth function programs, and the second application partition is used to store RF testing function programs. (Refer to...) Figure 1 As shown, the radio frequency testing method includes the following steps S10~S20: Step S10: In response to the Bluetooth device being powered on, jump from the bootloader area to the first application partition and execute the normal Bluetooth function program; The Bluetooth device refers to various electronic devices with Bluetooth wireless communication capabilities, such as smartwatches, smart bracelets, and TWS true wireless Bluetooth earbuds. The host computer refers to the core control device used to control the testing process, such as a personal computer or industrial control computer running dedicated testing software, or a comprehensive test instrument integrating Bluetooth communication modules and RF measurement functions (such as a Bluetooth comprehensive tester). The host computer establishes a wireless connection with the device under test through an external Bluetooth adapter (such as a Bluetooth dongle with a USB interface) and is responsible for generating and issuing RF test commands containing parameters such as the test plan and reset duration.
[0033] After the Bluetooth device is powered on, the hardware resets and first executes the boot code in the bootloader area. The bootloader area completes the basic system initialization work, including setting the system clock, initializing the stack pointer, configuring the necessary interrupt vector table, and disabling peripherals such as the watchdog timer.
[0034] Subsequently, the bootloader area performs integrity checks on the normal Bluetooth function programs stored in the first application partition. For example, it checks the CRC (Cyclic Redundancy Check) value or signature at the end of the firmware to confirm that the program has not been damaged or tampered with. After the verification passes, the bootloader area transfers control to the starting address of the first application partition by modifying the program counter (PC) or executing a long jump instruction.
[0035] After the program redirects, the Bluetooth device begins executing the normal Bluetooth function program in the first application partition, entering the regular operating mode. In this mode, the device can perform standard Bluetooth broadcasting, scanning, connection establishment, and data transmission operations, meeting the needs of daily product use scenarios.
[0036] Step S20: Receive the RF test command sent by the host computer, jump to the second application partition, and execute the RF test function program to perform RF test.
[0037] During the normal execution of the Bluetooth function program in the first application partition by the Bluetooth device, the device maintains the established Bluetooth wireless communication connection with the host computer. Through this wireless connection, the host computer sends RF test commands to the Bluetooth device according to a custom command format or standard HCI (Host Controller Interface) commands.
[0038] This command typically contains two parts: the first is the test plan, which defines the specific behavior of the device after entering test mode, such as specifying the test type (continuous transmission, carrier modulation, single-slot reception, etc.), operating frequency, transmission power level, modulation parameters, and test duration; the second is the reset time, which indicates when the device will trigger a reset operation after executing the command write. This reset time can be set to immediate reset or a specific delay time (such as 10 milliseconds, 100 milliseconds, or a custom duration) can be specified to allow sufficient time for command writing and data saving.
[0039] Upon receiving the command, the application layer of the Bluetooth device first parses and verifies its validity, such as checking the command type, data length, and source address to ensure it is indeed a valid RF test trigger command. If the verification fails, the command is ignored, and the device continues to run its normal Bluetooth functionality.
[0040] After successful verification, the Bluetooth device performs a partition jump operation. Specifically, the device can first disable external interrupts currently in operation, pause timer tasks, and optionally save the necessary runtime context. Then, by software reset or directly jumping to the entry address of the second application partition, program control is transferred from the first application partition to the second application partition.
[0041] After a successful jump, the Bluetooth device begins executing the pre-built RF test function program in the second application partition. This program contains the low-level control logic for the Bluetooth RF transceiver, enabling the device to enter specific RF test modes according to test requirements, such as transmitting a continuous carrier, modulating a signal, or entering a receiver sensitivity measurement mode. At this time, the host computer or external testing instruments can measure the Bluetooth device's RF performance indicators such as transmit power, frequency accuracy, and receiver sensitivity, thus completing the RF test without relying on a wired interface. Furthermore, since the first and second application partitions are independent, the execution of the RF test function program will not pollute the storage area of the normal Bluetooth function program, and the device can jump back to the first application partition after the test is completed. Additionally, both partitions can be upgraded independently, facilitating future maintenance and function iteration.
[0042] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. In addition, the Bluetooth device is further provided with a settings partition. Before the step of jumping to the second application partition, the method further includes: Step A10: Obtain the test duration based on the RF test command, and write the test duration into the setting partition; During the normal Bluetooth function program execution, upon receiving an RF test command from the host computer, the device not only recognizes the command as an instruction to trigger entry into RF test mode, but also further parses the test duration from the command parameters. This duration can be dynamically specified by the host computer according to specific test requirements, such as being set to 30 seconds, 60 seconds, or longer.
[0043] The Bluetooth device internally includes an additional settings partition, dedicated to storing runtime configuration parameters and possessing power-loss retention capabilities (such as an EEPROM based on Flash simulation or a dedicated storage area). The device writes the parsed test duration into this settings partition as structured data, ensuring reliable readability even after subsequent partition transitions. Once the write is complete, the device continues with subsequent transition operations.
[0044] After the step of jumping to the second application partition, the method further includes: Step A20: Read the test duration from the setting partition, and obtain the timing duration from the start of timing after executing the RF test function program; After the Bluetooth device successfully jumps to the second application partition and starts executing the RF test function program, during the test program initialization process, it first accesses the settings partition and reads the previously written test duration.
[0045] Subsequently, the RF test function program starts a software timer or utilizes a hardware timing unit, using the start time of the RF test function program as the zero point for timing, and begins timing and updates the timing duration in real time. During the timing process, the device continuously executes the RF test function program, providing a stable RF signal to the host computer or test instrument or responding to received measurement commands.
[0046] Step A30: If the timing duration reaches the test duration, then switch back from the first application partition to the second application partition and restore normal Bluetooth function.
[0047] The RF test function continuously compares the current timing duration with the test duration read from the settings partition while looping through the test tasks. When the timing duration equals or exceeds the test duration for the first time, it is determined that the RF test has been executed for a sufficient amount of time.
[0048] At this point, the device automatically triggers a partition jumpback operation: it disables the test mode enabled in the RF test function program, restores the RF transceiver to its default state, and executes a jump process similar to that in step S20, transferring program control from the second application partition back to the first application partition. After a successful jump, the device re-executes the normal Bluetooth function program in the first application partition, restoring to the regular Bluetooth working mode, without requiring the host computer to send an exit command or reset the device again. This mechanism achieves automated timed exit of RF testing, simplifies the testing process, and avoids increased power consumption or functional abnormalities caused by forgetting to exit the test mode.
[0049] In one possible implementation, prior to the step of jumping to the second application partition, the method further includes: Step B10: Obtain the RF test plan based on the RF test command, and write the RF test plan into the setting partition; When a Bluetooth device receives an RF test command from a host computer, it not only recognizes the command as an instruction to trigger the RF test mode, but also parses the RF test scheme from the command's data payload. This RF test scheme can include one or more sets of test parameters, such as test mode type (transmit continuous carrier, transmit modulated signal, receive sensitivity measurement), test channel (e.g., 2402MHz, 2440MHz, 2480MHz), transmit power level, modulation method, and data packet format.
[0050] To flexibly adapt to different testing needs, the host computer can carry different test schemes with each RF test command without re-flashing the firmware. The Bluetooth device writes the parsed complete RF test scheme into the settings partition in structured data format. As an independent storage area, the settings partition ensures that the RF test program can still reliably read these parameters after switching from the first application partition to the second application partition. After writing is complete, the device continues with subsequent switching operations.
[0051] The steps of executing the radio frequency test function program include: Step B20: Read the RF test plan from the settings partition and execute the RF test function program based on the RF test plan.
[0052] After the Bluetooth device successfully jumps to the second application partition and starts executing the RF test function program, during the test program initialization process, it first accesses the settings partition and reads the previously written RF test plan.
[0053] Subsequently, the RF test function program configures the Bluetooth RF transceiver accordingly based on the read test plan. For example, if the test plan requires the transmission of a continuous carrier, the program sets the RF transceiver to an unmodulated carrier transmission mode and transmits according to the channel and power level specified in the plan.
[0054] In this way, Bluetooth devices can perform corresponding RF test actions according to the test plan dynamically issued by the host computer, without having to compile or burn different firmware for each test scenario, thereby improving the flexibility and efficiency of RF testing.
[0055] In one possible implementation, after the step of reading the test duration from the settings partition, the method further includes: Step C10: If reading the test duration from the settings partition fails, then obtain the preset default test duration; During the process of the Bluetooth device navigating to the second application partition and starting the RF test function program, the program first attempts to read the test duration from the settings partition. However, the read operation fails because the settings partition may not have been written with valid duration data (for example, the RF test command sent by the host computer does not carry the test duration parameter, or the write operation failed due to an error), or the stored data cannot be correctly parsed due to verification errors or format mismatches.
[0056] When a read failure occurs, the RF test function program will not be interrupted or enter an abnormal state. Instead, it will automatically acquire a preset default test duration. This default duration can be pre-defined in the RF test function program code, for example, set to 30 seconds or 60 seconds, as a safeguard test duration parameter to ensure that the test can continue.
[0057] Step C20: After the timing duration reaches the default test duration, switch back from the first application partition to the second application partition to restore normal Bluetooth functionality.
[0058] The RF test function program starts timing from the moment it begins execution, updating the timing duration in real time. While continuously executing the test tasks, the program constantly compares the current timing duration with the acquired default test duration.
[0059] When the timing duration equals or exceeds the default test duration for the first time, the device automatically triggers a partition jumpback operation: it disables the test mode enabled in the RF test function program, restores the RF transceiver to its default state, and executes a jump procedure to transfer program control from the second application partition back to the first application partition. After a successful jump, the device re-executes the normal Bluetooth function program in the first application partition, restoring to the normal Bluetooth working mode.
[0060] Through this mechanism, even if the host computer does not provide a valid test duration parameter, the Bluetooth device can still automatically complete the RF test and exit on its own after a reasonable duration. This avoids the risk that the device will remain in test mode for a long time or fail to automatically return to normal due to missing parameters, thus enhancing the robustness and fault tolerance of the test process.
[0061] Based on the first and / or second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to the first and second embodiments described above can be referred to the above description and will not be repeated hereafter. Based on this, the Bluetooth device includes an application core and a network core, the first application partition and the second application partition are set in the application area of the network core, and the step of receiving the radio frequency test command sent by the host computer includes: Step D10: The application core receives the RF test command sent by the host computer and forwards the RF test command to the first application partition program currently running on the network core through the inter-core communication channel, so that after the network core receives the RF test command, it jumps to the second application partition and executes the RF test function program.
[0062] The Bluetooth device adopts a dual-core architecture, including an application core and a network core. The first and second application partitions are both located in the application area of the network core. The network core is responsible for the execution of the Bluetooth protocol stack and radio frequency-related functions; the application core handles upper-layer application logic, user interaction, and communication with the host computer.
[0063] Assuming a Bluetooth wireless communication connection has been established between the Bluetooth device and the host computer, the RF test command sent by the host computer is first transmitted to the Bluetooth device via the Bluetooth wireless link. This command is received and preliminarily parsed by the application core responsible for communication management, such as determining the command type and verifying data integrity.
[0064] After the application core identifies the command as an RF test command, it needs to forward the command to the network core through the inter-core communication channel. The inter-core communication channel can be implemented using mechanisms such as shared memory, hardware message mailboxes, queues, or interrupts to ensure efficient and reliable data transfer between the two cores. The application core writes the raw command data or the encapsulated instruction structure to the shared buffer and triggers the network core's interrupt or polling flags to notify the network core that there is a new command to process.
[0065] The network core is currently executing the normal Bluetooth function program in the first application partition. When the network core detects command data from the application core in the inter-core communication channel, it reads and parses the RF test command. After confirming the command is valid, the network core performs a jump operation, that is, jumps from the currently running first application partition to the second application partition, and begins executing the RF test function program stored in the second application partition, thereby completing the RF test without relying on a wired interface. Through the separation of responsibilities between the application core and the network core and the inter-core communication mechanism, even if the RF test function program is located in the network core, the host computer can still indirectly control the mode switching of the network core through the application core, ensuring the feasibility of wireless RF testing under the dual-core architecture.
[0066] In one possible implementation, after the step of forwarding the RF test command to the first application partition program currently running on the network core via the inter-core communication channel, the method further includes... Step E10: After forwarding the RF test command, the application core enters a waiting state, wherein the waiting state is a state in which the application core continues to run but pauses processing Bluetooth-related functions; After the application core successfully forwards the RF test command to the network core through the inter-core communication channel, in order to avoid communication chaos or status errors caused by the application core still trying to send normal Bluetooth service commands (such as initiating connection, sending data, etc.) while the network core is executing the RF test function program, the application core actively enters a waiting state.
[0067] In this waiting state, the application core's system clock, task scheduling, and peripheral drivers (such as sensors and displays) continue to operate normally to ensure uninterrupted basic application layer functions of the device. However, the application core suspends all Bluetooth-related functional processing, which may include: ceasing to provide Bluetooth service interfaces to upper-layer applications, ceasing to send any Bluetooth control commands or data packets to the network core, ceasing to process Bluetooth protocol stack callbacks or status notifications from the network core, and ceasing to respond to any Bluetooth-related application layer requests. This selective suspension ensures that the network core can focus on executing RF test functions without being interfered with by Bluetooth services from the application core. Once the network core completes the test and sends an exit test notification through the inter-core communication channel, the application core exits the waiting state and resumes normal processing of Bluetooth-related functions.
[0068] Step E20: After the RF test function program is completed, the network core sends an exit test notification to the application core through the inter-core communication channel. The network core executes the RF test function program in the second application partition. After completing the test according to the preset conditions (such as the timing duration reaching the test duration or the default test duration, or receiving an exit command from the host computer), it executes the partition jump operation, jumps from the second application partition back to the first application partition, and restores the normal Bluetooth function program.
[0069] After recovery is complete, the network core sends a dedicated test exit notification message to the application core via the inter-core communication channel. This message may carry a simple status code, such as "Test complete, Bluetooth function restored," to inform the application core that the network core has exited test mode and can resume normal business interactions.
[0070] In step E30, the application core responds to the exit test notification and exits the waiting state.
[0071] While in a waiting state, the application core can periodically or via interruption listen to the inter-core communication channel. Upon receiving a test exit notification from the network core, the application core immediately exits the waiting state.
[0072] After exiting the waiting state, the application core resumes its business interaction capabilities with the network core, including restarting the processing of Bluetooth-related upper-layer application requests (such as initiating scanning, establishing connections, and transmitting data). Simultaneously, the application core can report the test completion to the upper-layer application as needed, or continue with normal device workflows. Through this mechanism, Bluetooth devices with a dual-core architecture can automatically resume collaborative work between the application core and the network core after completing wireless RF testing, without manual intervention or device reset, ensuring a smooth transition from test mode to normal mode.
[0073] In one possible implementation, after the step of executing the RF test function procedure, the method further includes: Step F10: If a termination test command is received from the host computer during the execution of the RF test function program, then jump back from the second application partition to the first application partition.
[0074] During the process of successfully hopping to the second application partition and executing the RF test function program, the Bluetooth device maintains the established Bluetooth wireless communication connection with the host computer. The host computer can send a terminate test command to the Bluetooth device via this wireless connection at any time, as needed for testing. This command can use the same custom format as the initial RF test command or a standard HCI command.
[0075] In the main loop of the RF test function program in the second application partition, in addition to performing RF transceiver configuration and test tasks, the program also periodically checks the Bluetooth protocol stack's receive buffer to determine whether a new instruction has been received from the host computer via the wireless link. When a test termination instruction is detected, the program first parses and verifies the validity of the instruction to confirm that it is indeed a valid test termination request.
[0076] Upon successful verification, the RF test function program immediately stops the current test task, disables the RF transceiver's test mode (e.g., stops carrier transmission or ends receive measurement), and restores the RF hardware to an idle or default state. Subsequently, the device performs a partition jumpback operation, transferring program control from the second application partition back to the first application partition.
[0077] After a successful jump, the Bluetooth device resumes executing the normal Bluetooth function program in the first application partition, restoring to the regular Bluetooth working mode. This mechanism allows the host computer to terminate the RF test at any time during the test process without waiting for the preset test duration to expire, thus providing flexible manual control over the test process and facilitating handling of abnormal situations or rapid interactive debugging.
[0078] For example, to aid in understanding the technical concept or principle of the RF testing method combined with the first and second embodiments described above, a specific embodiment is provided below. In this specific embodiment, Bluetooth RF testing involves three devices: a Bluetooth device, a host computer, and an RF testing fixture. During testing, the host computer controls the Bluetooth device to enter RF testing mode, the RF testing fixture detects the RF signal and sends the result back to the host computer, and the host computer controls the Bluetooth device to exit RF testing mode based on the test result. (Refer to...) Figure 2As shown, the Bluetooth device includes a dual-core Bluetooth chip, which internally houses a network core and an application core. The network core contains a bootloader and an application partition. The application partition further includes app0 (the second application partition, used to store DTM test function programs) and app1 (the first application partition, used to store normal Bluetooth function programs). Additionally, the network core includes a setting partition for storing configuration parameters such as test duration and RF test scheme. The network core is responsible for running the normal Bluetooth application and can receive test commands from the host computer forwarded by the application core, forwarding these commands via the IPC channel (inter-core communication channel). The application core is responsible for receiving RF test commands from the host computer, maintaining operation during the test, and forwarding the commands to the network core via IPC. After the network core completes the RF test function program, the application core receives an exit test notification while in a waiting state, and then resumes normal business interaction with the network core. The Bluetooth device establishes a wireless connection with the host computer via Bluetooth communication. At the same time, the Bluetooth device and the RF test fixture interact via RF signals. The RF test fixture detects the RF signals emitted by the Bluetooth device and sends the results back to the host computer.
[0079] Based on the aforementioned Bluetooth devices, refer to Figure 3 The radio frequency testing process includes: Step 1: The host computer sends a DTM test command to the application core of the Bluetooth device. This command contains the RF test scheme and the test duration.
[0080] Step 2: The application core forwards the DTM command to the app1 currently running on the network core (i.e., the first application partition, which is used to store normal Bluetooth function programs) through the IPC channel.
[0081] Step 3: After receiving the instruction, the network core writes the RF test plan and test duration to the Setting partition for storage.
[0082] Step 4: The network core performs a jump operation, jumping to app0 (i.e., the second application partition, used to store the DTM test function program) without resetting.
[0083] Step 5: After a successful redirect, app0 reads the test duration from the Setting partition.
[0084] Step 6: app0 starts executing the DTM RF test and starts the timer.
[0085] Step 7: The timer continues to run until the preset duration is reached.
[0086] Step 8: When the timer completes and the duration is reached, the network core will jump back to app1 without resetting, restoring normal Bluetooth functionality.
[0087] Step 9: The network core sends a notification to the application core via the IPC channel, informing it that it has exited DTM mode.
[0088] Step 10: After receiving the notification, the application core notifies the application layer or host computer that the test is complete.
[0089] Throughout the timeline, the application core's status changes from "normal" to "waiting to exit DTM," and then returns to "normal" after receiving a notification; the network core's status changes from running normally as "app1," to "app0" executing DTM tests, and finally jumps back to "app1."
[0090] It should be noted that the above examples are only used to help understand this embodiment and do not constitute a limitation on the radio frequency test process of this embodiment. Any simple modifications based on this technical concept are within the protection scope of this application.
[0091] Furthermore, embodiments of this application also propose a radio frequency testing system, referring to... Figure 4 As shown, the radio frequency testing system includes a Bluetooth device and a host computer connected via Bluetooth wireless communication. The host computer is used to send radio frequency test commands; The Bluetooth device is used to perform the steps of the radio frequency test method described above.
[0092] In one possible implementation, refer to Figure 5 As shown, the RF test system also includes RF test fixtures; The radio frequency test fixture is used to receive Bluetooth radio frequency signals sent by the Bluetooth device and to evaluate the radio frequency performance of the Bluetooth device based on the received Bluetooth radio frequency signals.
[0093] This RF test fixture refers to a professional testing device used to receive and analyze the RF signals emitted by Bluetooth devices. It captures the Bluetooth RF signals emitted by the device through an antenna or RF cable and measures key indicators such as transmit power, frequency offset, modulation characteristics, and receive sensitivity. The measurement results are uploaded to a host computer in real time for analysis and judgment, thereby objectively evaluating whether the device's RF performance meets the standards.
[0094] It should be noted that the Bluetooth devices in this application embodiment may also include, but are not limited to, smartwatches, smart bracelets, TWS wireless earphones, etc.
[0095] Furthermore, such as Figure 6As shown, the Bluetooth device may also include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the Bluetooth device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows Bluetooth devices to communicate wirelessly or wiredly with other devices to exchange data. While various Bluetooth devices with different systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0096] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0097] The Bluetooth device provided in this application, employing the radio frequency (RF) testing method described in the above embodiments, can solve the technical problem of reliably switching RF testing modes without relying on a wired interface. Compared with the prior art, the beneficial effects of the Bluetooth device provided in this application are the same as those of the RF testing method provided in the above embodiments, and other technical features of this Bluetooth device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0098] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0099] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0100] In addition, to achieve the above objectives, embodiments of this application also provide a readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the radio frequency testing method in the above embodiments.
[0101] The computer-readable storage medium provided in this application embodiment may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0102] The aforementioned computer-readable storage medium may be included in a Bluetooth device; or it may exist independently and not be assembled into a Bluetooth device.
[0103] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by a Bluetooth device, cause the Bluetooth device to perform the process steps of any embodiment of the aforementioned radio frequency testing method.
[0104] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0106] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the modules themselves.
[0107] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described radio frequency (RF) test method, thereby solving the technical problem of how to reliably switch RF test modes without relying on a wired interface. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the RF test method provided in the above embodiments, and will not be repeated here.
[0108] Furthermore, embodiments of this application also propose a computer program product, including a computer program that, when executed by a processor, implements the steps of the radio frequency testing method described above.
[0109] The specific implementation of the computer program product in this application is basically the same as the embodiments of the above-mentioned radio frequency test methods, and will not be repeated here.
[0110] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0111] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software sensor. This computer software sensor is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a Bluetooth device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0113] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A radio frequency testing method, characterized in that, This method is applied to Bluetooth devices, which establish a Bluetooth wireless communication connection with a host computer. The Bluetooth device has a bootloader area and an application area. The application area includes a first application partition and a second application partition. The first application partition is used to store normal Bluetooth function programs, and the second application partition is used to store RF test function programs. The RF test method includes the following steps: In response to the Bluetooth device being powered on, the system jumps from the bootloader area to the first application partition and executes the normal Bluetooth function program. Upon receiving the RF test command sent by the host computer, the system jumps to the second application partition and executes the RF test function program to perform RF testing.
2. The radio frequency testing method as described in claim 1, characterized in that, The Bluetooth device also has a settings partition. Before the step of jumping to the second application partition, the method further includes: The test duration is obtained based on the RF test command, and the test duration is written to the setting partition; After the step of jumping to the second application partition, the method further includes: The test duration is read from the setting partition, and the timing duration is obtained from the start of timing after the RF test function program is executed; If the timing duration reaches the test duration, the system will switch from the first application partition back to the second application partition and restore normal Bluetooth functionality.
3. The radio frequency testing method as described in claim 2, characterized in that, Before the step of jumping to the second application partition, the method further includes: The RF test plan is obtained based on the RF test command, and the RF test plan is written into the setting partition; The steps of executing the radio frequency test function program include: The RF test plan is read from the settings partition, and the RF test function program is executed based on the RF test plan.
4. The radio frequency testing method as described in claim 2, characterized in that, After the step of reading the test duration from the settings partition, the method further includes: If it fails to read the test duration from the settings partition, then obtain the preset default test duration; After the timeout period reaches the default test duration, the system jumps back from the first application partition to the second application partition to restore normal Bluetooth functionality.
5. The radio frequency testing method as described in claim 1, characterized in that, The Bluetooth device includes an application core and a network core. The first application partition and the second application partition are located in the application area of the network core. The step of receiving the radio frequency test command sent by the host computer includes: The application core receives the RF test command sent by the host computer and forwards the RF test command to the first application partition program currently running on the network core through the inter-core communication channel, so that after the network core receives the RF test command, it jumps to the second application partition and executes the RF test function program.
6. The radio frequency testing method as described in claim 5, characterized in that, After the step of forwarding the RF test command to the first application partition program currently running on the network core via the inter-core communication channel, the method further includes... After forwarding the RF test command, the application core enters a waiting state, wherein the waiting state is a state in which the application core continues to run but pauses processing Bluetooth-related functions; After the RF test function program is completed, the network core sends an exit test notification to the application core through the inter-core communication channel; The application kernel responds to the exit test notification and exits the waiting state.
7. The radio frequency testing method according to any one of claims 1 to 5, characterized in that, After the step of executing the radio frequency test function program, the method further includes: If a termination test command is received from the host computer during the execution of the RF test function program, the system will jump back from the second application partition to the first application partition.
8. A radio frequency testing system, characterized in that, The radio frequency test system includes a Bluetooth device and a host computer with Bluetooth wireless communication connection; The host computer is used to send radio frequency test commands; The Bluetooth device is used to perform the steps of the radio frequency test method as described in any one of claims 1 to 7.
9. The radio frequency test system as described in claim 8, characterized in that, The radio frequency test system also includes radio frequency test fixtures; The radio frequency test fixture is used to receive Bluetooth radio frequency signals sent by the Bluetooth device and to evaluate the radio frequency performance of the Bluetooth device based on the received Bluetooth radio frequency signals.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a device control program, which, when executed by a processor, implements the steps of the radio frequency testing method as described in any one of claims 1 to 7.