Multi-device DSP program collaborative upgrading method based on CAN bus

By storing the device ID in the device and configuring the CAN receiver mailbox ID, multi-device collaborative upgrades are achieved using the CAN bus, solving the problem of difficulty in upgrading specific devices in multi-device environments in the prior art, and improving upgrade efficiency and adaptability.

CN120909628APending Publication Date: 2025-11-07CHINA STATE SHIPBUILDING CORP LTD RESEARCH INSTITUTE 719
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510745947.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing technologies cannot upgrade specific devices individually in a multi-device environment, and the second-level boot program is difficult to standardize, leading to device program management errors and inconvenience in upgrading.

Method used

By storing the device ID in the device and configuring the CAN receiver mailbox ID, the CAN bus is used to realize the collaborative upgrade of multiple devices. The host computer is used to configure different CAN_IDs to issue commands, ensuring that each device can be upgraded independently.

Benefits of technology

It enables individual upgrades of designated devices when multiple devices are powered on simultaneously or share a power supply, improving upgrade efficiency and adaptability, and avoiding difficulties and errors in device program standardization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909628A_ABST
    Figure CN120909628A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-device DSP program collaborative upgrading method based on a CAN bus, and relates to the technical field of CAN bus device upgrading, and the multi-device DSP program collaborative upgrading method based on the CAN bus mainly comprises the following steps: writing a device ID and a bootstrap program into a device and carrying out power-on initialization, configuring a CAN to send the ID by an upper computer, and sending an online upgrading instruction and a DSP upgrading target file; the DSP upgrading target file is analyzed and verified, DSP upgrading is carried out according to the verification condition, and programming verification is carried out till upgrading is completed. By means of the multi-device DSP program collaborative upgrading method based on the CAN bus, the adaptability and efficiency of multi-device DSP program upgrading of the CAN bus can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the CAN bus device upgrade technical field, more particularly, to a multi-device DSP program cooperative upgrade method based on CAN bus. BACKGROUND

[0002] According to the application scene of DSP28335 chip, traditional online upgrade technical systems based on RS485, CAN, CANFD and Ethernet have been developed. These methods meet the DSP program online upgrade function of single device in different application environments. Since in many application scenes, the CAN bus of multiple devices in the system needs to be connected to the same CAN bus or RS485 bus, when the secondary Boot programs of multiple devices in the system are the same and the application programs to be upgraded are different, the requirement of upgrading the specified single device when multiple devices in the system are powered on at the same time cannot be met, and the inherent defects are obvious. Two actual defects are found by summarizing the existing online upgrade technology. Defect one is that when multiple devices in the system share the same secondary Boot program, the received CAN online upgrade file cannot be distinguished according to the device ID, and the corresponding device is not correctly issued to upgrade the application program. If the secondary Boot programs of multiple devices in the system have singularity, the program management of batch production devices has great challenge, and in the factory download process, it is easy to make mistakes. Defect two is that if multiple devices in the system share the same secondary Boot program, when the device ID cannot be distinguished, only the other devices can be powered off, and the specified single device can be upgraded. If multiple devices in the system share the same external power supply, the single device cannot be powered on alone, and the program online upgrade cannot be performed.

