CN111752589A - Method and device for upgrading burning codes of microcontroller on line - Google Patents

Method and device for upgrading burning codes of microcontroller on line Download PDF

Info

Publication number
CN111752589A
CN111752589A CN202010595988.6A CN202010595988A CN111752589A CN 111752589 A CN111752589 A CN 111752589A CN 202010595988 A CN202010595988 A CN 202010595988A CN 111752589 A CN111752589 A CN 111752589A
Authority
CN
China
Prior art keywords
microcontroller
reading
flash
address
burning
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
CN202010595988.6A
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.)
Yanxiang Smart Iot Technology Co ltd
Original Assignee
EVOC Intelligent Technology 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 EVOC Intelligent Technology Co Ltd filed Critical EVOC Intelligent Technology Co Ltd
Priority to CN202010595988.6A priority Critical patent/CN111752589A/en
Publication of CN111752589A publication Critical patent/CN111752589A/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/65Updates
    • G06F8/656Updates while running
    • 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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for upgrading microcontroller burning codes on line, wherein the method comprises the following steps: sending a reset signal to a microcontroller to cause the microcontroller to enter an ISP zone and run an ISP boot loader, wherein the microcontroller supports an online system programming function; reading a currently running burning code in a FLASH of the microcontroller based on an SMBUS protocol; and comparing the new burning code with the burning code currently running in the FLASH of the microcontroller, and transmitting the new burning code to the microcontroller based on the SMBUS protocol when the new burning code is inconsistent with the burning code currently running in the FLASH of the microcontroller so that the microcontroller receives the new burning code on line and loads the new burning code to the FLASH. The invention can realize the on-line upgrade of the microcontroller without disassembling the machine, and is convenient for engineering maintenance.

Description

