Electronic equipment disassembly-free program change and efficient maintenance method based on CAN bus
Through the CAN bus-based method, the chip address and communication architecture are set for marine electronic equipment, and the program update is used to use CAN interface and protocol, which solves the problem of time-consuming and labor-consuming dismantling of the machine in debugging and maintenance of marine electronic equipment, and achieves efficient maintenance and debugging.
Patent Information
- Application Number
- CN202510437762.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, when debugging or maintaining marine electronic equipment, it takes a lot of time and labor costs to disassemble equipment, transportation, installation and return to position, and frequent disassembly may lead to physical damage to the equipment, affecting stability and increasing operating risks.
The electronic equipment disassembly-free program change method based on the CAN bus is adopted. By setting a unique address for the control chip, using the CAN bus to realize inter-chip communication, and setting a CAN interface outside the device, developing an operating interface, and using the CAN communication protocol and interface to realize program updates without disassembling the device.
It realizes that marine electronic equipment does not need to be disassembled during debugging or maintenance, saves time and labor costs, improves work efficiency, reduces equipment damage, and reduces operating risks.
Smart Images

Figure CN120371343A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for program change and efficient maintenance of electronic devices without disassembling based on the CAN bus, belonging to the field of ship electrical technology. Background Art
[0002] In the field of ships, marine electronic devices play a crucial role in the safe navigation and efficient operation of ships. However, during the equipment commissioning stage or the maintenance process after a failure, program changes are often required to test the various functions and performances of the electronic devices.
[0003] Currently, the conventional operation method is that when marine electronic devices are being commissioned or need to be maintained, technicians often have to remove the devices from the complex installation positions on the ship, then open the device casing, and then use an emulator for program burning. This process requires a large amount of time in aspects such as device disassembly, transportation, and reinstallation, increasing time and labor costs.
[0004] At the same time, many marine electronic devices contain multiple control chips inside. These chips each undertake different control functions. Once any one of these chips fails, according to the existing maintenance methods, the device must be disassembled to rewrite the program. This not only means repeatedly performing the time-consuming and laborious disassembly and reinstallation processes, but also may cause physical damage to the device due to frequent disassembly, further affecting the stability and service life of the device, greatly reducing the efficiency of ship operation, increasing the potential risks of ship operation, and bringing many inconveniences to the development of the ship industry. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that when marine electronic devices are being commissioned or need to be maintained in the prior art, a large amount of time and labor costs are often required in aspects such as device disassembly, transportation, and reinstallation.
[0006] To solve the above technical problem, the technical solution of the present invention is to disclose a method for program change and efficient maintenance of electronic devices without disassembling based on the CAN bus, which is characterized by including the following steps:
[0007] The first step: Chip address setting and communication architecture building
[0008] The internal structure of electronic devices is complex and often contains multiple control chips with different functions. Each of the n control chips inside the electronic device is assigned a unique address, for example, from 1, 2, and so on up to n. Each control chip realizes mutual communication through the CAN bus.
[0009] At the same time, a CAN interface is set outside the electronic device for device debugging and maintenance.
[0010] The CAN, namely the Controller Area Network, is a serial communication protocol widely used in fields such as automotive electronics and industrial automation. Using CAN can perform data transmission efficiently and reliably.
[0011] Step 2: Initial code burning and running logic setting
[0012] When the control chip is initially put into use, the codes of each control chip need to be burned respectively.
[0013] When the electronic device starts up, the loader code runs first. According to the preset judgment logic, it detects and evaluates the operating environment, chip status, etc. After the detection and judgment are completed, it calls the control chip codes in sequence to ensure the operation of the device.
[0014] Step 3: CAN communication protocol and interface programming
[0015] In order to enable the entire system based on the CAN bus to operate stably and efficiently, it is necessary to set the CAN communication protocol according to various factors such as the specific application scenario of the device, data transmission requirements, and performance indicators.
[0016] At the same time, in order to facilitate the interaction between the operator and the device, it is also necessary to develop an operation interface adapted to it.
[0017] Step 4: Program update and maintenance process
[0018] During the device debugging or subsequent maintenance process, connect the CAN box to the external CAN interface reserved by the device. With the operation interface written according to the CAN communication protocol, select the address of the control chip that needs to update the program, and upload the compiled HEX file to the target control chip through the CAN box, so as to realize the program update without disassembling the electronic device throughout the process.
[0019] The HEX file is a file format that contains program codes and data, and is often used to store the programs of single-chip microcomputers or embedded systems.
[0020] Preferably, in Step 2, the codes include the loader code and the original code.
[0021] Preferably, in Step 2, the loader is the code responsible for initializing and loading the application program. When running, the loader will first complete its own initialization work, including loading necessary system resources, configuring the operating environment, etc. Then, the loader will find the corresponding application program file according to the preset rules and paths. Next, the loader loads the codes and related resources of the application program into the control chip memory to prepare the necessary conditions for the operation of the application program. Finally, the loader calls the startup function of the application program to trigger the application program to start executing its core codes.
[0022] Preferably, in the third step, the communication protocol should cover the format definition of data frames, clarify how data is packed and transmitted, set the baud rate, and various error detection and handling mechanisms.
[0023] Preferably, in the third step, the operation interface should fully consider the actual needs and user habits, providing a convenient and efficient interaction method for subsequent device maintenance and program changes.
[0024] Preferably, in the fourth step, the principle of specific program update is as follows: the data in the HEX file is parsed according to specific rules, and then the parsed data is sent to the target device through the CAN bus; after receiving the data, the target device writes the new data into the corresponding storage area according to the pre-set program update mechanism, thus completing the program update.
[0025] The present invention provides a method for program change and efficient maintenance of electronic devices without disassembling based on the CAN bus. After adopting the method disclosed in the present invention, when debugging or maintaining marine electronic devices, program changes can be realized without disassembling operations, which is convenient for maintenance and debugging, improves work efficiency, and saves time and labor costs. Description of the Drawings
[0026] Figure 1 is the principle block diagram of the device described in the embodiment.
[0027] Figure 2 is the reserved program update interface of the device described in the embodiment.
[0028] Figure 3 is the program update interface described in the embodiment. Detailed Embodiments
[0029] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the appended claims of this application.
[0030] Figure 1 is the principle block diagram of a certain marine power supply device. The three-phase AC 380V power supply input passes through the EMI filter and is transformed into a controllable output after three-stage power electronic conversion. Power electronic topology 1 is controlled by control unit 1, power electronic topology 2 is controlled by control unit 2, and power electronic topology 3 is controlled by control unit 3. The control unit collects analog signals such as voltage and current in the power electronic topology, and after being processed by the control chip, provides digital signals such as drive signals and communication signals to the power electronic topology.
[0031] Generally, to implement program changes, it is necessary to remove the power supply device, unscrew the device's casing, find the corresponding control unit, connect an emulator through the JTAG port to perform the program burning operation. After testing, the device needs to be restored to its original state again, which is time-consuming and laborious.
[0032] In order to enable program changes for the power supply device without disassembling the machine, according to the method disclosed in the present invention:
[0033] The first step: Chip address setting and communication architecture construction
[0034] Control unit 1, control unit 2, and control unit 3 use DSP control chips and embedded software. The control units communicate with each other through CAN. Hardware-wise, the CAN bus is divided into two lines, CANH and CANL. In the software code, set the address of control unit 1 to 1, the address of control unit 2 to 2, and the address of control unit 3 to 3. There is a communication interface reserved on the front panel of the power supply device's chassis. As Figure 2 shown, connect the CAN bus. The host computer is connected to the communication interface through a CAN box to achieve control of the power supply device.
[0035] The second step: Initial code burning and operation logic setting
[0036] When each control unit is used for the first time, load the loader code into control unit 1, control unit 2, and control unit 3 respectively. After the burning is completed, then burn the code of each control unit respectively.
[0037] Taking control unit 1 as an example, the setting of the operation logic in its code is as follows:
[0038] (1) The loader first completes its own initialization work, including loading necessary system resources, configuring the operating environment, etc.
[0039] (2) The loader finds the corresponding program file according to the pre-set rules and paths.
[0040] (3) The loader loads the program code and related resources into the memory of control chip 1, preparing the necessary conditions for the program to run.
[0041] (4) The loader calls the startup function of the program to trigger the program to start executing its core code.
[0042] This step clarifies the corresponding program update algorithm of the device to ensure that the device can correctly identify the received data and complete the replacement and upgrade of the program.
[0043] After control chip 1 is powered on again, it will execute according to the above-set operation logic.
[0044] The third step: CAN communication protocol and interface writing
[0045] Set the CAN communication protocol according to the communication requirements between the host computer and the power supply device. The format definition of the data frame is clearly defined in this communication protocol: the data frame is divided into two parts, a 29-bit identifier and a data field, and the length of the data field does not exceed 8 bytes. The 29-bit identifier is divided into two parts, an up / down flag bit and a power supply device address selection bit. The first byte of the data field is the function area, corresponding to different function definition bits, and defines the data frame length and meaning. The baud rate is set to 250 kbps in the communication protocol, and various error detection and handling mechanisms are described.
[0046] At the same time, to facilitate the interaction between the operator and the device, a power supply device program update operation interface is developed and named "DSP-CAN Upgrade Tool", as Figure 3 shown. This interface is divided into five parts: device parameters, send data frame, DSP upgrade, information, and message.
[0047] The so-called device parameters refer to the selection of devices and corresponding information during the CAN transmission process, including the type of CAN box used, the selected channel, the setting of the baud rate, the selection of the filtering method, and the setting of the acceptance code and mask code, etc.
[0048] The so-called send data frame means that according to the communication protocol, the type, format, ID, and data of the data frame can be set and sent to the power supply device to achieve the control of the power supply device.
[0049] For the so-called DSP upgrade, the type of control chip can be selected, as well as the address corresponding to the control chip that needs to be updated, and the HEX file compiled by the update program is uploaded to complete the program upgrade of the DSP chip.
[0050] The so-called information displays the DSP type, the address corresponding to the DSP chip that needs to be updated, the name and size of the updated HEX file, and the progress of the program update.
[0051] The so-called message displays the message uploaded by the power supply device to the host computer according to the communication protocol. Based on this, information such as the operating status of the power supply module, the output voltage, and the output current can be parsed.
[0052] Step 4: Program update and maintenance process
[0053] Subsequently, if the power supply device needs to be debugged or maintained, connect the CAN box to the reserved debugging interface of the device, and with the help of the "DSP-CAN Upgrade Tool", select the address of the control chip that needs to update the program, and upload the compiled HEX file to the target control chip, thereby realizing the program update, and there is no need to disassemble the electronic device throughout the process.
Claims
1. A method for program change and efficient maintenance of electronic devices without disassembling based on the CAN bus, characterized in that It includes the following steps: Step 1: Chip address setting and communication architecture building Each of the n control chips inside the electronic device is assigned a unique address, and the control chips communicate with each other through the CAN bus; Meanwhile, a CAN interface is set outside the electronic device for device debugging and maintenance; Step 2: Initial code burning and running logic setting When each control chip is initially put into use, the corresponding code for each control chip is burned respectively; When the electronic device starts up, the loader runs first, performs detection and evaluation according to the preset judgment logic. After completing the detection and judgment, it sequentially calls the codes of each control chip to ensure the operation of the device; Step 3: CAN communication protocol and interface programming According to various factors of the electronic device, including specific application scenarios, data transmission requirements, and performance indicators, the CAN communication protocol is set; Meanwhile, a matching operation interface is developed; Step 4: Program update and maintenance process During device debugging or subsequent maintenance, connect the CAN box to the external CAN interface reserved by the device. With the operation interface written according to the CAN communication protocol, select the address of the control chip whose program needs to be updated, and upload the compiled HEX file to the target control chip through the CAN box, so as to realize the program update without disassembling the electronic device throughout the process.
2. The method for program change and efficient maintenance of an electronic device without disassembling the machine based on the CAN bus as described in claim 1, wherein, In Step 2, the code includes the loader code and the original code.
3. The method for program change and efficient maintenance of an electronic device without disassembling based on the CAN bus according to claim 1, characterized in that, In Step 2, the loader first completes its own initialization work, including loading necessary system resources and configuring the running environment; then, the loader finds the corresponding application program file according to the preset rules and paths; next, the loader loads the code and relevant resources of the application program into the control chip memory to prepare the necessary conditions for the operation of the application program; finally, the loader calls the startup function of the application program to trigger the application program to start executing its core code.
4. A method for program change and efficient maintenance of an electronic device without disassembling the machine based on the CAN bus, characterized in that, In Step 3, the communication protocol should cover the format definition of data frames, clarify how data is packed and transmitted, set the baud rate, and various error detection and handling mechanisms.
5. A method for program change and efficient maintenance of electronic devices without disassembling based on the CAN bus according to claim 1, characterized in that, In Step 3, the operation interface needs to fully consider the actual needs and user habits to provide a convenient and efficient interaction method for subsequent device maintenance and program change.
6. The method for program change and efficient maintenance of an electronic device without disassembling the machine based on the CAN bus according to claim 1, characterized in that, In Step 4, the principle of specific program update is: the data in the HEX file is parsed according to specific rules, and then the parsed data is sent to the target device through the CAN bus; after the target device receives the data, according to the preset program update mechanism, the new data is written into the corresponding storage area to complete the program update.