[0003] Specifically, the prior art CAN bus online upgrading method is as follows: 1. In the secondary Boot program, CAN registers are initialized to determine the receiving and sending mailbox IDs; the ID of each receiving mailbox corresponds to the number of the file issued by the single-device application program; 2. The secondary Boot program waits for the online upgrading instruction during the set startup delay process; if the set startup delay is exceeded, the application program is executed, and the online upgrading instruction is no longer received; if the online upgrading instruction is received during the set driving delay process, the upgrading process is entered; 3. After receiving the online upgrading instruction, the secondary Boot program needs to analyze the received CAN frame arbitration section; if the arbitration section ID is the same as the receiving mailbox ID, the online upgrading instruction is executed, and the application program is burned into the specified on-chip FLASH address; 4. After the secondary Boot program receives and burns all the application programs to be upgraded, the upgrading process is ended. The general application scenario is: the DSP application program of a single device is upgraded. The following limitations exist: 1. When multiple devices are powered on at the same time, only the same application program can be received: when multiple devices in the system are powered on at the same time and the CAN transceivers of the multiple devices are connected to the same CAN bus, the DSP application program issued by the host computer will be received by all the devices and the program will be upgraded, at this time, the application programs of all the devices are the same; 2. It is difficult to manage the secondary Boot programs of multiple devices: when multiple devices in the system are powered on at the same time and the CAN transceivers of the multiple devices are connected to the same CAN bus, it is required to upgrade the multiple devices online at the same time, and the program files to be upgraded are different; since the receiving mailbox ID in the secondary Boot program should correspond to the number of the upgrading file, when multiple devices in the system are upgraded online at the same time, the receiving mailbox ID in the secondary Boot program should be modified to correspond to the code of the application program to be upgraded, resulting in different secondary Boot programs of the multiple devices in the system, which is not convenient for the management of the secondary Boot programs of the boards in the system, and also brings hidden dangers to the application program upgrading errors caused by program issuing errors.

[0004] It can be seen that the main defects of the prior art are: One is that a single device on the CAN bus cannot be upgraded: because the secondary Boot programs of multiple devices in the system are the same, the CAN receiving mailbox IDs of the multiple devices are the same. When the device receives the program online upgrade instruction and upgrade data on the CAN bus, the CAN-ID of the arbitration section is first judged, and only the online upgrade instruction and upgrade data with the same CAN receiving mailbox ID of the device are received. When all devices in the system are connected to the same CAN bus, when the host computer issues an online upgrade instruction, all devices in the system correspondingly execute the current online upgrade instruction, and the application programs of all devices are modified to the same application program, causing the DSP programs of other devices to be accidentally modified. If a single device is to be upgraded, other devices must be powered off or the CAN transceiver of other devices must be disconnected. In some specific environments, devices are connected to the same power supply, and a single device cannot be powered on, and the CAN transceiver of other devices cannot be disconnected, so the DSP program of a single device cannot be upgraded online while ensuring that the DSP application programs of other devices remain unchanged.

[0005] Two is the difficulty of secondary Boot program uniformity in a multi-device environment: because in some specific environments, the DSP application programs of all devices in the system need to be upgraded online at the same time, the host computer will construct different CAN online upgrade instruction frames and data frames according to the device number and issue them to all devices on the CAN bus. Because the CAN receiving mailbox ID of the secondary Boot in each device needs to match the device number, the secondary Boot program stored in each device is different. In addition, if the device number is changed, the CAN receiving mailbox ID of the corresponding secondary Boot program will also be changed. Changing the secondary Boot program requires connecting a simulator to write in Debug mode, which is difficult to replace in some specific environments.

[0006] Therefore, the current DSP online upgrade only supports single-device upgrade, and presents a systematic shortcoming when dealing with complex industrial scenarios or when multiple devices need to be upgraded online at the same time, ignoring real factors such as assembly environment, multiple modules that need to be upgraded at the same time, and system power-on environment. As a result, in some specific environments, multiple devices cannot be upgraded at the same time, and the corresponding DSP application software is more visible. A systematic solution needs to be proposed to address the above problems.

[0007] The above content is only used to assist in understanding the technical solutions of the present application and does not represent an acknowledgement of the above content as prior art. SUMMARY

[0008] The purpose of the present application is to provide a multi-device DSP program cooperative upgrade method based on a CAN bus, which can improve the adaptability and efficiency of the multi-device DSP program upgrade of the CAN bus.

