A Method and Device for Upgrading a BD Board Based on a PLC

By writing the upgrade file to the PLC to upgrade the firmware upgrade of the BD board, the PLC solves the problems of complex and low security in the firmware upgrade process of the existing BD board, and simplifies the upgrade process and improves security.

CN115167889BActive Publication Date: 2025-07-01FUZHOU WECON ELECTRONICS TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210762002.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2025-07-01
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

The firmware upgrade process of existing BD boards is complicated, and it requires disassembly and assembly of BD boards and special hardware tools, which are low in security and have a high risk of firmware outflow.

Method used

By obtaining new firmware and generating corresponding upgrade files, the upgrade file is written to the PLC's to be upgraded, so that the PLC can upgrade the BD board firmware, simplifying the upgrade process, improving security, and reducing the risk of firmware outflow.

Benefits of technology

This simplifies the upgrade process of BD board firmware, improves security, and reduces the risk of firmware outflow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115167889B_ABST
    Figure CN115167889B_ABST
Patent Text Reader

Abstract

A method and device for upgrading a BD board based on a PLC. By obtaining a new firmware and generating a corresponding upgrade file; writing the upgrade file into the area to be upgraded of the PLC so that the PLC performs a verification operation; if the verification is successful, the PLC splits the upgrade file into several data frames and sends each data frame to the BD board respectively so that the BD board upgrades the current firmware according to the received data. When the PLC is connected to the BD board for on-site use and the firmware of the BD board needs to be upgraded, only by remotely downloading the upgrade file to the PLC can the firmware upgrade of the BD board be realized. This not only simplifies the upgrade process of the BD board firmware, but also has high security and low risk of firmware leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automation, and particularly to a method and device for upgrading a BD board based on a PLC. Background Art

[0002] The PLC is a programmable controller, and the BD board is an expandable board of the PLC. Both are embedded devices, and they usually communicate via the SPI bus.

[0003] Currently, the BD board can only be independently upgraded with firmware. The process of upgrading the firmware of the BD board is as follows:

[0004] ① Remove the BD board installed on the PLC and remove the outer shell of the BD board.

[0005] ② Short-circuit the boot pins of the BD board and connect to the serial port of the BD board using a specific device.

[0006] ③ Power on the BD board.

[0007] ④ Use the host computer tool to download the firmware to the FLASH of the BD board.

[0008] ⑤ Restart the BD board to complete the upgrade.

[0009] Therefore, for the existing BD board firmware upgrade, not only are the operation steps complex, requiring the disassembly and assembly of the BD board, but also special hardware tools are needed, and on-site personnel cannot directly operate. Moreover, the security is relatively low, and the downloaded firmware is directly executable firmware, with a high risk of firmware leakage. Summary of the Invention

[0010] (I) Technical Problems to be Solved

[0011] In order to solve the above problems of the existing technology, the present invention provides a method and device for upgrading a BD board based on a PLC, which can simplify the process of upgrading the firmware of the BD board, and has high security and a low risk of firmware leakage.

[0012] (II) Technical Solutions

[0013] In order to achieve the above object, a technical solution adopted by the present invention is:

[0014] A method for upgrading a BD board based on a PLC, comprising the steps of:

[0015] S1. Obtain a new firmware and generate a corresponding upgrade file;

[0016] S2. Write the upgrade file into the area to be upgraded of the PLC, so that the PLC upgrades the firmware to be upgraded in the BD board.

[0017] In order to achieve the above object, another technical solution adopted by the present invention is:

[0018] A device for upgrading a BD board based on a PLC, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the following steps are implemented:

[0019] S1. Obtain a new firmware and generate a corresponding upgrade file;

[0020] S2. Write the upgrade file into the area to be upgraded of the PLC, so that the PLC upgrades the firmware to be upgraded in the BD board.

[0021] (III) Beneficial effects

[0022] The beneficial effects of the present invention are as follows: By obtaining a new firmware and generating a corresponding upgrade file; writing the upgrade file into the area to be upgraded of the PLC, so that the PLC uses the firmware to be upgraded to upgrade the BD board. When the PLC is connected to the BD board for on-site use and the firmware of the BD board needs to be upgraded, only by remotely downloading the upgrade file into the PLC can the firmware of the BD board be upgraded. This not only simplifies the upgrade process of the BD board firmware, but also has high security and low risk of firmware leakage. Description of the drawings

[0023] Figure 1 It is a flowchart of a method for upgrading a BD board based on a PLC according to an embodiment of the present invention;

[0024] Figure 2 It is a schematic diagram of the overall structure of a device for upgrading a BD board based on a PLC according to an embodiment of the present invention.

[0025]

Description of the reference numerals

[0026] 1: A device for upgrading a BD board based on a PLC;

