CN115328505A - Electromechanical management MCU firmware burning method and system - Google Patents

Electromechanical management MCU firmware burning method and system Download PDF

Info

Publication number
CN115328505A
CN115328505A CN202211008551.3A CN202211008551A CN115328505A CN 115328505 A CN115328505 A CN 115328505A CN 202211008551 A CN202211008551 A CN 202211008551A CN 115328505 A CN115328505 A CN 115328505A
Authority
CN
China
Prior art keywords
mcu
firmware
slave node
burning
disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211008551.3A
Other languages
Chinese (zh)
Inventor
林飞浪
张勇
罗雄豹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fiberhome Technical Services Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fiberhome Technical Services Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd, Wuhan Fiberhome Technical Services Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202211008551.3A priority Critical patent/CN115328505A/en
Publication of CN115328505A publication Critical patent/CN115328505A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Abstract

The invention relates to the technical field of electromechanical management of communication equipment, and provides an electromechanical management MCU firmware burning method and system. The starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; the slave node MCU is set as a slave system memory to be started, and a BootLoader of the slave node MCU is operated; the master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and the slave node MCU is reset to enter the Bootloader of the slave node MCU for running so as to burn or update the firmware. Compared with the method for realizing firmware burning by using Jtag and SWD interfaces, the method saves IO pins and wiring in a CAN bus mode without increasing extra cost.

Description