[0009] The application provides a CAN bus-based multi-device DSP program cooperative upgrading method, comprising the following steps: S1, writing a device ID into a first preset storage address of a first memory of a device; S2, writing a boot program into a specified area of a FLASH in a DSP of the device; S3, connecting a plurality of devices with an upper computer by using a CAN bus, wherein the upper computer is used for online upgrading; S4, powering on the device and initializing; S5, confirming that the upper computer configures a CAN sending ID and sends an online upgrading instruction and a DSP upgrading target file; S6, analyzing the DSP upgrading target file according to the CAN sending ID and the online upgrading instruction to obtain upgrading file information, wherein the upgrading file information comprises a data identification code, a data length, a storage base address and an offset address; S7, checking the upgrading file information; if the checking is correct, sending a receiving success response flag to the upper computer and performing DSP upgrading according to the data identification code; if the checking is incorrect, sending a receiving failure response flag to the upper computer; S8, if the upper computer receives the receiving success response flag, issuing a next frame of file information; if the upper computer receives the receiving failure response flag, reissuing a previous frame of file information; if the upper computer still receives the receiving failure response flag after confirming that the previous frame of file information is reissued for three times, prompting an error and stopping the upgrading process; S9, confirming that the device performs DSP upgrading according to the data identification code and performs programming and checking of the written data; if the programming and checking is correct, sending a programming success response flag to the upper computer; if the programming and checking is incorrect, sending a programming error response flag to the upper computer; S10, confirming that the upgrading target file is completely programmed according to the DSP upgrading target file and the programming success response flag to obtain a progress completion flag; and displaying the upgrading completion according to the progress completion flag.

[0010] Further, the first memory is a FLASH.

[0011] Further, the specified area of the FLASH in the device DSP is an A sector of the FLASH in the device DSP.

[0012] Further, step S4 specifically comprises: S41, confirming that the device is powered on, reading the device ID from the first preset storage address, and configuring a CAN receiving mailbox ID according to the device ID; S42, confirming that the configuration of the CAN receiving mailbox ID is completed, and starting a timer interrupt; S43, confirming that the online upgrading instruction is not received within a preset waiting time, and confirming that the DSP application program exists in the FLASH in the device DSP, and executing the DSP application program; S44, confirming that the online upgrading instruction is not received within the preset waiting time, and confirming that the DSP application program does not exist in the FLASH in the device DSP, executing the boot program according to the specified area of the FLASH in the device DSP, and waiting for the online upgrading instruction of the upper computer.

[0013] Further, the preset waiting time is 10s.

[0014] Further, the online upgrade instruction is sent by the host computer.

[0015] Further, the DSP upgrade target file is in HEX format.

[0016] Further, the DSP upgrade according to the data identification code comprises: performing the erasing of the FLASH and the burning flow of the DSP upgrade target file, and burning the DSP upgrade target file into the specified FLASH sector.

[0017] The application also provides a CAN bus based multi-device DSP program cooperative upgrade method application, which is applied to CAN bus device DSP program upgrade.

[0018] The CAN bus based multi-device DSP program cooperative upgrade method has the following beneficial effects: The application externally hangs a piece of storage flash on a device board card, which is used for storing 32Bit device ID information. The secondary Boot program in the board card reads the device ID information from the flash after power-on, which is used for configuring CAN receiving mailbox and sending mailbox ID. The secondary Boot program can receive the device ID change instruction issued by the host computer, and change the device ID information stored in the flash, so as to avoid the risk that the secondary Boot software needs to be re-coded and the emulator needs to be externally hung for program LOAD due to the change of the device ID information. In the system, each device is powered on or powered off at the same time, and the CAN-H and CAN-L of each device are connected to the same CAN bus, so that the CAN-ID in the online upgrade instruction issued by the host computer is different. The sent online upgrade instruction is transmitted to the transceiver of each CAN node device, and the CAN transceiver filters according to the CAN receiving mailbox ID configured by the register. After the node device receives the correct CAN online upgrade instruction, the DSP application program of the node device is read for upgrade update. In order to save the device program update time, the host computer can configure the CAN online upgrade instruction ID of all devices in the system, and issue the CAN online upgrade instruction ID to the CAN bus in sequence, so as to simultaneously perform online upgrade on all devices in the system.

