USB upgrading auxiliary device and upgrading method
By using a USB upgrade auxiliary device to automatically analyze PWM carrier signals, the domain controller can be automatically upgraded. This solves the problems of limited functionality and resource consumption of dedicated upgrade benches in existing technologies, and improves production efficiency and flexibility.
Patent Information
- Application Number
- CN202511782829.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-30
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies for upgrading dedicated test benches have limited functionality, occupy a large area, require significant external equipment hardware resources, and cannot flexibly adapt to production capacity demands, resulting in low production efficiency.
A USB upgrade auxiliary device was designed, including a USB male connector, a USB female connector, a microcontroller unit (MCU), a status indicator module, an optocoupler isolator, a power management module, and a lithium battery. It achieves automated upgrades by analyzing PWM carrier signals, displays status information in real time, and simplifies the operation process.
No need to build a dedicated upgrade platform, reducing production input, improving upgrade efficiency, simplifying operation, reducing error rate, and adapting to flexible production capacity needs.
Smart Images

Figure CN121590447A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of automotive electronics technology and automotive manufacturing technology, and in particular to a USB upgrade auxiliary device and upgrade method. Background Technology
[0002] Before automotive domain controllers are shipped out of the warehouse and ready for mass production, production line workers typically need to upgrade the controller ROM to the latest version in batches before installation. The current common practice is to set up a dedicated upgrade bench, connect the domain controllers to the bench, and have operators manually complete the system upgrade.
[0003] As the electrification of vehicles increases, the number of domain controllers in cars is also increasing. The traditional method of using dedicated functional benches and manual operation consumes a lot of manpower and greatly limits the improvement of production capacity.
[0004] In the existing technology, the upgrade of dedicated racks has a single function, occupies a large area, and requires a lot of external equipment hardware resources (such as operation screens, wiring harnesses, DC power supplies, etc.). Furthermore, dedicated racks cannot flexibly adapt to production capacity requirements. When production needs to be expanded, the factory needs to spend a long period of time in advance to deploy new dedicated racks. When production needs to be reduced, manpower and resources need to be spent on dismantling the equipment. When production needs to be switched to other equipment, the racks also need to be upgraded and modified accordingly. Summary of the Invention
[0005] The purpose of this invention is to provide a USB upgrade auxiliary device and upgrade method, which at least solves the problems of existing upgrade-specific racks having limited functionality, large footprint, and requiring a lot of external device hardware resources.
[0006] This invention provides the following solution:
[0007] According to one aspect of the present invention, a USB upgrade auxiliary device is provided, comprising: a USB male connector, a USB female connector, a microcontroller unit (MCU), a status indicator module, an optocoupler isolator, a power management module, and a lithium battery;
[0008] The USB male connector is used to connect to the domain controller to be upgraded, and its power pin VBUS is electrically connected to both the input of the optocoupler isolator and the input of the power management module.
[0009] The USB female connector is used to connect a USB flash drive, and its data pins D+ and D- are directly connected to the corresponding data pins of the USB male connector through a signal path;
[0010] The output of the optocoupler isolator is connected to the input pin of the MCU, and is used to transmit the PWM carrier signal collected from the VBUS pin to the MCU after electrical isolation.
[0011] The status indication module is electrically connected to the output pin of the MCU and is used to output the corresponding upgrade status information according to the MCU's parsing result;
[0012] The input terminal of the power management module is connected to the VBUS pin of the USB male connector and the lithium battery, and its output terminal is connected to the MCU, the status indicator module and the optocoupler to provide working power.
[0013] The power management module is used to selectively turn on the boost output of the VBUS or the lithium battery to its output terminal according to the voltage state of the VBUS pin.
[0014] Furthermore, the status indication module includes a visual indication unit and an auditory indication unit;
[0015] The visual indication unit includes at least one LED indicator and / or a display screen;
[0016] The auditory indication unit includes a buzzer;
[0017] The LED indicator, display screen, and buzzer are all controlled by the MCU.
[0018] Furthermore, the MCU is configured to parse PWM carrier signals of various specific modes and map them into different upgrade state instructions;
[0019] The PWM carrier signals of the various specific modes include at least the following:
[0020] The first PWM signal corresponds to the upgrade process.
[0021] The second PWM signal corresponds to the successful upgrade status;
[0022] And, the third PWM signal corresponding to the upgrade failure state.
[0023] According to a second aspect of the present invention, an upgrade method for a USB upgrade auxiliary device is provided, the upgrade method comprising:
[0024] After the domain controller is powered on, it detects that a USB flash drive has been inserted via a USB upgrade auxiliary device. The domain controller reads the upgrade description file in the USB flash drive and compares it with its current version.
[0025] If an upgrade is required, the domain controller copies the upgrade package from the USB flash drive to its internal storage. After the upgrade package is copied, the domain controller outputs a first PWM signal by controlling the VBUS pin of its USB port.
[0026] The USB upgrade auxiliary device acquires the first PWM signal and parses it into an upgrade command by the MCU. The MCU controls the status indicator module to output upgrade status information according to the upgrade command. Subsequently, the domain controller performs the system upgrade operation.
[0027] After the upgrade operation is completed, the domain controller outputs a second PWM signal or a third PWM signal by controlling its VBUS pin, based on the upgrade result.
[0028] The USB upgrade auxiliary device acquires the second PWM signal or the third PWM signal, and after the MCU parses it into an upgrade success instruction or an upgrade failure instruction, it controls its status indicator module to output the corresponding upgrade success or upgrade failure status information.
[0029] Furthermore, the process by which the domain controller reads the upgrade description file from the USB drive includes:
[0030] After detecting a USB flash drive insertion event, the domain controller mounts the USB flash drive file system.
[0031] Read the upgrade description file in the root directory or a specified directory of the USB drive, wherein the upgrade description file contains version information of the upgrade package;
[0032] Parse the upgrade description file to obtain the target version number of the upgrade package in the USB flash drive;
[0033] Read the current system version number stored in the domain controller itself;
[0034] Compare the target version number with the current system version number;
[0035] If the target version number is higher than the current system version number, it is determined that an upgrade is needed.
[0036] Furthermore, the output process of the first PWM signal includes:
[0037] After determining that an upgrade is needed, the domain controller locates and reads the upgrade package file corresponding to the upgrade description file from the USB drive;
[0038] Write the data stream of the upgrade package file to a designated partition of the domain controller's internal memory;
[0039] After the complete copy of the verification upgrade package file to the specified partition, the domain controller's business layer application calls the underlying driver interface;
[0040] The underlying driver interface, based on the call from the business layer application, controls the GPIO connected to the VBUS pin of the USB port to output a PWM waveform with a specific duty cycle and frequency, in order to generate the first PWM signal.
[0041] Furthermore, the instruction parsing process during the upgrade includes:
[0042] The optocoupler monitors the level change on the VBUS pin and transmits the first PWM signal to the input capture pin of the MCU after electrical isolation and waveform shaping.
[0043] The MCU performs timing measurement on the pulse width of the first PWM signal to obtain pulse width data;
[0044] The MCU calculates the duty cycle and frequency of the first PWM signal based on the measured pulse width data.
[0045] The MCU will match the calculated duty cycle and frequency with the instruction mapping table pre-stored inside.
[0046] When the matching result matches the predefined characteristics of the upgrade instruction, the MCU parses and obtains the upgrade instruction.
[0047] Furthermore, the process by which the domain controller performs a system upgrade operation includes:
[0048] After the MCU parses and obtains the upgrade instruction, it drives at least one LED indicator to enter a preset flashing mode and controls the display screen to output the upgrade text prompt.
[0049] After the status indicator module outputs the status information during the upgrade, the domain controller runs the upgrade program and writes the upgrade package file, which has been copied to the specified partition of the internal storage, to the domain controller's system memory.
[0050] Furthermore, the output process of the second PWM signal and the third PWM signal includes:
[0051] After the system upgrade operation is completed, the domain controller performs an integrity check on the contents written to the system memory.
[0052] If the verification passes, the upgrade is considered successful. The domain controller's service layer application calls the underlying driver interface to control the VBUS pin to output a PWM waveform with a first preset characteristic in order to generate the second PWM signal.
[0053] If the verification fails, the upgrade is deemed to have failed. The domain controller's service layer application calls the underlying driver interface to control the VBUS pin to output a PWM waveform with a second preset characteristic in order to generate the third PWM signal.
[0054] Furthermore, the output process for the upgrade success or upgrade failure status information includes:
[0055] The optocoupler isolator acquires the second PWM signal or the third PWM signal and transmits it to the MCU after isolation;
[0056] The MCU measures the pulse width of the received PWM signal and calculates its duty cycle and frequency.
[0057] The MCU will match the calculated duty cycle and frequency with the instruction mapping table pre-stored inside.
[0058] If the matching result is an upgrade success command, the MCU controls the first color LED indicator to stay on or flash according to the preset success mode, and controls the display screen to output an upgrade success text prompt;
[0059] If the matching result is an upgrade failure instruction, the MCU controls the second-color LED indicator to flash according to the preset failure mode, drives the buzzer to emit an alarm sound, and controls the display screen to output the upgrade failure and corresponding error code text prompt.
[0060] The above solution achieves the following beneficial technical effects:
[0061] This application does not require the construction of a dedicated upgrade platform; it only requires powering the equipment to be upgraded, effectively reducing production costs.
[0062] The USB upgrade auxiliary device proposed in this application is small in size and low in cost. It can flexibly adapt to production capacity requirements, requires no additional setup or dismantling operations, and is highly versatile, allowing for expansion and use on various domain controllers.
[0063] This application simplifies the disassembly and assembly process, saving time and effort. The entire upgrade process only requires the disassembly and assembly of the device power supply cable and the USB upgrade auxiliary device.
[0064] This application's USB upgrade auxiliary device, in conjunction with the matching upgrade method, enables the host to automatically complete the upgrade after the device is inserted, without any manual intervention. At the same time, the upgrade status and results are displayed in real time through the auxiliary device, which facilitates worker recording and subsequent operations, improves upgrade efficiency, and reduces the error rate. Attached Figure Description
[0065] Figure 1 This is a schematic diagram illustrating the use of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0066] Figure 2 This is a schematic diagram of the hardware topology of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0067] Figure 3 This is a schematic diagram of the hardware principle of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0068] Figure 4 This is a schematic diagram of a hardware board for a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0069] Figure 5 This is a schematic diagram of the workflow of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0070] Figure 6 This is a schematic diagram of a domain controller-side upgrade method for a USB upgrade auxiliary device provided in one or more embodiments of the present invention. Detailed Implementation
[0071] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. 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.
[0072] Figure 1 This is a schematic diagram illustrating the use of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0073] Figure 2 This is a schematic diagram of the hardware topology of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0074] Figure 3 This is a schematic diagram of the hardware principle of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0075] Figure 4 This is a schematic diagram of a hardware board for a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0076] like Figures 1-4 The USB upgrade auxiliary device shown includes a USB male connector, a USB female connector, a microcontroller unit (MCU), a status indicator module, an optocoupler isolator, a power management module, and a lithium battery.
[0077] The USB male connector is used to connect to the domain controller to be upgraded. Its power pin VBUS is electrically connected to both the input of the optocoupler isolator and the input of the power management module.
[0078] The USB female connector is used to connect a USB flash drive. Its data pins D+ and D- are directly connected to the corresponding data pins of the USB male connector through a signal path.
[0079] The output of the optocoupler isolator is connected to the input pin of the MCU to electrically isolate the PWM carrier signal acquired from the VBUS pin before transmitting it to the MCU.
[0080] The status indicator module is electrically connected to the output pin of the MCU and is used to output the corresponding upgrade status information based on the MCU's parsing results.
[0081] The input of the power management module is connected to the VBUS pin of the USB male connector and the lithium battery, and its output is connected to the MCU, status indicator module and optocoupler to provide operating power.
[0082] The power management module is used to selectively turn on the boost output of VBUS or the lithium battery to its output terminal according to the voltage state of the VBUS pin.
[0083] Specifically, the USB male connector is used for physical and electrical connection to the USB host port of the domain controller to be upgraded. Its power pin VBUS is electrically connected to both the input of the optocoupler isolator and the input of the power management module. This connection allows the VBUS pin to perform the dual functions of powering the device and transmitting communication signals.
[0084] The USB female connector is used to connect a USB flash drive containing upgrade files. Its data pins D+ and D- are directly connected to the corresponding data pins D+ and D- of the USB male connector through a board-level signal path. This design enables the direct transmission of USB data signals, allowing the USB flash drive to be directly recognized and read by the domain controller. The device is transparent in this data path and does not perform any data processing.
[0085] The output of the optocoupler is connected to the input capture pin of the MCU. The optocoupler is used to acquire the PWM carrier signal from the VBUS pin of the USB male connector in real time, and transmit the signal to the MCU after electrical isolation and waveform shaping. Using the optocoupler can effectively isolate the ground interference between the domain controller and the auxiliary device, and improve the communication reliability and device safety.
[0086] The status indicator module is electrically connected to multiple output pins of the MCU. The status indicator module is used to output the corresponding upgrade status information according to the MCU's parsing results. In a preferred embodiment, the status indicator module includes a visual indicator unit and an auditory indicator unit. The visual indicator unit includes at least one LED indicator and a display screen. The auditory indicator unit includes a buzzer. The LED indicator, display screen and buzzer are all controlled by the MCU's GPIO pins.
[0087] The power management module's input is connected to both the VBUS pin of the USB male connector and the lithium battery, while its output is connected to the MCU, status indicator module, and optocoupler isolator, providing stable power to these components. The power management module intelligently and selectively switches between VBUS or the boost output of the lithium battery based on the voltage state of the VBUS pin of the USB male connector. Specifically, when a high-level voltage is detected in VBUS, the power management module prioritizes VBUS to power the system and simultaneously manages the charging of the built-in lithium battery. When a low-level voltage or voltage failure is detected in VBUS, the power management module quickly and automatically switches to the backup power supply circuit, boosting the output voltage of the lithium battery to the voltage required by the system, thereby continuously powering the entire device. This ensures that even if VBUS loses power due to a restart during a domain controller upgrade, the device can still operate stably and record the final state completely.
[0088] As the control core of the device, the MCU's internal firmware is configured to parse PWM carrier signals of various specific modes and map them into different upgrade status instructions. The MCU uses its input capture function to perform pulse width timing on the signal transmitted from the optocoupler isolator, and then calculates the duty cycle and frequency of the PWM signal. The MCU matches the calculated signal characteristics with the instruction mapping table pre-stored in its internal memory, thereby parsing the upgrade status instructions sent by the domain controller. These instructions include at least a first PWM signal corresponding to the upgrade in progress state, a second PWM signal corresponding to the upgrade success state, and a third PWM signal corresponding to the upgrade failure state.
[0089] In this embodiment, the status indication module includes a visual indication unit and an auditory indication unit;
[0090] The visual indication unit includes at least one LED indicator and / or a display screen;
[0091] The auditory indication unit includes a buzzer;
[0092] The LED indicator lights, display screen, and buzzer are all controlled by the MCU.
[0093] Specifically, the visual indication unit consists of LED indicator lights and a display screen. The number of LED indicator lights is at least one and can be configured to different colors, such as green LEDs, red LEDs, or dual-color LEDs. The display screen is a small LCD screen or digital tube display screen used to display text information.
[0094] The auditory indication unit consists of a buzzer, which is used to provide sound prompts in specific states.
[0095] The LED indicator, display screen, and buzzer are all electrically connected and controlled by the MCU's general-purpose input / output pins. The MCU executes its internal firmware program and drives the indicator units to perform specific indicator actions based on the different upgrade status instructions it parses. Specifically, when the MCU parses the upgrade in progress instruction, it controls the LED indicator to enter a preset flashing mode, such as flashing intermittently at a fixed frequency, and at the same time controls the display screen to output the text prompt "Upgrade in progress". When the MCU parses the upgrade successful instruction, it controls the LED indicator to indicate in a mode different from the upgrade in progress, such as controlling the green LED indicator to be constantly lit, or flashing in a faster, more pleasant mode, and at the same time controls the display screen to output the text prompt "Upgrade successful".
[0096] When the MCU parses the upgrade failure command, it controls the LED indicator to indicate the error status. For example, it controls the red LED indicator to flash rapidly, drives the buzzer to emit a continuous or intermittent alarm sound, and controls the display screen to output the words "upgrade failed" and the specific error code text prompt corresponding to the failure command. This allows operators to quickly locate and record the cause of the failure. Through the dual indication of vision and hearing, this device ensures that upgrade status information can be accurately and efficiently conveyed, greatly improving the reliability and efficiency of operations on the production line.
[0097] In this embodiment, the MCU is configured to parse PWM carrier signals of various specific modes and map them into different upgrade state instructions;
[0098] Among them, the PWM carrier signals of various specific modes include at least:
[0099] The first PWM signal corresponds to the upgrade process.
[0100] The second PWM signal corresponds to the successful upgrade status;
[0101] And, the third PWM signal corresponding to the upgrade failure state.
[0102] Specifically, the MCU uses its internal input capture timer to perform signal parsing. When the optocoupler transmits the level change on the VBUS pin to the MCU's input capture pin, the MCU enables the timer to accurately measure the pulse width of the high and low levels of the PWM signal. Based on the measured pulse width data, the MCU calculates two key characteristic parameters of the PWM signal, including the duty cycle and frequency.
[0103] The MCU has a pre-stored instruction mapping table, which defines the specific upgrade status instructions corresponding to different duty cycle and frequency combinations. The MCU matches and queries the signal characteristic parameters calculated in real time with the mapping table to parse the instruction content sent by the domain controller. The multiple specific modes of PWM carrier signals include at least the following three types: a first PWM signal, which is a specific duty cycle and frequency combination, which corresponds to the upgrade status instruction after parsing; a second PWM signal, which is characterized by another duty cycle and frequency combination that is different from the first PWM signal, which corresponds to the upgrade successful status instruction after parsing.
[0104] The third PWM signal can be extended into a set of signals with different characteristic parameters, each corresponding to an upgrade failure caused by different error reasons, thereby realizing the differentiation and reporting of error codes. Through the above configuration, the MCU can reliably convert the PWM carrier signal sent by the domain controller through VBUS voltage modulation into a logical instruction for the control status indication module to act, thus completing the conversion from physical signal to logical state.
[0105] Figure 5 This is a schematic diagram of the workflow of a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0106] Figure 6 This is a schematic diagram of a domain controller-side upgrade method for a USB upgrade auxiliary device provided in one or more embodiments of the present invention.
[0107] like Figure 5 and Figure 6 As shown, this application provides an upgrade method for a USB upgrade auxiliary device, the upgrade method for the USB upgrade auxiliary device including:
[0108] After the domain controller is powered on, it detects that a USB flash drive has been inserted via a USB upgrade auxiliary device. The domain controller reads the upgrade profile file in the USB flash drive and compares it with its current version.
[0109] Furthermore, the process by which the domain controller reads the upgrade profile from the USB drive includes:
[0110] After detecting a USB drive insertion event, the domain controller mounts the USB drive's file system.
[0111] Read the upgrade description file in the root directory of the USB drive or a specified directory. The upgrade description file contains the version information of the upgrade package.
[0112] Parse the upgrade description file to obtain the target version number of the upgrade package in the USB drive;
[0113] Read the current system version number stored in the domain controller itself;
[0114] Compare the target version number with the current system version number;
[0115] If the target version number is higher than the current system version number, it is determined that an upgrade is needed.
[0116] Specifically, after the domain controller is powered on and starts up, its operating system kernel continuously monitors the port status of the USB host controller. When an operator connects a USB upgrade auxiliary device with a USB flash drive inserted to the domain controller's USB port, the domain controller detects the hardware event of the USB flash drive being inserted. Subsequently, the domain controller's system service automatically mounts the file system of the USB flash drive, making its directory and files accessible. The upgrade management service or script program running on the domain controller is then triggered. This program accesses the root directory of the USB flash drive or a preset specific subdirectory to find and read the preset upgrade description file.
[0117] The upgrade description file is a structured text file that explicitly contains the version identification information of the upgrade package provided. The upgrade management program parses the contents of this description file to extract the target version number corresponding to the upgrade package on the USB drive. Then, the upgrade management program accesses the system information area stored in the domain controller's non-volatile memory and reads the version number of the current system image recorded therein, i.e., the current system version number. The upgrade management program calls the version comparison logic to compare the target version number read from the USB drive with the current system version number stored in itself. This comparison logic judges based on the order of the version number values or strings. If the comparison result shows that the target version number is higher than the current system version number, the upgrade management program determines that a system upgrade is required and automatically starts the subsequent upgrade process. If the target version number is equal to or lower than the current system version number, it determines that no upgrade is required, the process terminates, and this situation can be recorded through logs or other means. Through the above automated process, the necessity of upgrade is automatically determined without manual version checking, providing a foundation for fully automated upgrades.
[0118] In this embodiment, if an upgrade is required, the domain controller copies the upgrade package from the USB flash drive to its internal storage. After the upgrade package is copied, the domain controller outputs the first PWM signal by controlling the VBUS pin of its USB port.
[0119] Furthermore, the output process of the first PWM signal includes:
[0120] After determining that an upgrade is needed, the domain controller locates and reads the upgrade package file corresponding to the upgrade description file from the USB drive;
[0121] Write the data stream of the upgrade package file to a specified partition of the domain controller's internal memory;
[0122] After verifying that the upgrade package file has been completely copied to the specified partition, the domain controller's business layer application calls the underlying driver interface;
[0123] The underlying driver interface controls the GPIO connected to the VBUS pin of the USB port to output a PWM waveform with a specific duty cycle and frequency according to the call of the business layer application, so as to generate the first PWM signal.
[0124] Specifically, the upgrade management program first locates and searches for the corresponding upgrade package file in the mounted USB flash drive file system according to the records in the upgrade description file. This upgrade package file is usually a complete system image file or a differential update package. The domain controller reads the data stream of the upgrade package file through the file operation interface and continuously writes this data stream to a pre-allocated temporary storage partition or cache partition in its internal memory. This process ensures that all the data required for the upgrade is transferred from the external USB flash drive to the domain controller, preparing for the subsequent upgrade operation.
[0125] After the upgrade package file is completely copied to the internal designated partition, the upgrade management program performs an integrity check, such as by calculating and comparing the file checksum, to ensure that no errors occurred during the data transmission process. After the check passes, the business layer upgrade application running in user space in the domain controller sends instructions to the underlying hardware driver in kernel space through inter-process communication or system call interface.
[0126] The underlying driver interface receives instructions from the business layer application. These instructions contain specific command codes to trigger the generation of the first PWM signal. The driver interface then configures the operating mode of the general-purpose input / output pin connected to the VBUS pin of the USB port in circuitry, sets it to output mode, and controls the pin to output a PWM waveform with a specific duty cycle and frequency. This PWM waveform is reflected in the voltage change of the VBUS pin of the USB male connector through hardware circuitry, which is the first PWM signal generated. This signal indicates that the upgrade package has been successfully copied, the domain controller is about to start the system upgrade operation, and notifies the USB upgrade auxiliary device to enter the upgrade in progress state.
[0127] In this embodiment, the USB upgrade auxiliary device acquires the first PWM signal and parses it into an upgrade command by the MCU. Based on the upgrade command, the MCU controls the status indicator module to output upgrade status information. Subsequently, the domain controller executes the system upgrade operation.
[0128] Furthermore, the instruction parsing process during the upgrade includes:
[0129] The optocoupler monitors the level change on the VBUS pin and transmits the first PWM signal to the MCU's input capture pin after electrical isolation and waveform shaping.
[0130] The MCU measures the pulse width of the first PWM signal to obtain pulse width data;
[0131] The MCU calculates the duty cycle and frequency of the first PWM signal based on the measured pulse width data.
[0132] The MCU matches the calculated duty cycle and frequency with the instruction mapping table pre-stored internally;
[0133] When the matching result matches the predefined characteristics of the upgrade instruction, the MCU parses and obtains the upgrade instruction.
[0134] Furthermore, the process for a domain controller to perform a system upgrade includes:
[0135] After the MCU parses and obtains the upgrade instruction, it drives at least one LED indicator to enter a preset flashing mode and controls the display screen to output the text prompt "Upgrade in progress".
[0136] After the status indicator module outputs the upgrade status information, the domain controller runs the upgrade program and writes the upgrade package file, which has been copied to the specified partition of the internal storage, to the domain controller's system memory.
[0137] Specifically, when the domain controller outputs the first PWM signal through the VBUS pin of its USB port, the USB upgrade auxiliary device immediately starts the signal acquisition and analysis process. The optocoupler inside the device continuously monitors the level change from the USB male VBUS pin. The optocoupler electrically isolates the acquired first PWM signal to eliminate ground loop interference and shapes the signal waveform to convert it into a digital level signal with clear edges that the MCU can recognize. Then it is transmitted to the input capture pin of the MCU. After the MCU detects the level change of the input capture pin, it starts its internal input capture timer. The timer accurately measures the high-level pulse width and low-level pulse width of the first PWM signal to obtain the original pulse width data.
[0138] The MCU firmware calculates two key physical characteristics of the first PWM signal based on the captured pulse width data: the duty cycle and the frequency. Then, the MCU accesses the instruction mapping table pre-stored in its internal non-volatile memory. This instruction mapping table defines a unique combination of duty cycle and frequency corresponding to different upgrade state instructions. The MCU matches the calculated duty cycle and frequency values with the entries in the instruction mapping table one by one. When the calculated signal characteristics match the predefined upgrade instruction characteristic parameters in the instruction mapping table, the MCU determines that the parsing is successful and obtains the upgrade instruction.
[0139] After parsing and obtaining the "Upgrade in Progress" command, the MCU immediately responds by controlling the status indicator module through its general purpose input / output pins. The MCU drives at least one LED indicator to enter a preset flashing mode, such as making a blue LED flash intermittently with a period of one second. At the same time, the MCU controls the display screen through a parallel or serial interface to output the text "Upgrade in Progress" on its interface, informing the operator of the current system status. After the USB upgrade auxiliary device clearly indicates the "Upgrade in Progress" status, the domain controller begins to perform the actual system upgrade operation. The domain controller's upgrade management program calls the system-level programming tool or initiates a dedicated upgrade process. This process systematically and block-by-blocks writes or flashes the upgrade package file, which has been completely copied to the designated partition of the internal storage, to the domain controller's non-volatile system memory, such as eMMC or Spinor Flash, to complete the system image update. This programming process overwrites the original system program, realizing the formal version change.
[0140] In this embodiment, after the upgrade operation is completed, the domain controller outputs a second PWM signal or a third PWM signal by controlling its VBUS pin according to the upgrade result.
[0141] Furthermore, the output process of the second and third PWM signals includes:
[0142] After the system upgrade operation is completed, the domain controller performs an integrity check on the contents written to the system memory.
[0143] If the verification passes, the upgrade is considered successful. The domain controller's business layer application calls the underlying driver interface to control the VBUS pin to output a PWM waveform with the first preset characteristics in order to generate a second PWM signal.
[0144] If the verification fails, the upgrade is deemed to have failed. The domain controller's business layer application calls the underlying driver interface to control the VBUS pin to output a PWM waveform with a second preset characteristic in order to generate a third PWM signal.
[0145] Specifically, the domain controller first performs an integrity check on the contents that have been burned to the system memory. This check process typically involves reading the data in the newly burned area, calculating its checksum, and then comparing this checksum with the original checksum pre-stored in the upgrade package file. Alternatively, it can verify the bootability of the system image by starting a lightweight bootloader.
[0146] If the verification passes, it indicates that the system upgrade is successful and the new system image is complete and error-free. The domain controller's business layer upgrade application then determines that the upgrade is successful. The business layer application sends an instruction to the underlying hardware driver interface through a system call, instructing it to output a communication signal representing the upgrade success. The underlying driver interface responds to this instruction and controls the general-purpose input / output pin connected to the VBUS pin of the USB port to output a PWM waveform with a first preset characteristic. The specific duty cycle and frequency combination of this waveform are predefined to represent the upgrade success. This signal is the second PWM signal.
[0147] If the verification fails, it indicates that the system upgrade has failed and the new system image may be corrupted. The domain controller's business layer upgrade application then determines that the upgrade has failed. This business layer application sends another instruction to the underlying hardware driver interface through a system call, commanding it to output a communication signal representing the upgrade failure. The underlying driver interface responds to this instruction, controlling the general-purpose input / output pin connected to the VBUS pin of the USB port to output a PWM waveform with a second preset characteristic. The duty cycle and frequency combination of this waveform are different from the first preset characteristic and are predefined as representing the upgrade failure. This signal is the third PWM signal. In addition, the business layer application can select the driver interface to output multiple third PWM signals with subtle differences according to different verification error types to correspond to different error codes. Through the above process, the domain controller sends the final and determined upgrade result to the USB upgrade auxiliary device through the VBUS pin in the form of different PWM signals.
[0148] In this embodiment, the USB upgrade auxiliary device acquires the second PWM signal or the third PWM signal, and after the MCU parses it into an upgrade success instruction or an upgrade failure instruction, it controls its status indicator module to output the corresponding upgrade success or upgrade failure status information.
[0149] Furthermore, the output process for upgrade success or upgrade failure status information includes:
[0150] The optocoupler isolator acquires the second or third PWM signal and transmits it to the MCU after isolation;
[0151] The MCU measures the pulse width of the received PWM signal and calculates its duty cycle and frequency.
[0152] The MCU matches the calculated duty cycle and frequency with the instruction mapping table pre-stored internally;
[0153] If the matching result is an upgrade success command, the MCU controls the first color LED indicator to stay on or flash according to the preset success mode, and controls the display screen to output the text message "upgrade successful".
[0154] If the matching result is an upgrade failure instruction, the MCU controls the second-color LED indicator to flash according to the preset failure mode, drives the buzzer to emit an alarm sound, and controls the display screen to output the upgrade failure and corresponding error code text prompt.
[0155] Specifically, after the domain controller outputs the second or third PWM signal, the USB upgrade auxiliary device performs the final status acquisition, parsing and indication process. The optocoupler inside the device acquires the second or third PWM signal from the VBUS pin, and after electrically isolating and shaping the signal, it is transmitted to the input capture pin of the MCU. The MCU starts its input capture timer to accurately measure the pulse width of the received PWM signal. Based on the measured pulse width data, the MCU calculates the duty cycle and frequency of the PWM signal, two key characteristic parameters.
[0156] The MCU then accesses its internally stored instruction mapping table, matches the calculated duty cycle and frequency values with the entries in the table to parse out the final instruction sent by the domain controller. If the matching result corresponds to the upgrade success instruction, the MCU controls the status indicator module to perform the following operations: drive the first color LED indicator, such as a green LED, to switch it to a constant state, or to flash according to a preset flashing pattern indicating success. At the same time, the MCU controls the display screen to output a clear text prompt that the upgrade is successful on its interface.
[0157] If the matching result corresponds to the upgrade failure instruction, the MCU controls the status indicator module to perform the following operations: drive the second color LED indicator, such as a red LED, to flash rapidly in a preset pattern that is different from the success state to cause a visual warning. At the same time, the MCU drives the buzzer to emit a continuous or intermittent alarm sound to provide an audible warning. In addition, the MCU controls the display screen to output the words "upgrade failed" on its interface, and at the same time output the error code text prompt corresponding to the specific upgrade failure instruction.
[0158] With the aforementioned differentiated instruction scheme, operators can obtain the final upgrade result of each domain controller remotely, quickly, and accurately without having to view the equipment logs up close. In the case of failure, the operator can also perform preliminary problem diagnosis and recording based on the error code, which greatly improves the processing efficiency and reliability of the production line. The entire upgrade process is now complete, and the operator can proceed with the subsequent transfer of qualified products or handling of defective products based on the final instruction status.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A USB upgrade auxiliary device, characterized in that, include: USB male connector, USB female connector, microcontroller unit (MCU), status indicator module, optocoupler isolator, power management module, and lithium battery; The USB male connector is used to connect to the domain controller to be upgraded, and its power pin VBUS is electrically connected to both the input of the optocoupler isolator and the input of the power management module. The USB female connector is used to connect a USB flash drive, and its data pins D+ and D- are directly connected to the corresponding data pins of the USB male connector through a signal path; The output of the optocoupler isolator is connected to the input pin of the MCU, and is used to transmit the PWM carrier signal acquired from the VBUS pin to the MCU after electrical isolation. The status indication module is electrically connected to the output pin of the MCU and is used to output the corresponding upgrade status information according to the MCU's parsing result; The input terminal of the power management module is connected to the VBUS pin of the USB male connector and the lithium battery, and its output terminal is connected to the MCU, the status indicator module and the optocoupler to provide working power. The power management module is used to selectively turn on the boost output of the VBUS or the lithium battery to its output terminal according to the voltage state of the VBUS pin.
2. The USB upgrade auxiliary device according to claim 1, characterized in that, The status indication module includes a visual indication unit and an auditory indication unit; The visual indication unit includes at least one LED indicator and / or a display screen; The auditory indication unit includes a buzzer; The LED indicator, display screen, and buzzer are all controlled by the MCU.
3. The USB upgrade auxiliary device according to claim 1, characterized in that, The MCU is configured to parse PWM carrier signals of various specific modes and map them into different upgrade state instructions; The PWM carrier signals of the various specific modes include at least the following: The first PWM signal corresponds to the upgrade process. The second PWM signal corresponds to the successful upgrade status; And, the third PWM signal corresponding to the upgrade failure state.
4. An upgrade method for a USB upgrade auxiliary device, characterized in that, The upgrade method of the USB upgrade auxiliary device includes: After the domain controller is powered on, it detects that a USB flash drive has been inserted via a USB upgrade auxiliary device. The domain controller reads the upgrade description file in the USB flash drive and compares it with its current version. If an upgrade is required, the domain controller copies the upgrade package from the USB flash drive to its internal storage. After the upgrade package is copied, the domain controller outputs a first PWM signal by controlling the VBUS pin of its USB port. The USB upgrade auxiliary device acquires the first PWM signal and parses it into an upgrade command by the MCU. The MCU controls the status indicator module to output upgrade status information according to the upgrade command. Subsequently, the domain controller performs the system upgrade operation. After the upgrade operation is completed, the domain controller outputs a second PWM signal or a third PWM signal by controlling its VBUS pin, based on the upgrade result. The USB upgrade auxiliary device acquires the second PWM signal or the third PWM signal, and after the MCU parses it into an upgrade success instruction or an upgrade failure instruction, it controls its status indicator module to output the corresponding upgrade success or upgrade failure status information.
5. The upgrade method of a USB upgrade auxiliary device according to claim 4, characterized in that, The process by which the domain controller reads the upgrade description file from the USB drive includes: After detecting a USB flash drive insertion event, the domain controller mounts the USB flash drive file system. Read the upgrade description file in the root directory or a specified directory of the USB drive, wherein the upgrade description file contains version information of the upgrade package; Parse the upgrade description file to obtain the target version number of the upgrade package in the USB flash drive; Read the current system version number stored in the domain controller itself; Compare the target version number with the current system version number; If the target version number is higher than the current system version number, it is determined that an upgrade is needed.
6. The upgrade method of a USB upgrade auxiliary device according to claim 4, characterized in that, The output process of the first PWM signal includes: After determining that an upgrade is needed, the domain controller locates and reads the upgrade package file corresponding to the upgrade description file from the USB drive; Write the data stream of the upgrade package file to a designated partition of the domain controller's internal memory; After the complete copy of the verification upgrade package file to the specified partition, the domain controller's business layer application calls the underlying driver interface; The underlying driver interface, based on the call from the business layer application, controls the GPIO connected to the VBUS pin of the USB port to output a PWM waveform with a specific duty cycle and frequency, in order to generate the first PWM signal.
7. The upgrade method of a USB upgrade auxiliary device according to claim 4, characterized in that, The instruction parsing process during the upgrade includes: The optocoupler monitors the level change on the VBUS pin and transmits the first PWM signal to the input capture pin of the MCU after electrical isolation and waveform shaping. The MCU performs timing measurement on the pulse width of the first PWM signal to obtain pulse width data; The MCU calculates the duty cycle and frequency of the first PWM signal based on the measured pulse width data. The MCU will match the calculated duty cycle and frequency with the instruction mapping table pre-stored inside. When the matching result matches the predefined characteristics of the upgrade instruction, the MCU parses and obtains the upgrade instruction.
8. The upgrade method of a USB upgrade auxiliary device according to claim 4, characterized in that, The process for the domain controller to perform a system upgrade includes: After the MCU parses and obtains the upgrade instruction, it drives at least one LED indicator to enter a preset flashing mode and controls the display screen to output the upgrade text prompt. After the status indicator module outputs the status information during the upgrade, the domain controller runs the upgrade program and writes the upgrade package file, which has been copied to the specified partition of the internal storage, to the domain controller's system memory.
9. The upgrade method of a USB upgrade auxiliary device according to claim 4, characterized in that, The output process of the second PWM signal and the third PWM signal includes: After the system upgrade operation is completed, the domain controller performs an integrity check on the contents written to the system memory. If the verification passes, the upgrade is considered successful. The domain controller's service layer application calls the underlying driver interface to control the VBUS pin to output a PWM waveform with a first preset characteristic in order to generate the second PWM signal. If the verification fails, the upgrade is deemed to have failed. The domain controller's service layer application calls the underlying driver interface to control the VBUS pin to output a PWM waveform with a second preset characteristic in order to generate the third PWM signal.
10. The upgrade method of a USB upgrade auxiliary device according to claim 4, characterized in that, The process for outputting upgrade success or upgrade failure status information includes: The optocoupler isolator acquires the second PWM signal or the third PWM signal and transmits it to the MCU after isolation; The MCU measures the pulse width of the received PWM signal and calculates its duty cycle and frequency. The MCU will match the calculated duty cycle and frequency with the instruction mapping table pre-stored inside. If the matching result is an upgrade success command, the MCU controls the first color LED indicator to stay on or flash according to the preset success mode, and controls the display screen to output an upgrade success text prompt; If the matching result is an upgrade failure instruction, the MCU controls the second-color LED indicator to flash according to the preset failure mode, drives the buzzer to emit an alarm sound, and controls the display screen to output the upgrade failure and corresponding error code text prompt.