Electromechanical management MCU firmware burning method and system
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of electromechanical management of communication equipment, in particular to an electromechanical management MCU firmware burning method and system.
[ background of the invention ]
The method belongs to the field of MCU firmware burning of the electromechanical management of the existing communication equipment. As shown in fig. 1, the office organic and electronic management MCUs are distributed on various single disks on the frame of the communication equipment. The single-disk type is roughly divided into 4 categories, namely a main control disk, a fan disk, a service disk and a power disk. The master control MCU and the master control CPU are interconnected through an SPI bus, and the electromechanical management MCU is interconnected through a CAN bus.
For example, for the MCU of STM32, the MCU may control the start mode of the MCU by configuring two pins, BOOT0 and BOOT 1. There are 3 starting modes to choose:
in the first mode, starting from the Main Flash memory, the area stores the firmware (program) of the user.
And secondly, starting the System Memory, wherein the BootLoader of the MCU is stored in the area and provided by an MCU manufacturer, and when the MCU is operated in the area, some commands and data CAN be received through IIC, CAN, UART, SPI and other communication interfaces.
Mode three, starting from SRAM.
In the prior art, when a communication equipment board card is produced, firmware needs to be manually burned into each single-disc electromechanical MCU; when multiple types of MCUs exist, corresponding firmware needs to be burned respectively, and burning errors and burning omission are easy to occur; the number of the communication equipment service board cards and the fan control boards is large, and a large amount of labor cost is increased by manually burning firmware; each set of MCU program needs to realize a customized upgrading function to support online upgrading, the research and development cost is high, and risks exist.
In view of this, overcoming the drawbacks of the prior art is a problem to be solved urgently in the art.
[ summary of the invention ]
The technical problem to be solved by the invention is that when a communication equipment board card is produced, firmware needs to be manually burned into each single-disc electromechanical MCU; when multiple types of MCUs exist, corresponding firmware needs to be burned respectively, and burning errors and burning omission are easy to occur; the number of the communication equipment service board cards and the fan control boards is large, and a large amount of labor cost is increased by manually burning firmware.
The invention adopts the following technical scheme:
in a first aspect, the invention provides an electromechanical management MCU firmware burning method, which is used for burning other board card slave node MCU firmware through a master control MCU by utilizing a CAN bus interconnected among electromechanical MCUs, and comprises the following steps:
the starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; the slave node MCU is set as a slave system memory to start, and a BootLoader carried by the slave node MCU is operated;
the master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and resets the slave node MCU to enable the slave node MCU to enter the Bootloader of the slave node MCU to run so as to burn or update the firmware.
Preferably, the slave node MCU firmware of each type of single disk is stored in the system of the CPU of the master disk, and before the firmware burning or updating, the method further includes:
when the main control device is powered on, the main control CPU transmits the firmware of various single disks to the main control MCU, and the main control MCU caches the firmware in the extension SPIFlash so as to burn or update the firmware.
Preferably, the burning or updating of the firmware specifically includes:
the master control MCU issues commands and firmware packages to the slave node MCU through the CAN bus to carry out firmware burning;
and after the burning is finished, a program jump instruction is issued through a CAN bus, so that the slave node MCU jumps to a user firmware code area for operation.
Preferably, the master control MCU issues commands and firmware packages to the slave node MCU through the CAN bus to perform firmware burning, and the method specifically includes:
the main control MCU sends a skip instruction to the slave node MCU in a type of single disk for multiple times through the CAN bus, and tries to skip the type of single disk to a user code area for execution;
after the preset time delay, the master control checks whether the MCU program of the slave node of the single disk is burnt or not in a mode of inquiring the version number of the slave node program;
if the inquiry has a response, the program is indicated to be burnt and is further compared with the current firmware version, and if the program is the same as the current firmware version, the current single-disk program of the program is the latest; if the difference is not the same, the firmware needs to be upgraded, and the firmware is updated; if the single disc is not responded, the program is not recorded in the single disc, and firmware burning is needed.
Preferably, the updating or burning the firmware specifically includes:
controlling the single-disk electromechanical MCU to reenter the BootLoader by controlling the RST pin of the slave node MCU of the single disk to be upgraded;
and sending the burning file to a corresponding single disk for firmware burning or firmware updating through a communication protocol of the slave node MCU with a BootLoader.
Preferably, the starting mode of the main control MCU is kept as starting from a user code area, and a user code is operated; the slave node MCU is set to be started from the system memory, and the method before the BootLoader carried by the slave node MCU is operated comprises the following steps:
the MCU maintains the current situation, and burns user firmware to FLASH after leaving a factory;
and default to pull up BOOT0 and pull down BOOT1 of the slave node MCU on the service board card and the fan control board so as to start the slave System memory, run the Bootloader with the slave node MCU in the office to receive the command and the firmware file of the master control MCU and burn the firmware.
Preferably, the method further comprises:
transmitting the on-site signals of the single disks to a master control MCU through a plurality of single-end n-channel multi-way switches for detecting the on-site state of each single disk; when a single disk is changed from the non-in-place state to the in-place state, triggering a detection action of firmware burning and upgrading once; and realizing real-time firmware burning or updating of the newly inserted single disk.
Preferably, the bit signal line is connected in a wired-and mode, a pull-up resistor is used at the end of the master control panel to pull the bit signal line high, and a pull-down resistor is used at one end of the slave node single panel to pull the bit signal line low;
when the slave node single disc is not inserted into the frame, the master control disc detects that the corresponding on-position signal pin is at a high level, if the single disc is inserted into the frame, one position of the on-position signal line is pulled down to be at a low level due to the wired-and, at this time, the master control disc detects that the on-position signal pin of the single disc is at a low level, and judges that the on-position signal pin is at a position.
Preferably, when the single disk to which the slave node MCU belongs includes three types, namely a fan disk, a service disk and a power disk, the firmware version of the MCU of the single disk of the slave node is checked repeatedly every preset time to determine whether firmware update is required.
In a second aspect, the present invention provides an electromechanical management MCU firmware burning system, which includes a system composed of a master control MCU and multiple single-disk slave node MCUs, wherein the slave node MCUs of each single disk type and the slave node MCUs and the master control MCU are connected through CAN buses, specifically:
the starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; the slave node MCU is set as a slave system memory to be started, and a BootLoader of the slave node MCU is operated;
the master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and resets the slave node MCU to enable the slave node MCU to enter the Bootloader of the slave node MCU to run so as to burn or update the firmware.
In a third aspect, the present invention further provides an electromechanical management MCU firmware burning device, configured to implement the electromechanical management MCU firmware burning method described in the first aspect, where the device includes:
at least one processor; and a memory communicatively coupled to the at least one processor; the storage stores instructions executable by the at least one processor, and the instructions are executed by the processor and used for executing the electromechanical management MCU firmware burning method of the first aspect.
In a fourth aspect, the present invention further provides a non-volatile computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, so as to complete the method for burning the MCU firmware in the electromechanical management system according to the first aspect.
Compared with the method for realizing firmware burning by using Jtag and SWD interfaces, the method saves IO pins and wiring by using the CAN bus, and does not increase extra cost. According to the invention, the BootLoader entering the MCU is started by default from the System Memory, and the firmware can be updated at any time by controlling the RST pin of the slave node, so that the possibility of 'brick forming' of the MCU is avoided.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below. It is obvious that the drawings described below are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a prior art bus architecture provided by embodiments of the present invention;
FIG. 2 is a schematic diagram of an architecture of an electromechanical management MCU firmware burning system according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for burning firmware of an electromechanical management MCU according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for burning firmware of an electromechanical management MCU according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a method for burning firmware of an electromechanical management MCU according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a method for burning firmware of an electromechanical management MCU according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a connection of hardware in-place signal lines according to an embodiment of the present invention;
fig. 8 is a service flow diagram of an MCU of a main control disk according to an embodiment of the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
In the description of the present invention, the terms "inner", "outer", "longitudinal", "lateral", "upper", "lower", "top", "bottom", and the like indicate orientations or positional relationships based on orientations or positional relationships shown in the drawings, and are for convenience in describing the present invention only and do not require that the present invention be constructed and operated in a particular orientation, and therefore should not be construed as limiting the present invention.
According to the invention, by utilizing a CAN bus interconnected among the electromechanical MCUs, the MCU firmware of other board card slave nodes is burnt through a master control MCU; when leaving a factory, the communication equipment main control board card burns firmware of the electromechanical management MCU, and other board cards are used as slave node MCUs, so that a blank chip is kept and the firmware is not burnt; by modifying the hardware design, the starting mode of the master control MCU is kept to be started from the user code area, and the user code is operated; and the slave node MCU is started from the system memory instead, and the BootLoader of the slave node MCU is operated.
And storing the MCU firmware of the slave nodes of various single disks in a CPU system of a master control disk, wherein when the equipment is powered on, the master control CPU transmits the firmware of various single disks to the master control MCU, and the master control MCU caches the firmware in the externally expanded SPIFlash. The master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and can randomly reset the slave node MCU to enable the slave node MCU to enter Bootloader running for firmware burning. The master control MCU issues commands and firmware packages to the slave node MCU through the CAN bus to carry out firmware burning;
after the burning is finished, a program jump instruction is issued through the CAN bus, and the slave node MCU jumps to a user firmware code area to run. In a preferred implementation manner of the present invention, the on-site signal of each single disk may also be transmitted to the main control MCU through a plurality of single-ended 8-channel multi-way switches (CD 4051, etc.), so as to detect the on-site state of each single disk. When the single disk is changed from the non-in-place state to the in-place state, a detection action of firmware burning and upgrading is triggered. And realizing real-time firmware burning or updating of the newly inserted single disk.
In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1:
the embodiment 1 of the invention provides an electromechanical management MCU firmware burning method, as shown in fig. 2 and 3, the method comprises the following steps of burning other board card slave node MCU firmware through a master control MCU by utilizing a CAN bus interconnected between electromechanical MCUs:
in step 201, the starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; and the slave node MCU is set to be started from the system memory, and the BootLoader of the slave node MCU is operated.
It should be noted that, although the manufacturer BootLoader storage area of STM32 is called system memory, MCUs of other manufacturers are not necessarily called as such, the present invention is typically expressed by this, and even if MCUs of other manufacturers are called as inconsistent, the MCUs of other manufacturers should be considered to fall within the scope of the present invention as long as the technical core concept is consistent with the present invention.
In step 202, the master control MCU is connected to the NRST reset control pin of the slave node MCU through IO, and resets the slave node MCU to enter the Bootloader of the slave node MCU for firmware burning or updating.
Compared with the method for realizing firmware burning by using Jtag and SWD interfaces, the method for realizing firmware burning saves IO pins and wiring in a CAN bus mode, and does not increase extra cost. According to the invention, the BootLoader entering the MCU is started by default from the System Memory, and the firmware can be updated at any time by controlling the RST pin of the slave node, so that the possibility of 'brick forming' of the MCU is avoided.
In the embodiment of the invention, when the single disk to which the slave node MCU belongs comprises three types, namely a fan disk, a service disk and a power disk, the MCU firmware versions of the three types of slave node single disks are checked repeatedly at preset time intervals to confirm whether firmware updating is needed.
Compared with the prior mode of pre-burning the firmware when leaving the factory, the method omits a process, saves the labor cost, and avoids the problem of yield reduction caused by possible errors of the process, such as missed burning and wrong firmware burning. Compared with the prior art that an upgrading task is specially realized or a BootLoader is customized in order to realize online upgrading, development of a key function is omitted, research and development cost is saved, and research and development period is shortened. The possibility of errors is reduced.
In a specific implementation manner of the embodiment of the present invention, the slave node MCU firmware of each single disk is stored in the system of the CPU of the master control disk, so before the firmware burning or updating, the method further includes:
in step 301, when the main control device is powered on, the main control CPU transmits the firmware of each single disk to the main control MCU, and the main control MCU buffers the firmware in the extended SPIFlash (in a specific implementation manner, the firmware may be other memories with capacities meeting the requirements), so as to burn or update the firmware.
In a specific implementation, the step 301 may be executed in parallel with the step 201 and/or the step 202, that is, executed synchronously with the step 201, or executed synchronously with the step 202, as long as it is ensured to be completed before "performing firmware burning or updating" in the specific execution step 202.
As for the main frame process, the firmware burning or updating in step 202 is specifically shown as follows, as shown in fig. 4:
in step 401, the master MCU issues commands and firmware packages to the slave node MCU through the CAN bus for firmware burning.
In step 402, after the burning is completed, a program jump instruction is issued through the CAN bus, so that the slave node MCU jumps to the user firmware code area to run.
As for the detailed method presentation of the step 401 in the specific application scenario, as shown in fig. 5, the master control MCU issues a command and a firmware package to the slave node MCU through the CAN bus to perform firmware burning, which specifically includes:
in step 501, the master MCU sends a jump instruction to the slave MCU in a single disk via the CAN bus for multiple times, and tries to jump the single disk to the user code area for execution.
In step 502, after a preset delay, the master checks whether the MCU program of the slave node of the single disk is burned by querying the version number of the slave node program.
In step 503, if the query is answered, indicating that it has been burned, it is further compared with the current firmware version. If the program is the same as the single-disk program, the current single-disk program of the program is the latest; if the difference is positive, the firmware needs to be upgraded, and the firmware is updated; if the single disc is not responded, the program is not recorded in the single disc, and firmware burning is needed.
If the above steps 401 to 402 are the process presented from the main frame level, the following contents are the details presented from the detail level for firmware update or firmware burning, as shown in fig. 6, which specifically includes:
in step 601, the single-disk electromechanical MCU is controlled to reenter the BootLoader by controlling the RST pin of the slave node MCU of the single-disk type that needs to be upgraded.
In step 602, the slave node MCU sends the burning file to a corresponding single disk for firmware burning or firmware updating through a communication protocol of the slave node MCU with BootLoader.
It should be noted that, in this step, only the electromechanical management MCU is controlled to reset, the power-down restart of the entire single disk is not controlled, and the reset of the electromechanical MCU does not affect other service functions of the single disk
With the embodiment of the invention, the starting mode of the main control MCU is kept to be started from the user code area, and the user code is operated; the slave node MCU is set to be started from the system memory, and the method before the BootLoader carried by the slave node MCU is operated comprises the following steps:
the MCU of the main control panel maintains the current situation, and the user firmware is burnt to FLASH when leaving the factory;
and default to pull up BOOT0 and pull down BOOT1 of the slave node MCU on the service board card and the fan control board so as to start the slave System memory, run the Bootloader with the slave node MCU in the office to receive the command and the firmware file of the master control MCU and burn the firmware.
As shown in fig. 7, in order to achieve the improvement of the present invention, which is more automatic, only a schematic diagram of a core part is shown in fig. 7, and other specific hardware schematic designs are not shown. The method mainly uses a multiplexer to connect the single disk on-site signal line to a main control disk, and the main control disk respectively reads the on-site information of each single disk through channel switching. When the single disc is inserted into the frame, the pins of the connector are connected and contacted, the single disc is communicated with the master control disc at the slave node side in place, the signal wire is pulled down due to the fact that the slave node side is pulled down, and the master control disc can judge whether the single disc is in place or not by judging whether the signal wire level is low or not. Thus, the method further comprises:
transmitting the on-site signals of the single disks to a main control MCU through a plurality of single-end n-channel multi-way switches (such as CD4051 which is an 8-channel multi-way switch) for detecting the on-site states of the single disks; when a single disk is changed from the non-in-place state to the in-place state, triggering a detection action of firmware burning and upgrading once; and realizing real-time firmware burning or updating of the newly inserted single disk.
The on-site signal line is connected in a wired-and mode, a pull-up resistor is used for pulling the on-site signal line high at the end of the master control panel, and a pull-down resistor is used for pulling the on-site signal line low at one end of the slave node single panel;
when the slave node single disc is not inserted into the frame, the master control disc detects that the corresponding on-position signal pin is at a high level, if the single disc is inserted into the frame, one position of the on-position signal line is pulled down to be at a low level due to the wired-and, at this time, the master control disc detects that the on-position signal pin of the single disc is at a low level, and judges that the on-position signal pin is at a position.
Example 2:
the invention also provides an electromechanical management MCU firmware burning system, as shown in FIG. 2, which is a system architecture diagram exemplarily provided by the invention, wherein various single disks are schematically connected with a CAN bus, SPIFlash and BOOT0/BOOT1 configuration, and details irrelevant to the scheme are not drawn; the figure shows the outline of system hardware connection, and the system mainly comprises a master control CPU, a master control MCU, a power panel MCU, a fan panel MCU and a service panel MCU, wherein the number of the power panel, the fan panel and the service panel MCU can be multiple. The master control CPU is interconnected with the master control MCU through an SPI bus, and the MCUs are interconnected through a CAN bus. In addition, the main control MCU is externally provided with a SPIflash memory or other memories for caching various single-disk firmware sent from the CPU. The main control MCU controls the start of the user program area by configuring BOOT0/BOOT 1; and the MCUs of other fans, power supplies and service disks are configured with BOOT0/BOOT1, so that the MCU is started from the System memory and runs a Bootloader of the MCU of the slave node. 3 IO lines are added to the master control panel MCU and are respectively connected with NRST reset control pins of the electromechanical MCU of the service panel, the fan panel and the power panel, so that the master control MCU can independently control the slave node MCU of a certain type of single panel to reset; the 3 lines are also pulled up to high level by default, and when one type of single disk needs to be reset, the reset pin of the single disk is pulled down.
The electromechanical management MCU firmware burning system in the embodiment of the invention comprises a system consisting of a master control MCU and slave node MCUs of various single-disk types, wherein the slave node MCUs of the single disks of various types and the slave node MCUs are connected with the master control MCU through CAN buses, and specifically:
the starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; the slave node MCU is set as a slave system memory to be started, and a BootLoader of the slave node MCU is operated;
the master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and resets the slave node MCU to enable the slave node MCU to enter the Bootloader of the slave node MCU to run so as to burn or update the firmware.
The embodiment of the invention eliminates the process of factory burning of the power panel, the service panel and the fan panel without changing the existing framework and basically increasing the hardware design and material cost, the production capacity of the single panels is the maximum, and a large amount of labor cost is saved in the long run. BootLoaders provided by MCU officials are fully utilized, and the same set of business process is used, so that factory burning of the firmware and online upgrading of the firmware are realized. By circularly inquiring and updating the MCU firmware, the MCU is always kept as the latest firmware; and the MCU version is periodically inquired, the MCU is confirmed to be in an active state, and the MCU is ensured to never crash.
Example 2:
burning other board card slave node MCU firmware through a master control MCU by utilizing a CAN bus interconnected among the electromechanical MCUs;
when leaving the factory, the communication equipment main control board card burns firmware of the electromechanical management MCU, and other board cards are used as slave node MCUs, so that a blank chip is kept and the firmware is not burnt;
by modifying the hardware design, the starting mode of the main control MCU is kept to be started from the user code area, and the user code is operated; and the slave node MCU is started from the system memory instead, and the BootLoader of the slave node MCU is operated.
And storing the firmware of the slave node MCU of each single disk in a CPU system of a main control disk, wherein when the equipment is powered on, the main control CPU transmits the firmware of each single disk to the main control MCU, and the main control MCU caches the firmware in the extension SPIFlash.
The main control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and can reset the slave node MCU at any time to enable the slave node MCU to enter the Bootloader operation of the main control MCU so as to burn the firmware.
The master control MCU issues commands and firmware packages to the slave node MCU through the CAN bus to carry out firmware burning;
and after the burning is finished, a program jump instruction is issued through a CAN bus, so that the slave node MCU jumps to a user firmware code area for operation.
And transmitting the on-site signals of the single disks to a main control MCU through a plurality of single-end 8-channel multi-way switches (CD 4051 and the like) for detecting the on-site state of each single disk. When the single disk is changed from the on-position state to the on-position state, the detection action of firmware burning and upgrading is triggered once. And realizing real-time firmware burning or updating of the newly inserted single disk.
Compared with the method for realizing firmware burning by using Jtag and SWD interfaces, the method for realizing firmware burning saves IO pins and wiring in a CAN bus mode, and does not increase extra cost. According to the invention, the BootLoader entering the MCU is started by default from the System Memory, and the firmware can be updated at any time by controlling the RST pin of the slave node, so that the possibility of 'brick forming' of the MCU is avoided.
With the embodiment of the present invention, there is a preferred implementation manner that the slave node MCU firmware of each single disk is stored in the system of the CPU of the master disk, and before the firmware burning or updating, the method further includes:
when the main control equipment is powered on, the main control CPU transmits the firmware of various single disks to the main control MCU, and the main control MCU caches the firmware in the external extension SPIFlash so as to burn or update the firmware.
With reference to the embodiment of the present invention, there is a preferred implementation manner, where the performing firmware burning or updating specifically includes:
the master control MCU issues a command and a firmware package to the slave node MCU through the CAN bus to carry out firmware burning;
after the burning is finished, a program jump instruction is issued through the CAN bus, and the slave node MCU jumps to a user firmware code area to run.
With reference to the embodiments of the present invention, there is a preferred implementation manner in which the master MCU issues commands and firmware packages to the slave node MCU through the CAN bus to perform firmware burning, which specifically includes:
the main control MCU sends a jump instruction to the slave node MCU in a single disc through the CAN bus for multiple times, and tries to jump the single disc to a user code area for execution;
after the preset time delay, the master control checks whether the MCU program of the slave node of the single disk is burnt or not in a mode of inquiring the version number of the slave node program;
if the inquiry has a response, the program is recorded, and is further compared with the current firmware version, and if the program is the same as the current firmware version, the current single-disk program is the latest; if the difference is positive, the firmware needs to be upgraded, and the firmware is updated; if the single disc is not responded, the program is not recorded in the single disc, and firmware burning is needed.
With reference to the embodiment of the present invention, there is a preferred implementation manner, where the performing firmware update or firmware burning specifically includes:
controlling the single-disk electromechanical MCU to reenter the BootLoader by controlling the RST pin of the slave node MCU of the single disk to be upgraded;
and sending the burning file to a corresponding single disk for firmware burning or firmware updating through a communication protocol of the slave node MCU with a BootLoader.
With the embodiment of the present invention, there is a preferred implementation manner, where the start manner of the main control MCU is maintained as starting from the user code area, and running the user code; the slave node MCU is set to be started from the system memory, and the method before the BootLoader carried by the slave node MCU is operated comprises the following steps:
the MCU maintains the current situation, and burns user firmware to FLASH after leaving a factory;
by default, BOOT0 and BOOT1 of the slave node MCU on the service board card and the fan control board are pulled up and pulled down so as to be started from the System memory, and bootloaders with own authorities of the slave node MCU are operated to receive commands and firmware files of the master control MCU and burn the firmware. The configuration may use STM32, and other chip models may be different, so that those skilled in the art can make appropriate adjustments according to the content of the presently disclosed solution and in combination with specific chip scenarios, and derivative patents generated thereby are all within the scope of the present invention.
In combination with the embodiment of the present invention, there is a preferred implementation manner, and the method further includes:
transmitting the on-site signals of the single disks to a master control MCU through a plurality of single-end n-channel multi-way switches for detecting the on-site state of each single disk; when a single disk is changed from the non-in-place state to the in-place state, triggering a detection action of firmware burning and upgrading once; and realizing real-time firmware burning or updating of the newly inserted single disk.
In combination with the embodiment of the present invention, there is a preferred implementation manner, where the in-place signal line is connected in a "wired-and" manner, a pull-up resistor is used at the end of the master control pad to pull it high, and a pull-down resistor is used at one end of the single slave node pad to pull it low;
when the slave node single disc is not inserted into the frame, the master control disc detects that the corresponding on-site signal pin is at a high level, if the single disc is inserted into the frame, one of the on-site signal lines is pulled down to be at a low level due to the wired-AND, and at this time, the master control disc detects that the on-site signal pin of the single disc is at a low level and judges that the on-site signal pin is on site.
With reference to the embodiment of the present invention, there is a preferred implementation manner, when a single disk to which a slave node MCU belongs includes three types, i.e., a fan disk, a service disk, and a power disk, the firmware versions of the MCUs of the three types of slave node single disks are checked repeatedly at preset intervals to determine whether firmware update is required.
Example 3:
the embodiment of the present invention is based on the embodiment 1 and the embodiment 2, and a relatively complete logic process is shown in the technical solution of the present invention from a relatively complete example scenario, with reference to the flowchart shown in fig. 8, and the method includes:
in step 701, in terms of hardware design, the MCU maintains the current status, and burns the user firmware to the FLASH.
In step 702, by default, BOOT0 and BOOT1 of the electromechanical MCU on the service board card and the fan control board are pulled up and down, that is, the System memory is started, and BOOT loader of the MCU is operated to receive commands and firmware files from the main control MCU and burn the firmware.
In step 703, the firmware of each type of single disk is saved in the file system of the Linux system of the CPU in the form of a file.
In step 704, after the device is started, the CPU sends the firmware of each type of single disk to the main control electromechanical MCU through the SPI, and the main control MCU buffers the firmware in the externally extended SPIFlash memory.
In step 705, the master MCU sends a jump command to a type of single disk via the CAN bus multiple times, trying to jump the type of single disk to a user code area for execution.
In step 706, after a certain delay, the master checks whether the electromechanical MCU program of the single disk is burned or not by querying the slave node program version number.
In step 707, if the query is responded, it indicates that the program has been burned and further compared with the current firmware version, and if the program is the same as the current firmware version, it indicates that the current single-disc program of the program is the latest; if not, the firmware needs to be upgraded, and step 709 is entered.
In step 708, if the single-disc is not queried and there is no response, it indicates that the program is not recorded on the single-disc and firmware needs to be recorded, and then step 709 is entered.
If the user area code is not burnt, after receiving a jump instruction, the Bootloader of the MCU jumps to an abnormal instruction area, the MCU inevitably flies, and after sending a query command, the host node inevitably cannot receive the reply of the MCU, so that the situation that the firmware is not burnt on the single disk or the firmware is abnormal and cannot run can be judged, and the situations are that the firmware needs to be burnt again.
In step 709, controlling the single-disk electromechanical MCU to re-enter the BootLoader by controlling the RST pin of the single-disk MCU to be upgraded, and then sending the burning file to the corresponding single disk to burn the firmware through the communication protocol of the MCU with the BootLoader; it should be noted that, in this step, only the electromechanical management MCU is controlled to reset, and the power-down restart of the entire single disk is not controlled, and the reset of the electromechanical MCU does not affect other service functions of the single disk.
In step 710, after the firmware is burned, a jump instruction is sent to make the MCU of the single disk leave the BootLoader and enter the user code area for operation.
In step 711, repeating steps 704-710 for the fan tray, the service tray, and the power tray; and repeatedly checking the three types of slave nodes and the single disk at regular intervals.
In step 712, in order to avoid continuous retry caused by that a certain single disk cannot be burned with firmware, the single disk is continuously burned again, the master control MCU is required to record the retry number, if the certain single disk retries for more than 5 times, and the firmware cannot be burned for all the single disk electromechanical MCUs, the retry is stopped, and an alarm message is given to notify that the single disk with the problem exists that the MCU firmware cannot be burned.
In an actual scenario, the number is not necessarily 5, and may be any value greater than 5 and less than 1000.
In step 713, in addition to the timed query of the version number for upgrading, when it is detected that a single disk never changes its place to a bit, a version query is also performed to check whether a firmware update is required.
The dashed box steps marked in fig. 8 indicate the meaning that it is possible that the BootLoader of the MCU may not necessarily support in the actual implementation process, and whether it exists or not is the case.
The method for detecting the in-place state of the single disc comprises the following steps:
the in-place state of the slave node is transmitted to the master control panel by using a plurality of single-ended 8-channel multi-way switches (CD 4051 and the like), and the specific implementation mode is shown in FIG. 2.
The bit signal line is connected in a wired-and mode, a pull-up resistor is used for pulling the bit signal line high at the end of the master control panel, and a pull-down resistor is used for pulling the bit signal line low at one end of the slave node single panel.
When the slave node single disc is not inserted into the frame, the master control disc detects that the corresponding on-position signal pin is at a high level, if the single disc is inserted into the frame, one position of the on-position signal line is pulled down to be at a low level due to the wired-and, at this time, the master control disc detects that the on-position signal pin of the single disc is at a low level, and the on-position of the single disc can be judged.
Due to the limited number of pins of the master MCU, the slave nodes may be several tens to hundreds at most. Therefore, each slave node cannot be assigned an independent IO for in-place detection. In order to solve the problem, a plurality of single-end 8-channel multi-way switches are used, in-place signals of the slave node single disks are respectively sent to the master control disk in a channel switching mode, and when the master control disk needs to inquire the in-place state of a certain single disk, the channels are firstly switched to in-place information lines of the corresponding single disks.
It should be noted that, because the contents of information interaction, execution process, and the like between modules and units in the apparatus and the system are based on the same concept as the processing method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
Those of ordinary skill in the art will appreciate that all or part of the steps of the various methods of the embodiments may be performed by associated hardware as instructed by a program, which may be stored on a computer-readable storage medium, which may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
The above description is intended to be illustrative of the preferred embodiment of the present invention and should not be taken as limiting the invention, but rather, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.