[0019] The application realizes the function of simultaneous DSP application program (different upgrade files) online upgrade of multiple devices in the system by storing the device ID in the FLASH, reading the stored device ID from the FLASH after power on and using it to configure the CAN receiving and sending mailbox ID. In addition, the DSP application program online upgrade function of a specified single device can also be realized when multiple devices are powered on at the same time and the CAN transceiver accesses the same CAN bus. When the system has a multiple device environment, a single device cannot be powered on or accessed to the upgrade CAN bus alone, and the online upgrade function of a single device can be realized by setting different CAN receiving mailbox IDs for each multiple device, filtering CAN online upgrade instructions with different IDs. In a system with a multiple device environment, multiple CAN sending IDs can be configured by the upper computer as CAN online upgrade instructions for different devices, and the DSP application program of each device can be different, saving upgrade time and making up for the defect that the traditional upgrade method cannot perform online upgrade on a specified device without disassembling the CAN transceiver or powering the device alone.

[0020] The application designs a HEX file online upgrade method based on multiple devices connected in series on the same CAN bus, which realizes the online upgrade of a specified device or the online upgrade of multiple devices with different DSP programs at the same time. When the BootLeader programs of multiple devices are the same, the upper computer can control the online upgrade of multiple devices with different DSP programs at the same time by downloading remote upgrade instructions with different CAN_IDs. The upper computer can also download specified CAN_ID device upgrade instructions to perform online upgrade on a specified single device after multiple devices are powered on at the same time. In addition, the versions of the BootLeader programs of each device are the same, which is convenient for version management. BRIEF DESCRIPTION OF DRAWINGS

[0021] The application will be further described below with reference to the accompanying drawings and embodiments. In the drawings: Figure 1 is a flowchart of the multiple device DSP program collaborative upgrade method based on the CAN bus provided by the application; Figure 2 is a schematic diagram of the CAN bus device and the upper computer; Figure 3 is an operation schematic diagram of the multiple device DSP program collaborative upgrade method based on the CAN bus provided by the application. DETAILED DESCRIPTION

[0022] In order to have a clearer understanding of the technical features, objectives and effects of the application, the specific embodiments of the application will be described in detail with reference to the accompanying drawings.

[0023] Figure 1A schematic diagram of the CAN bus-based multi-device DSP program cooperative upgrading method of the embodiment is shown. In the embodiment, the CAN bus-based multi-device DSP program cooperative upgrading method comprises the following steps: S1: writing a device ID into a first preset storage address of a first memory of a device; In an exemplary embodiment, the first memory is a FLASH; S2: writing a boot program into a designated area of a device DSP on-chip FLASH; In an exemplary embodiment, the designated area of the device DSP on-chip FLASH is sector A of the device DSP on-chip FLASH; S3: connecting a plurality of devices to a host computer via a CAN bus, the host computer being used for online upgrading; S4: powering on the device and performing initialization; In an exemplary embodiment, step S4 specifically comprises: S41: confirming that the device is powered on, reading the device ID from the first preset storage address, and configuring a CAN receiving mailbox ID according to the device ID; S42: confirming that the configuration of the CAN receiving mailbox ID is completed, and starting a timer interrupt; S43: confirming that no online upgrading instruction is received within a preset waiting time, and confirming that the device DSP on-chip FLASH contains a DSP application program, and executing the DSP application program; In an exemplary embodiment, the preset waiting time is 10s; In an exemplary embodiment, the online upgrading instruction is sent by the host computer; S44: confirming that no online upgrading instruction is received within a preset waiting time, and confirming that the device DSP on-chip FLASH does not contain a DSP application program, executing the boot program according to the designated area of the device DSP on-chip FLASH, and waiting for the online upgrading instruction of the host computer; S5: confirming that the host computer configures a CAN sending ID, and sending an online upgrading instruction and a DSP upgrading target file; S6: analyzing the DSP upgrading target file to obtain upgrading file information according to the CAN sending ID and the online upgrading instruction; the upgrading file information comprises a data identification code, a data length, a storage base address, and an offset address; In an exemplary embodiment, the DSP upgrading target file is in a HEX format; S7: checking the upgrading file information; confirming that the check is correct, sending a receiving success response flag to the host computer, and performing DSP upgrading according to the data identification code; and confirming that the check is incorrect, sending a receiving failure response flag to the host computer; In an exemplary embodiment, the DSP upgrading according to the data identification code comprises executing erasing of FLASH and burning procedure of the DSP upgrading target file, and the DSP upgrading target file is burned into the designated FLASH sector; S8: confirming that the host computer receives the receiving success response flag, issuing the next frame of file information; confirming that the host computer receives the receiving failure response flag, reissuing the current frame of file information, confirming that the host computer still receives the receiving failure response flag after reissuing the current frame of file information for three times, prompting an error and stopping the upgrading procedure; S9: confirming that the device upgrades the DSP according to the data identification code, performing burning verification on the written data; confirming that the burning verification is correct, sending the burning success response flag to the host computer; confirming that the burning verification is incorrect, sending the burning error response flag to the host computer; S10: according to the DSP upgrading target file and the burning success response flag, confirming that the upgrading target file is completely burned, obtaining a progress completion flag; displaying the upgrading completion according to the progress completion flag.

[0024] It should be noted that, Step 11: after the DSP upgrading target file of each device is upgraded, the device needs to be powered on again, and then the DSP application program can be normally jumped.

[0025] In some embodiments, the above-mentioned CAN bus-based multi-device DSP program cooperative upgrading method can also be implemented in the following way.

[0026] In the embodiment, the CAN bus-based multi-device DSP program cooperative upgrading method comprises the following steps: Step 1: before the device is integrated, the device ID is written into the specific address of the card external FLASH through the Debug mode; Step 2: after the device is integrated, the BootLeader boot program is burned into the A sector of the in-chip FLASH of the DSP28335 chip through the emulator; Step 3: the CAN interface outside the multiple devices is connected to the host computer used for performing online upgrading; Step 4: after the device is powered on, each device reads the card ID from the FLASH, and uses the ID to configure the CAN receiving mailbox ID, at this time, the CAN receiving mailbox ID of each device is different. After the configuration is completed, the timer interrupt is started, and the online upgrading instruction corresponding to the host computer is waited for within 10s. If the online upgrading instruction is not received within 10s, it is judged whether the DSP application program exists in the in-chip FLASH. If the DSP application program exists, the application program is jumped, and if the DSP application program does not exist, the BootLeader boot program is stayed in, and the online upgrading instruction of the host computer is waited for; Step5: The host computer configures the CAN sending ID, sends the online upgrade instruction to the specified device to be upgraded, and the host computer can send the online upgrade instruction to multiple devices in turn by changing the CAN sending ID. The device receiving the corresponding ID will be in the online upgrade mode at the same time and wait for the corresponding DSP upgrade target file to be downloaded. Step6: After each device receives the DSP upgrade target file (HEX format) sent by the host computer, the file information is parsed to read the data identification code, data length, storage base address, offset address, and check. According to the data identification code, the erase of the FLASH and the writing process of the DSP upgrade target file are executed, and the DSP upgrade target file is written to the specified FLASH sector.

[0027] Step7: During the upgrade process, each device checks the received file information. If the check is correct, the corresponding process is executed according to the data identification code, and a successful reception is sent to the host computer. If the check is incorrect, no write operation is performed, and a failed reception is sent to the host computer.

[0028] Step8: If the host computer receives the successful response flag, the next frame of file information is sent. If the host computer receives the error response flag, the current frame of file information is sent again. If the error response flag is still received after repeating 3 times, an error is reported and the upgrade process is stopped.

[0029] Step9: During the FLASH writing process of the DSP upgrade target file, each device checks the written data to determine whether the written program is correct. If correct, a successful writing is sent to the host computer. If incorrect, an error writing is sent to the host computer.

[0030] Step10: After the DSP upgrade target file of each device is completely written, a progress completion flag is sent to the host computer, and the host computer receives the flag and displays the upgrade completion.

[0031] Step11: After the DSP upgrade target file of each device is upgraded, the device needs to be powered on again to normally jump to the DSP application program.

[0032] The embodiment provides a CAN bus-based multi-device DSP program cooperative upgrade method and application, which is applied to CAN bus device DSP program upgrade.

[0033] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, but not restrictive, and a person of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims, and these all belong to the protection of the present application.

Claims

1. A CAN bus-based multi-device DSP program cooperative upgrading method, characterized in that, The method comprises the following steps: S1: writing the device ID into a first preset storage address of a first memory of the device; S2: writing the boot program into a specified area of a FLASH in a DSP of the device; S3: connecting the device to an upper computer via a CAN bus, the upper computer being used for online upgrading; S4: powering on the device and initializing the device; S5: confirming that the upper computer configures a CAN sending ID and sends an online upgrading instruction and a DSP upgrading target file; S6: analyzing the DSP upgrading target file according to the CAN sending ID and the online upgrading instruction to obtain upgrading file information, the upgrading file information comprising a data identification code, a data length, a storage base address and an offset address; S7: checking the upgrading file information; if the checking is correct, sending a receiving success response flag to the upper computer and performing DSP upgrading according to the data identification code; if the checking is incorrect, sending a receiving failure response flag to the upper computer; S8: if the upper computer receives the receiving success response flag, issuing a next frame of file information; if the upper computer receives the receiving failure response flag, reissuing a current frame of file information; if the upper computer still receives the receiving failure response flag after reissuing the current frame of file information for three times, prompting an error and stopping the upgrading process; S9: confirming that the device performs DSP upgrading according to the data identification code and performing burn-in checking on the written data; if the burn-in checking is correct, sending a burn-in success response flag to the upper computer; if the burn-in checking is incorrect, sending a burn-in error response flag to the upper computer; S10: confirming that the upgrading target file is completely burned in according to the DSP upgrading target file and the burn-in success response flag, and obtaining a progress completion flag; displaying the completion of the upgrading according to the progress completion flag. The first memory is a FLASH. The specified area of the FLASH in the DSP of the device is sector A of the FLASH in the DSP of the device.

2. The CAN bus-based multi-device DSP program cooperative upgrading method according to claim 1, wherein, Step S4 specifically comprises:

3. The CAN bus based multi-device DSP program cooperative upgrading method according to claim 1, wherein, S41: confirming that the device is powered on, reading the device ID from the first preset storage address, and configuring a CAN receiving mailbox ID according to the device ID; 4. The CAN bus based multi-device DSP program cooperative upgrading method according to claim 1, wherein, S42: confirming that the configuration of the CAN receiving mailbox ID is completed, and starting a timer interrupt; S43: confirming that the online upgrading instruction is not received within a preset waiting time, and confirming that the DSP application program exists in the FLASH in the DSP of the device, and executing the DSP application program; S44: confirming that the online upgrading instruction is not received within the preset waiting time, and confirming that the DSP application program does not exist in the FLASH in the DSP of the device, executing the boot program according to the specified area of the FLASH in the DSP of the device, and waiting for the online upgrading instruction of the upper computer. The preset waiting time is 10s. The online upgrading instruction is sent by the upper computer.

5. The CAN bus-based multi-device DSP program cooperative upgrading method according to claim 4, wherein, The DSP upgrading target file is in a HEX format.

6. The CAN bus based multi-device DSP program cooperative upgrading method according to claim 4, wherein, The DSP upgrading according to the data identification code comprises: executing the burn-in process of the FLASH and the DSP upgrading target file, and burning the DSP upgrading target file into the specified sector of the FLASH.

7. The CAN bus based multi-device DSP program cooperative upgrading method according to claim 1, wherein, The method is applied to the DSP program upgrading of a CAN bus device.

8. The CAN bus based multi-device DSP program cooperative upgrading method according to claim 1, wherein, ​ 9. The application of the CAN bus-based multi-device DSP program cooperative upgrading method according to any one of claims 1-8, characterized in that, ​