Method and device for upgrading burning codes of microcontroller on line
Technical Field
The invention relates to the technical field of chip online upgrading, in particular to a method and a device for online upgrading microcontroller burning codes.
Background
The control chip of the industrial personal computer mainboard is generally realized by a Microcontroller (MCU), the MCU can be a series of microcontrollers such as M054, after the burning codes of M054 are pre-burned, if the burning codes of M054 need to be upgraded, offline upgrading is often adopted, namely, a special burner is used for upgrading, as shown in figure 1, the burner is connected with a PC end through a USB data line, M054 is connected with the burner through a JTAG interface and following a JTAG protocol, and then the burning codes are upgraded by an application program of the PC end. The upgrading mode needs a special burner to upgrade, and the whole machine state needs to be disassembled, so that the engineering maintenance is inconvenient.
Disclosure of Invention
In order to solve the problems, the invention provides a method and a device for upgrading the burning codes of the microcontroller on line, which can realize the on-line upgrading of the microcontroller without disassembling the machine and is convenient for engineering maintenance.
In a first aspect, the present invention provides a method for upgrading a microcontroller burning code online, where the method includes:
sending a reset signal to a microcontroller to cause the microcontroller to enter an ISP zone and run an ISP boot loader, wherein the microcontroller supports online system programming functions;
reading a currently running burning code in a FLASH of the microcontroller based on an SMBUS protocol;
and comparing the new burning code with the burning code currently running in the FLASH of the microcontroller, and transmitting the new burning code to the microcontroller based on an SMBUS protocol when the new burning code is inconsistent with the burning code currently running in the FLASH of the microcontroller, so that the microcontroller receives the new burning code on line and loads the new burning code to the FLASH.
Optionally, the reading of the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol includes:
2-1) setting the read address as the initial address of FLASH;
2-2) sending a first interactive command for reading FLASH, wherein the first interactive command comprises the reading address;
2-3) if the reading is successful, storing the read data;
2-4) judging whether the reading address is finished or not, if not, adding 16 to the current reading address to obtain a new reading address, and returning to the step 2-2);
2-5) repeating 2-2) -2-4) until the reading address is finished.
Optionally, the transmitting the new burning code to the microcontroller based on the SMBUS protocol includes:
3-1) judging whether the data length of the new burning code meets the size requirement of FLASH;
3-2) if the address meets the requirement, setting the write address as the initial address of the FLASH;
3-3) acquiring 4 bytes of data from the new burning code;
3-4) sending a second interactive command for writing FLASH, wherein the second interactive command comprises the write address and 4 bytes of data;
3-5) if the writing is successful, judging whether the reading of the new burning code is finished, if the reading is not finished, adding 4 to the current writing address to obtain a new writing address, and returning to the step 3-3);
3-6) repeatedly executing 3-3) -3-5) until all new burning codes are read.
Optionally, before the step of reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol, the method further includes:
detecting whether the microcontroller operates in an ISP zone;
if so, sending an instruction to enable the microcontroller to stay in an ISP mode so as to execute the subsequent step of reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol, and otherwise, sending a reset signal to the microcontroller again.
In a second aspect, the present invention provides an apparatus for upgrading burning codes of a microcontroller online, the apparatus comprising:
the system comprises a reset module, a microprocessor and a microprocessor, wherein the reset module is used for sending a reset signal to the microcontroller so that the microcontroller enters an ISP zone and runs an ISP boot loader, and the microcontroller supports an online system programming function;
the reading module is used for reading the currently running burning codes in the FLASH of the microcontroller based on an SMBUS protocol;
the comparison module is used for comparing the new burning codes with the burning codes currently running in the FLASH of the microcontroller;
and the writing module is used for transmitting the new burning code to the microcontroller based on an SMBUS protocol when the new burning code is inconsistent with the burning code currently running in the FLASH of the microcontroller, so that the microcontroller receives the new burning code on line and loads the new burning code to the FLASH.
Optionally, the reading module is specifically configured to:
2-1) setting the read address as the initial address of FLASH;
2-2) sending a first interactive command for reading FLASH, wherein the first interactive command comprises the reading address;
2-3) if the reading is successful, storing the read data;
2-4) judging whether the reading address is finished or not, if not, adding 16 to the current reading address to obtain a new reading address, and returning to the step 2-2);
2-5) repeating 2-2) -2-4) until the reading address is finished.
Optionally, the writing module is specifically configured to:
3-1) judging whether the data length of the new burning code meets the size requirement of FLASH;
3-2) if the address meets the requirement, setting the write address as the initial address of the FLASH;
3-3) acquiring 4 bytes of data from the new burning code;
3-4) sending a second interactive command for writing FLASH, wherein the second interactive command comprises the write address and 4 bytes of data;
3-5) if the writing is successful, judging whether the reading of the new burning code is finished, if the reading is not finished, adding 4 to the current writing address to obtain a new writing address, and returning to the step 3-3);
3-6) repeatedly executing 3-3) -3-5) until all new burning codes are read.
Optionally, the apparatus further comprises:
the detection module is used for detecting whether the microcontroller operates in an ISP area or not before the step of reading the burning code currently operating in the FLASH of the microcontroller based on the SMBUS protocol;
if so, sending an instruction to enable the microcontroller to continuously stay in an ISP mode so that the reading module executes the subsequent step of reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol, and otherwise, sending a reset signal to the microcontroller again.
In a third aspect, the present invention provides an industrial personal computer motherboard, including a microcontroller, further including: the system comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program to realize the method for upgrading the burning codes of the microcontroller on line.
In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the above method for upgrading microcontroller burning codes online.
According to the method and the device for upgrading the microcontroller burning codes on line, the processor and the microcontroller are directly communicated through the SMBUS, the microcontroller is upgraded on line through the processor, disassembly is not needed, and engineering maintenance is facilitated.
Drawings
FIG. 1 is a system diagram of a prior art microcontroller code upgrade;
FIG. 2 is a flowchart illustrating a method for upgrading a burning code of a microcontroller online according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating a method for upgrading burning codes of a microcontroller online according to another embodiment of the present invention;
FIG. 4 is a schematic flow chart of reading FLASH according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of writing FLASH according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an apparatus for upgrading burning codes of a microcontroller online according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an apparatus for upgrading burning codes of a microcontroller online according to another embodiment of the present invention;
fig. 8 is a schematic diagram of an industrial personal computer motherboard according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method for upgrading burning codes of a microcontroller on line, which is realized on the basis of a processor, wherein the processor is connected with the microcontroller through a System Management Bus (SMBUS), as shown in figure 2, the method comprises the following steps:
and S201, sending a reset signal to the microcontroller so that the microcontroller enters an ISP zone and runs an ISP boot loader, wherein the microcontroller supports the ISP function.
A microcontroller supporting an ISP (In-System programming) function is generally an application program that runs an application program storage area, and only after reset, an ISP boot loader In the ISP area is run. In this embodiment, the ISP area refers to an area storing an ISP boot loader. The ISP boot loader refers to a program which realizes ISP functions and is burnt in an ISP area of the microcontroller in advance. The processor first sends 0XEE to the SMBUS to select the microcontroller, with the microcontroller address of 0xEE, and then sends 0x55 to reset the APROM. And then, reading values of i2cStat and i2cRxSign, wherein i2cStat is a state value of the SMBUS controller, and judging whether the next operation is suitable according to the value, wherein the value is 0 or 1. And i2cRxSign is the state value of the SMBUS read signal and takes the value of 0 or 1. And judging whether the values of i2cStat and i2cRxSign are both 0, if so, setting updateSign to be 1, wherein the updateSign is a code updating state value and takes a value of 0 or 1. If not, wait for 0xEE to resend 0x55 to reset APROM. Only when updateSign is 1, the values of i2 cstate and i2cRxSign are read again; and judging whether the values of i2cStat and i2cRxSign are both 0, if so, successfully resetting, entering the next step, starting to execute the step of reading the currently running burning codes in the FLASH of the microcontroller based on the SMBUS protocol, and otherwise, finishing upgrading.
After S201 is executed, the process proceeds to step S204.
And S204, reading the currently running burning codes in the FLASH of the microcontroller based on the SMBUS protocol.
S205, comparing the new burning code with the burning code currently running in the FLASH of the microcontroller, and entering S206 when the new burning code and the burning code are inconsistent;
and S206, transmitting the new burning code to the microcontroller based on the SMBUS protocol so that the microcontroller receives the new burning code on line and loads the new burning code to the FLASH.
According to the above method embodiment, after the processor first sends a reset signal to the microcontroller to make the microcontroller enter the ISP area and run the ISP boot loader, and after sending the reset signal, as shown in fig. 3, the method further includes:
s202, detecting whether the microcontroller operates in an ISP area, if so, continuing to execute the step S203, otherwise, returning to the step S201;
and S203, sending an instruction to enable the microcontroller to stay in the ISP mode continuously.
After step S203 is executed, steps S204 to S206 are continuously executed.
As an implementation manner, M054 may be used as a microcontroller In this embodiment, and M054 is a microcontroller supporting an In-System programming (ISP) function. The M054 comprises three Flash areas, namely an application program storage space (APROM) of 16KB, an on-line system programming (ISP) space (LDROM) of 4KB, a Data FLASH of 4KB and a user configuration area (CONFIG) of 4 bytes. The LDROM (i.e., ISP area) of M054 pre-burns the ISP boot loader.
When the M054 works normally, the M054 runs in an APROM, when the burning code is upgraded, the M054 needs to be reset first, so that the M054 runs to an LDROM (namely an ISP area), then a CPU of the M054 executes an ISP boot loader stored in the LDROM (namely the ISP area), and receives a new burning code transmitted from a processor at an I/O port and carries out the burning action.
The processor and the M054 are connected by using an SMBUS (system management bus) protocol, and the processor and the M054 are communicated by adopting the SMBUS protocol, and the interaction process is approximately as follows:
when the processor reads data, a write request command is sent to the M054, an initial condition (initial bit and address) is sent, the M054 sends information to the processor, and the processor sends NACK after reading is finished;
when the processor writes data, after sending the M054 address, the processor sends a write bit again, the M054 responds to ACK, the processor sends a command code to the M054 again, the M054 responds to ACK again, the processor sends data, the ACK responds to each byte, and the transmission is finished after receiving the stop bit.
According to an embodiment of the present disclosure, step S204: reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol can be implemented according to the following flow, as shown in fig. 4, including:
s2041, setting the reading address as the starting address of the FLASH.
Taking M054 as an example, the APROM address space of M054 is 0x0000_0000 to 0x0000_3FFF, the LDROM address space is 0x0010_0000 to 0x0010_0FFF, the Data Flash address space is 0x0001_ F000 to 0x0001_ FFFF, and the CONFIG address is 0x0030_ 0000.
S2042, initializing data to be transmitted in a command format.
S2043, sending an ISP interaction command for reading FLSAH.
And S2044, judging whether the reading is successful, if so, executing the step S2045, and otherwise, quitting the reading of the FLASH.
S2045, saving the read data to a bin file.
And S2046, judging whether the reading of the address is finished, finishing the reading if the reading of the address is finished, or adding 16 to the reading address to obtain a new reading address, returning to the step S2042, and continuously reading the FLASH data until the reading of the address is finished.
According to an embodiment of the present disclosure, step S206: transmitting the new burning code to the microcontroller based on the SMBUS protocol may be implemented according to the following process, as shown in fig. 5, including:
s2061, judging whether the data length of the new burning code meets the size requirement of the FLASH. If yes, the step S2062 is continuously executed, otherwise, the flow of writing the FLASH is directly exited.
Taking M054 as an example, the APROM size of M054 is 16KB, the LDROM size is 4KB, the Data Flash size is 4KB, and the CONFIG size is 4 bytes. The data length of the written burning file cannot be larger than the size of FLASH. When the M054 runs in an LDROM, the LDROM cannot be written; while running on APROM, APROM cannot be written.
S2062, setting the writing address as the starting address of the FLASH.
S2063, reading 4 bytes of data from the new burning code.
S2064, initializing the transmission data according to the command format.
S2065, sending an interactive command for writing FLASH.
And S2066, judging whether the writing is successful, if so, entering the step S2067, and if not, exiting the FLASH writing process.
S2067, judging whether the reading of the new burning codes is finished, if so, finishing the writing of the FLASH, otherwise, adding 4 to the writing address to obtain a new writing address, returning to the step S2063, and continuing to read 4 bytes of data from the new burning codes until all the new burning codes are read.
And after all the new burning codes are sent to the microprocessor, sending a reset signal to the microprocessor again, resetting the microprocessor after receiving the reset signal, reloading a user configuration bit (CONFIG), then executing the new burning codes, and finishing the whole upgrading process.
The method for upgrading the burning codes of the microcontroller on line provided by the embodiment of the invention realizes data interaction between the processor and the microprocessor through the SMBUS, is simple and convenient to upgrade the codes, does not need to disassemble the machine and is convenient for engineering maintenance.
Another embodiment of the present invention provides an apparatus for upgrading a burning code of a microcontroller online, as shown in fig. 6, the apparatus includes:
a reset module 601 for sending a reset signal to the microcontroller to make the microcontroller enter an ISP zone and run an ISP boot loader, wherein the microcontroller supports an online system programming (ISP) function;
a reading module 603, configured to read a currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol;
a comparing module 604, configured to compare the new burning code with a burning code currently running in the FLASH of the microcontroller;
and a writing module 605, configured to transmit the new burning code to the microcontroller based on the SMBUS protocol when the new burning code is inconsistent with a currently running burning code in the FLASH of the microcontroller, so that the microcontroller receives the new burning code online and loads the new burning code to the FLASH.
Further, on the basis of the above device embodiment, the reading module 603 is specifically configured to:
2-1) setting the read address as the initial address of FLASH;
2-2) sending a first interactive command for reading FLASH, wherein the first interactive command comprises the reading address;
2-3) if the reading is successful, storing the read data;
2-4) judging whether the reading address is finished or not, if not, adding 16 to the current reading address to obtain a new reading address, and returning to the step 2-2);
2-5) repeating 2-2) -2-4) until the reading address is finished.
Further, on the basis of the above device embodiment, the writing module 605 is specifically configured to:
3-1) judging whether the data length of the new burning code meets the size requirement of FLASH;
3-2) if the address meets the requirement, setting the write address as the initial address of the FLASH;
3-3) acquiring 4 bytes of data from the new burning code;
3-4) sending a second interactive command for writing FLASH, wherein the second interactive command comprises the write address and 4 bytes of data;
3-5) if the writing is successful, judging whether the reading of the new burning code is finished, if the reading is not finished, adding 4 to the current writing address to obtain a new writing address, and returning to the step 3-3);
3-6) repeatedly executing 3-3) -3-5) until all new burning codes are read.
Further, on the basis of the above embodiment of the apparatus, as shown in fig. 7, the apparatus further includes:
a detection module 602, configured to detect whether the microcontroller operates in an ISP area before the step of reading the burning code currently operating in the FLASH of the microcontroller based on the SMBUS protocol;
if so, sending an instruction to enable the microcontroller to continuously stay in an ISP mode so that the reading module executes the subsequent step of reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol, and otherwise, sending a reset signal to the microcontroller again.
The device for upgrading the burning codes of the microcontroller online can be used for executing the method embodiment for upgrading the burning codes of the microcontroller online, and the principle and the technical effect are similar, so that the details are not repeated here.
This embodiment provides an industrial computer mainboard, as shown in FIG. 8, includes: a microcontroller 801, a processor 802, and a memory 803, the memory 803 storing program instructions,
the microcontroller 801 and the processor 802 are connected through an SMBUS, and the processor 802 is configured to execute program instructions in the memory 803, so as to implement the method for upgrading the microcontroller burning code online provided by the foregoing method embodiment.
The present embodiment provides a non-transitory computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method for upgrading the microcontroller burning code online provided by the above method embodiment.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for upgrading burning codes of a microcontroller on line is characterized by comprising the following steps:
sending a reset signal to a microcontroller to cause the microcontroller to enter an ISP zone and run an ISP boot loader, wherein the microcontroller supports online system programming functions;
reading a currently running burning code in a FLASH of the microcontroller based on an SMBUS protocol;
and comparing the new burning code with the burning code currently running in the FLASH of the microcontroller, and transmitting the new burning code to the microcontroller based on an SMBUS protocol when the new burning code is inconsistent with the burning code currently running in the FLASH of the microcontroller, so that the microcontroller receives the new burning code on line and loads the new burning code to the FLASH.
2. The method of claim 1, wherein reading the currently running burn code in FLASH of the microcontroller based on the SMBUS protocol comprises:
2-1) setting the read address as the initial address of FLASH;
2-2) sending a first interactive command for reading FLASH, wherein the first interactive command comprises the reading address;
2-3) if the reading is successful, storing the read data;
2-4) judging whether the reading address is finished or not, if not, adding 16 to the current reading address to obtain a new reading address, and returning to the step 2-2);
2-5) repeating 2-2) -2-4) until the reading address is finished.
3. The method of claim 1, wherein the transmitting the new burn code to the microcontroller based on an SMBUS protocol comprises:
3-1) judging whether the data length of the new burning code meets the size requirement of FLASH;
3-2) if the address meets the requirement, setting the write address as the initial address of the FLASH;
3-3) acquiring 4 bytes of data from the new burning code;
3-4) sending a second interactive command for writing FLASH, wherein the second interactive command comprises the write address and 4 bytes of data;
3-5) if the writing is successful, judging whether the reading of the new burning code is finished, if the reading is not finished, adding 4 to the current writing address to obtain a new writing address, and returning to the step 3-3);
3-6) repeatedly executing 3-3) -3-5) until all new burning codes are read.
4. The method of claim 1, wherein prior to the step of reading the burning code currently running in FLASH of the microcontroller based on the SMBUS protocol, the method further comprises:
detecting whether the microcontroller operates in an ISP zone;
if so, sending an instruction to enable the microcontroller to stay in an ISP mode so as to execute the subsequent step of reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol, and otherwise, sending a reset signal to the microcontroller again.
5. An apparatus for upgrading burning codes of a microcontroller on line, the apparatus comprising:
the system comprises a reset module, a microprocessor and a microprocessor, wherein the reset module is used for sending a reset signal to the microcontroller so that the microcontroller enters an ISP zone and runs an ISP boot loader, and the microcontroller supports an online system programming function;
the reading module is used for reading the currently running burning codes in the FLASH of the microcontroller based on an SMBUS protocol;
the comparison module is used for comparing the new burning codes with the burning codes currently running in the FLASH of the microcontroller;
and the writing module is used for transmitting the new burning code to the microcontroller based on an SMBUS protocol when the new burning code is inconsistent with the burning code currently running in the FLASH of the microcontroller, so that the microcontroller receives the new burning code on line and loads the new burning code to the FLASH.
6. The apparatus of claim 5, wherein the read module is specifically configured to:
2-1) setting the read address as the initial address of FLASH;
2-2) sending a first interactive command for reading FLASH, wherein the first interactive command comprises the reading address;
2-3) if the reading is successful, storing the read data;
2-4) judging whether the reading address is finished or not, if not, adding 16 to the current reading address to obtain a new reading address, and returning to the step 2-2);
2-5) repeating 2-2) -2-4) until the reading address is finished.
7. The apparatus of claim 5, wherein the write module is specifically configured to:
3-1) judging whether the data length of the new burning code meets the size requirement of FLASH;
3-2) if the address meets the requirement, setting the write address as the initial address of the FLASH;
3-3) acquiring 4 bytes of data from the new burning code;
3-4) sending a second interactive command for writing FLASH, wherein the second interactive command comprises the write address and 4 bytes of data;
3-5) if the writing is successful, judging whether the reading of the new burning code is finished, if the reading is not finished, adding 4 to the current writing address to obtain a new writing address, and returning to the step 3-3);
3-6) repeatedly executing 3-3) -3-5) until all new burning codes are read.
8. The apparatus of claim 5, further comprising:
the detection module is used for detecting whether the microcontroller operates in an ISP area or not before the step of reading the burning code currently operating in the FLASH of the microcontroller based on the SMBUS protocol;
if so, sending an instruction to enable the microcontroller to continuously stay in an ISP mode so that the reading module executes the subsequent step of reading the currently running burning code in the FLASH of the microcontroller based on the SMBUS protocol, and otherwise, sending a reset signal to the microcontroller again.
9. The utility model provides an industrial computer mainboard, includes microcontroller, its characterized in that still includes: processor, memory and computer program stored on the memory and executable on the processor, which when executed by the processor implements the method of upgrading microcontroller burning code online as claimed in any of claims 1 to 4.
10. A non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for upgrading microcontroller burn code online as recited in any of claims 1-4.
CN202010595988.6A 2020-06-24 2020-06-24 Method and device for upgrading burning codes of microcontroller on line Pending CN111752589A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010595988.6A CN111752589A (en) 2020-06-24 2020-06-24 Method and device for upgrading burning codes of microcontroller on line

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010595988.6A CN111752589A (en) 2020-06-24 2020-06-24 Method and device for upgrading burning codes of microcontroller on line

Publications (1)

Publication Number Publication Date
CN111752589A true CN111752589A (en) 2020-10-09

Family

ID=72677546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010595988.6A Pending CN111752589A (en) 2020-06-24 2020-06-24 Method and device for upgrading burning codes of microcontroller on line

Country Status (1)

Country Link
CN (1) CN111752589A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599408A (en) * 2022-11-29 2023-01-13 深圳开鸿数字产业发展有限公司(Cn) Data burning method and device of processor and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783003A (en) * 2004-12-02 2006-06-07 华为技术有限公司 Program on-line loading method
CN104679559A (en) * 2015-02-11 2015-06-03 北京配天技术有限公司 Single chip microcomputer on-line programming method
CN108255510A (en) * 2017-12-22 2018-07-06 芯海科技(深圳)股份有限公司 One kind is based on IAP online upgradings firmware transfer check design method to be upgraded
US20190042228A1 (en) * 2017-12-28 2019-02-07 Intel Corporation Firmware upgrade method and apparatus
CN111078235A (en) * 2019-12-13 2020-04-28 西安研祥兴业电子科技有限公司 Digital power supply chip burning method and device
CN111124456A (en) * 2019-12-26 2020-05-08 深圳市丰润达科技有限公司 Method and device for upgrading firmware of single chip microcomputer through master control and readable storage medium
CN111273938A (en) * 2020-04-10 2020-06-12 威海市天罡仪表股份有限公司 Circuit and method for realizing IAP program upgrading based on single chip microcomputer ISP

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783003A (en) * 2004-12-02 2006-06-07 华为技术有限公司 Program on-line loading method
CN104679559A (en) * 2015-02-11 2015-06-03 北京配天技术有限公司 Single chip microcomputer on-line programming method
CN108255510A (en) * 2017-12-22 2018-07-06 芯海科技(深圳)股份有限公司 One kind is based on IAP online upgradings firmware transfer check design method to be upgraded
US20190042228A1 (en) * 2017-12-28 2019-02-07 Intel Corporation Firmware upgrade method and apparatus
CN111078235A (en) * 2019-12-13 2020-04-28 西安研祥兴业电子科技有限公司 Digital power supply chip burning method and device
CN111124456A (en) * 2019-12-26 2020-05-08 深圳市丰润达科技有限公司 Method and device for upgrading firmware of single chip microcomputer through master control and readable storage medium
CN111273938A (en) * 2020-04-10 2020-06-12 威海市天罡仪表股份有限公司 Circuit and method for realizing IAP program upgrading based on single chip microcomputer ISP

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘海成: "单片机及应用系统设计原理与实践", 北京航空航天大学出版社, pages: 239 - 242 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115599408A (en) * 2022-11-29 2023-01-13 深圳开鸿数字产业发展有限公司(Cn) Data burning method and device of processor and storage medium

Similar Documents

Publication Publication Date Title
RU2402804C2 (en) Method of booting host device from mmc/sd device, host device bootable from mmc/sd device and mmc/sd device from which host device may be booted
CN106201563B (en) Configuration method and device of starting parameters and method and device for starting mainboard
CN104102518B (en) double-CPU system and program upgrading method thereof
US7908417B2 (en) Motherboard system, storage device for booting up thereof and connector
CN110069280B (en) Electronic device and firmware updating method thereof
CN106909362B (en) Method and device for generating BMC (baseboard management controller) firmware and method and device for starting BMC system
TWI707274B (en) A computer-implemented method, a computer system, and a computer-readable storage medium for updating the rom code of a system
CN114138333B (en) Program loading method and related device
CN114661368B (en) Chip and starting method thereof
CN111752589A (en) Method and device for upgrading burning codes of microcontroller on line
CN111267111B (en) Robot control method, device and system
CN114138295A (en) Method, device and system for upgrading application program firmware of electronic equipment
CN111338702B (en) SOC system booting method based on off-chip nor-flash
TWI631442B (en) Control device, data processing device, control system, control method, data processing method, control program, and data processing program
CN111954040A (en) Remote controller upgrading method and device, electronic equipment and storage medium
CN110825421A (en) Firmware upgrading method and system and readable storage medium
TW201441932A (en) Processing devices and system program updating methods
KR20020030669A (en) Computer system and a method of automatically setting an operating system thereof
CN114443152B (en) Network wake-up starting-up method and computer equipment
JP5489278B2 (en) Information processing apparatus and activation method thereof
KR101370350B1 (en) Computer system and control method thereof
CN110908673B (en) Digital power supply chip burning method
CN110515665B (en) Starting method, system and device of processor system
CN111625284B (en) Low-power-consumption mode awakening recovery method and device of solid state disk and computer equipment
CN113010236A (en) Program execution method, device, equipment and storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230627

Address after: 518057 1701, Yanxiang science and technology building, 31 Gaoxin middle Fourth Road, Maling community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Yanxiang smart IOT Technology Co.,Ltd.

Address before: No.1, Yanxiang Zhigu chuangxiangdi, No.11, Gaoxin Road, Guangming New District, Shenzhen, Guangdong 518107

Applicant before: EVOC INTELLIGENT TECHNOLOGY Co.,Ltd.