[0027] 2: Memory;

[0028] 3: Processor. Detailed implementation manners

[0029] In order to better explain the present invention for easy understanding, the present invention will be described in detail below with reference to the drawings through specific implementation manners.

[0030] Embodiment 1

[0031] Please refer to Figure 1 , a method for upgrading a BD board based on a PLC, comprising the steps of:

[0032] S0. Divide the BD board into a running block and an upgrade block. The running block is used to run the firmware, and the upgrade block is used to communicate with the PLC and decrypt the firmware.

[0033] S1. Obtain a new firmware and generate a corresponding upgrade file;

[0034] Step S1 is specifically as follows:

[0035] Obtain a new firmware, add a file header and encrypt the new firmware to generate a corresponding upgrade file. The file header is used to distinguish the firmware in the PLC from the firmware in the BD board.

[0036] Specifically, the firmware obtained by the user is an upgraded file with a header and encryption. This file cannot be used if it is directly downloaded to the FLASH through the download provided by the chip. It must be upgraded through the PLC, preventing the risk that others can use the firmware provided by this application after copying the board and downloading it.

[0037] By adding a file header to the new firmware, it is convenient to distinguish between the upgradeable firmware of the PLC and the upgradeable firmware of the BD board. Moreover, the file header includes a check value, which is convenient for the subsequent PLC to check the correctness of the upgrade file.

[0038] S2. Write the upgrade file into the area to be upgraded of the PLC, so that the PLC upgrades the firmware to be upgraded on the BD board.

[0039] Step S2 is specifically as follows:

[0040] S21. Write the upgrade file into the area to be upgraded of the PLC, so that the PLC performs a verification operation;

[0041] Among them, the verification operation includes:

[0042] Check the correctness of the upgrade file, whether the BD board connection is normal, and whether the current firmware version of the BD board supports the upgrade according to the check value in the file header of the upgrade file.

[0043] S22. If the verification is successful, the PLC splits the upgrade file into several data frames and sends each data frame to the BD board, so that the BD board upgrades the firmware to be upgraded according to the received data.

[0044] Among them, after the PLC successfully verifies the upgrade file, the firmware to be upgraded is upgraded after controlling the BD board to enter the upgrade mode.

[0045] The specific operation of the PLC splitting the upgrade file into several data frames is as follows:

[0046] The PLC uses full-duplex communication to obtain the maximum length of the data frames that the BD board can receive from the BD board, and splits the upgrade file into several data frames according to the maximum length of the data frames that the BD board can receive.

[0047] Specifically, sending each data frame to the BD board is as follows:

[0048] After assigning corresponding IDs and CRC check codes to each data frame, write them into the DMA to send each data frame to the BD board, and record the data frames that fail to be sent.

[0049] Specifically, adopting the communication method of SPI full duplex + DMA can greatly improve the update speed.

[0050] S23. If the recording times of the data frames that fail to be sent reach the preset times, disassemble the data frame into several small packets, assign corresponding IDs and CRC check codes to each small packet, and then write them into the DMA to send to the BD board.

[0051] Specifically, by assigning corresponding IDs and CRC check codes to each data frame, not only can the correctness of data transmission be ensured, but also if a data frame fails to be transmitted, it is convenient to record the corresponding transmission failure frame and retransmit it. If the current data frame fails to reach the preset times, the PLC disassembles the current data frame and transmits it in small packets, which can reduce the number of error frames and retransmission times in an environment with strong interference, thus accelerating the transmission efficiency. Moreover, even if the upgrade fails for various reasons during the upgrade process, the user boot of the BD board can still run, and can be successfully upgraded again through the PLC and then can be used normally. In addition, after the PLC to-be-upgraded area downloads the upgrade file, it will no longer require the operation of the host computer subsequently and can be transmitted to multiple BD boards.

[0052] Embodiment 2

[0053] The difference between this embodiment and Embodiment 1 is that this embodiment will further illustrate how the above method for upgrading the BD board based on the PLC is implemented in combination with a specific application scenario:

[0054] The basic concept of this application is to divide the BD board into a running block and an upgrade block. The upgrade block is called user boot, and user boot provides a dedicated fast communication protocol and firmware decryption process with the PLC. The host computer first downloads the firmware to the to-be-upgraded area of the PLC (stored in the SPI FLASH of the PLC). The PLC controls the BD board to enter the user boot mode through communication, and transfers the firmware in the to-be-upgraded area to the BD board completely. The BD board decrypts the firmware and then runs it in the running block.

[0055] Specifically, it also includes a temporary storage and decryption area.

[0056] 1. Obtain a new firmware, and generate a corresponding upgrade file after adding a file header and encrypting the new firmware. The file header is used to distinguish the firmware in the PLC and the firmware in the BD board.