Claims (10)

1. A burning method for firmware of an MCU (microprogrammed control Unit) in electromechanical management is characterized in that the MCU is burned through a master control MCU by utilizing a CAN (controller area network) bus interconnected among electromechanical MCUs, and the method comprises the following steps:
the starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; the slave node MCU is set as a slave system memory to be started, and a BootLoader of the slave node MCU is operated;
the master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and resets the slave node MCU to enable the slave node MCU to enter the Bootloader of the slave node MCU to run so as to burn or update the firmware.
2. The method for burning firmware of an electromechanical management MCU of claim 1, wherein the firmware of the MCU of the slave nodes of each type of single disk is stored in a system of a CPU of a master disk, and before burning or updating the firmware, the method further comprises:
when the main control device is powered on, the main control CPU transmits the firmware of various single disks to the main control MCU, and the main control MCU caches the firmware in the extension SPIFlash so as to burn or update the firmware.
3. The method for burning firmware of an electromechanical management MCU according to claim 1, wherein the burning or updating firmware specifically comprises:
the master control MCU issues commands and firmware packages to the slave node MCU through the CAN bus to carry out firmware burning;
after the burning is finished, a program jump instruction is issued through the CAN bus, and the slave node MCU jumps to a user firmware code area to run.
4. The method for firmware burning of an electromechanical management MCU according to claim 3, wherein the master control MCU issues commands and firmware packages to the slave node MCU through the CAN bus for firmware burning, specifically comprising:
the main control MCU sends a skip instruction to the slave node MCU in a type of single disk for multiple times through the CAN bus, and tries to skip the type of single disk to a user code area for execution;
after the preset time delay, the master control checks whether the MCU program of the slave node of the single disk is burned or not in a mode of inquiring the version number of the slave node program;
if the inquiry has a response, the program is recorded, and is further compared with the current firmware version, and if the program is the same as the current firmware version, the current single-disk program of the program is the latest; if the difference is positive, the firmware needs to be upgraded, and the firmware is updated; if the single disc is not responded by inquiry, the program is not recorded in the single disc, and firmware burning is needed.
5. The method for firmware burning of an electromechanical management MCU according to claim 4, wherein the firmware updating or firmware burning specifically comprises:
controlling a single-disk electromechanical MCU to reenter a BootLoader by controlling an RST pin of a slave node MCU of the single disk to be upgraded;
and sending the burning file to a corresponding single disk for firmware burning or firmware updating through a communication protocol of the slave node MCU with a BootLoader.
6. The electromechanical management MCU firmware burning method according to claim 1, wherein a starting manner of the master control MCU is kept as starting from a user code area, running a user code; the slave node MCU is set to be started from the system memory, and the method before the BootLoader carried by the slave node MCU is operated comprises the following steps:
the MCU of the main control panel maintains the current situation, and the user firmware is burnt to FLASH when leaving the factory;
and default to pull up BOOT0 and pull down BOOT1 of the slave node MCU on the service board card and the fan control board so as to start the slave System memory, run the Bootloader with the slave node MCU in the office to receive the command and the firmware file of the master control MCU and burn the firmware.
7. The electromechanical management MCU firmware burning method of any one of claims 1-6, characterized in that the method further comprises:
transmitting the in-place signals of the single disks to a main control MCU through a plurality of single-end n-channel multi-way switches for detecting the in-place states of the single disks; when a single disk is changed from the on-position state to the on-position state, triggering a detection action of firmware burning and upgrading; and realizing real-time firmware burning or updating of the newly inserted single disk.
8. The method of claim 7, wherein the on-site signal line is connected by wired-and, the master control board is pulled high by a pull-up resistor, and the slave node is pulled low by a pull-down resistor;
when the slave node single disc is not inserted into the frame, the master control disc detects that the corresponding on-site signal pin is at a high level, if the single disc is inserted into the frame, one of the on-site signal lines is pulled down to be at a low level due to the wired-AND, and at this time, the master control disc detects that the on-site signal pin of the single disc is at a low level and judges that the on-site signal pin is on site.
9. The mechanical electrical management MCU firmware burning method of any one of claims 1-6,
when the single disc to which the slave node MCU belongs comprises three types, namely a fan disc, a service disc and a power disc, the MCU firmware versions of the three types of slave node single discs are checked repeatedly at preset time intervals to confirm whether firmware updating is needed or not.
10. The utility model provides an electromechanical management MCU firmware burns record system which characterized in that, includes the system that comprises the slave node MCU of a master control MCU and multiple single-disk type, wherein, between the slave node MCU of each type single-disk to and through CAN bus connection, it is specific between each slave node MCU and the master control MCU:
the starting mode of the main control MCU is kept as starting from the user code area, and the user code is operated; the slave node MCU is set as a slave system memory to start, and a BootLoader carried by the slave node MCU is operated;
the master control MCU is connected with an NRST reset control pin of the slave node MCU through IO, and resets the slave node MCU to enable the slave node MCU to enter the Bootloader of the slave node MCU to run so as to burn or update the firmware.
CN202211008551.3A 2022-08-22 2022-08-22 Electromechanical management MCU firmware burning method and system Pending CN115328505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211008551.3A CN115328505A (en) 2022-08-22 2022-08-22 Electromechanical management MCU firmware burning method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211008551.3A CN115328505A (en) 2022-08-22 2022-08-22 Electromechanical management MCU firmware burning method and system