[0057] 2. Write the upgrade file into the area to be upgraded of the PLC through the transmission protocol between the host computer (i.e., the device for upgrading the BD board based on the PLC) and the PLC, so that the PLC performs a verification operation;

[0058] If the verification is successful, the PLC splits the upgrade file into several data frames and sends each data frame to the BD board, so that the BD board upgrades the firmware to be upgraded according to the received data;

[0059] 3. The verification operation includes that the PLC checks the correctness of the upgrade file according to the verification value in the file header of the upgrade file, whether the BD board connection is normal, and whether the current firmware version of the BD board supports the upgrade.

[0060] 4. The PLC controls the BD board to enter the user boot mode;

[0061] 5. The PLC and the BD board first perform a 5-byte data interaction in a full-duplex communication mode, including an "interaction data header", a "length of the data frame to be sent", and a "maximum length of the receivable data frame", to obtain the maximum length of the receivable data frame of the BD board;

[0062] 6. The PLC splits the upgrade file into several data frames according to the maximum length of the receivable data frame of the BD board. After assigning corresponding IDs and CRC check codes to each data frame, it writes them into the DMA and sends each data frame to the BD board respectively. The BD board replies to the PLC with the ID of the received data frame;

[0063] 7. The BD board notifies the PLC to re-transmit the failed frames (i.e., re-send the IDs of the data frames not received by the BD board). If it fails again (of course, the corresponding number of failure times can also be set according to actual needs), the PLC disassembles the data frame with the corresponding ID into several small packets, assigns corresponding IDs and CRC check codes to each small packet, and then writes them into the DMA and sends them to the BD board.

[0064] 8. When all the upgrade files in the PLC are sent to the BD board, the BD board decrypts the entire file. After verifying the file correctly through the CRC check code, it is placed in the running area for execution, thus completing the automatic upgrade of the BD board.

[0065] Embodiment III

[0066] Please refer to Figure 2 , a device 1 for upgrading a BD board based on a PLC, including a memory 2, a processor 3, and a computer program stored on the memory 2 and operable on the processor 3. When the processor 3 executes the program, it implements each step in Embodiment I.

[0067] The above are only embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the relevant technical fields, shall similarly be included in the patent protection scope of the present invention.

Claims

1. A method for upgrading a BD board based on a PLC, characterized in that, Including the steps: S1. Obtain a new firmware and generate a corresponding upgrade file; S2. Write the upgrade file into the area to be upgraded of the PLC, so that the PLC upgrades the firmware to be upgraded in the BD board; Before step S1, there is also a step: S0. Divide the BD board into a running block and an upgrade block. The running block is used to run the firmware, and the upgrade block is used to communicate with the PLC and decrypt the firmware; Step S1 is specifically: Obtain a new firmware, and after adding a file header and encrypting the new firmware, generate a corresponding upgrade file. The file header is used to distinguish the firmware in the PLC from the firmware in the BD board; Step S2 is specifically: Write the upgrade file into the area to be upgraded of the PLC, so that the PLC performs a verification operation; If the verification is successful, the PLC splits the upgrade file into several data frames and sends each data frame to the BD board, so that the BD board upgrades the firmware to be upgraded according to the received data; The specific operation of sending each data frame to the BD board is: After assigning a corresponding ID and CRC check code to each data frame, write it into the DMA to send each data frame to the BD board, and record the data frames that fail to be sent; It also includes: If the number of records of the data frames that fail to be sent reaches a preset number, disassemble the data frame into several small packets, assign a corresponding ID and CRC check code to each small packet, and then write it into the DMA to send it to the BD board.

2. The method for upgrading the BD board based on the PLC according to claim 1, characterized in that The verification operation includes: Check the correctness of the upgrade file, whether the BD board connection is normal, and whether the current firmware version of the BD board supports the upgrade according to the verification value in the file header of the upgrade file.

3. The method for upgrading the BD board based on the PLC according to claim 1, wherein The specific operation of the PLC splitting the upgrade file into several data frames is: The PLC obtains the maximum length of the data frames that the BD board can receive from the BD board, and splits the upgrade file into several data frames according to the maximum length of the data frames that the BD board can receive.

4. The method for upgrading the BD board based on PLC according to claim 1, wherein The specific operation of making the PLC upgrade the firmware to be upgraded in the BD board is: Make the PLC control the BD board to enter the upgrade mode and then upgrade the firmware to be upgraded.

5. A device for upgrading a BD board based on a PLC, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for upgrading the BD board based on the PLC according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • IAP (Internet Access Provider) based configurable full-network remote node firmware upgrading method

    CN104503796A

  • Upgrade data transmission method, unvarnished transmission equipment, device, communication system and medium

    CN114338393A