Publications (1)

Publication Number Publication Date
CN115328505A true CN115328505A (en) 2022-11-11

Family

ID=83925259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211008551.3A Pending CN115328505A (en) 2022-08-22 2022-08-22 Electromechanical management MCU firmware burning method and system

Country Status (1)

Country Link
CN (1) CN115328505A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573147A (en) * 2023-10-27 2024-02-20 福氏新能源技术(上海)有限公司 MCU (micro control Unit) burning control method based on backboard bus control

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117573147A (en) * 2023-10-27 2024-02-20 福氏新能源技术(上海)有限公司 MCU (micro control Unit) burning control method based on backboard bus control

Similar Documents

Publication Publication Date Title
CN102609286B (en) A kind of FPGA configurator remote update system based on processor control and method thereof
CN103793238A (en) Rack and method for simultaneously updating multiple basic input output systems thereof
CN115328505A (en) Electromechanical management MCU firmware burning method and system
CN103365688A (en) Method for automatic installation and synchronization of software between Android intelligent devices
CN102081568A (en) Multi-motherboard server system
EP2664988B1 (en) Method, device and system for installing terminal software
CN111176665A (en) Method and device for manufacturing high-capacity emmc mirror image
CN101667133B (en) Method for updating firmware and chip updating firmware by using same
CN102043636A (en) Method and device for loading field programmable gate array bit file
KR102554978B1 (en) Communication device, communication method, program, and communication system
JP2007310719A (en) Unit type programmable controller
CN102474195B (en) inverter system and inverter
CN102841634A (en) Server mainboard
CN209928235U (en) External equipment and system for refrigerator
JP2000293485A (en) Communication interface
EP1022697B1 (en) Control apparatus for vending machine
CN113342385A (en) Software upgrading method and device and air conditioner control panel
CN112306536B (en) Main board, chip thereof and chip upgrading method
KR101261022B1 (en) Apparatus of data processing and method of setting program data thereof
CN102053847A (en) Server and updating method thereof
CN103747034A (en) Terminal state-machine state conversion method and device
CN114594970A (en) DSP software remote upgrading system and method
CN111414322B (en) Method, system, equipment and storage medium for adapting Nand flash interface working protocol
KR101304817B1 (en) Keypad apparatus having parameter copy function by recognizing software versions and inverter types
CN112994902A (en) Intelligent network card and FPGA (field programmable Gate array) firmware updating management method of intelligent network card

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination