CN117407006A - Burning device - Google Patents

Burning device Download PDF

Info

Publication number
CN117407006A
CN117407006A CN202311460129.6A CN202311460129A CN117407006A CN 117407006 A CN117407006 A CN 117407006A CN 202311460129 A CN202311460129 A CN 202311460129A CN 117407006 A CN117407006 A CN 117407006A
Authority
CN
China
Prior art keywords
firmware
memory
burning
field
data
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
CN202311460129.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.)
Silicon Valley Digital Analog Shanghai Semiconductor Co ltd
Analogix International LLC
Original Assignee
Silicon Valley Digital Analog Shanghai Semiconductor Co ltd
Analogix International LLC
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 Silicon Valley Digital Analog Shanghai Semiconductor Co ltd, Analogix International LLC filed Critical Silicon Valley Digital Analog Shanghai Semiconductor Co ltd
Priority to CN202311460129.6A priority Critical patent/CN117407006A/en
Publication of CN117407006A publication Critical patent/CN117407006A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • 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/60Software deployment
    • G06F8/65Updates
    • G06F8/66Updates of program code stored in read-only memory [ROM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The application provides a burn-in device, this burn-in device includes: the micro control unit comprises a central processing unit, a first memory and a second memory which are in communication connection, wherein the central processing unit is used for processing input data of the central processing unit according to an instruction set and a program of the first firmware and data of the first firmware; the loader is connected with the micro control unit through a communication bus and is used for burning the first firmware into the third memory to obtain the second firmware; and the third memory is connected with the micro control unit and the loader through a communication bus and comprises a first storage partition and a second storage partition, wherein the first storage partition is used for storing second firmware, and the second storage partition is used for storing first backup data of the second firmware. The burning device solves the problem that the robustness of the microcontroller is poor due to firmware burning faults in the firmware burning process.

Description

Burning device
Technical Field
The application relates to the field of microcontrollers, in particular to a burning device.
Background
In the current use of the micro control unit (Microcontroller Unit, abbreviated as MCU), firmware (also called firmware) is first executed to initialize after power-up, and the hardware is booted to start working. In addition, after the chip is measured, firmware is updated and patched, so that an interface is required to be set aside, and the subsequent updating of software by a customer is facilitated. Thus, firmware reliability is the most important factor in the stable operation of a microcontroller system.
Therefore, a convenient, flexible and reliable firmware burning device is needed to solve the problem of poor robustness of the microcontroller in the prior art.
Disclosure of Invention
The main objective of the present application is to provide a writing device, so as to at least solve the problem of poor robustness of the microcontroller caused by a firmware writing failure in the firmware writing process in the prior art.
According to an aspect of the present application, there is provided a burning apparatus including: the micro control unit comprises a central processing unit, a first memory and a second memory, wherein the central processing unit is respectively in communication connection with the first memory and the second memory, the first memory is used for storing data of the first firmware, the second memory is used for storing an instruction set and a program of the first firmware, and the central processing unit is used for processing the data of the first firmware according to the instruction set and the program of the first firmware; the loader is connected with the micro control unit through a communication bus and is used for burning the first firmware into the third memory to obtain the second firmware; and the third memory is connected with the micro control unit and the loader through a communication bus and comprises a first storage partition and a second storage partition, wherein the first storage partition is used for storing second firmware, and the second storage partition is used for storing first backup data of the second firmware.
Optionally, the loader includes a UART serial port and an I2C serial port, and the loader is further configured to one of: burning the first firmware to the third memory through the UART serial port; burning the first firmware to the third memory through the I2C serial port; and burning the first firmware into the third memory through the central processing unit.
Optionally, the burning device further includes an upper computer, and the loader is configured to burn the first firmware to the third memory through the UART serial port, including: loading a first firmware sent by the upper computer to the first memory and the second memory through the UART serial port to obtain data of the first firmware and an instruction set and a program of the first firmware; burning the data of the first firmware in the first memory and the instruction set and the program of the first firmware in the second memory to the first memory partition of the third memory to obtain the second firmware; and copying the second firmware to the second storage partition to obtain the first backup data.
Optionally, the loader is further configured to burn the first firmware to the third memory through the I2C serial port, including: the data of the first firmware in the first memory and the instruction set and the program of the first firmware of the second memory are directly burnt into the first memory partition of the third memory through the I2C serial port, so that the second firmware is obtained; and copying the second firmware to the second storage partition to obtain the first backup data.
Optionally, the loader is further configured to burn, by the central processor, the first firmware to the third memory, including: the UART serial port and the central processing unit are used for directly burning the data of the first firmware in the first memory and the instruction set and the program of the first firmware of the second memory to the first memory partition of the third memory to obtain the second firmware; and copying the second firmware to the second storage partition to obtain the first backup data.
Optionally, the loading means for burning the data of the first firmware in the first memory and the instruction set and the program of the first firmware of the second memory to the first memory partition of the third memory includes: acquiring a first starting address corresponding to data of the second firmware in the first storage partition and a second starting address corresponding to an instruction set and a program of the second firmware in the first storage partition; burning the data of the first firmware to the first starting address; and burning the instruction set and the program of the first firmware to the second starting address.
Optionally, the loader is further configured to: calculating a checksum of the first firmware to obtain a first checksum, and burning the first checksum to the first storage partition of the third memory; acquiring a first field of the first firmware and a second field of the first firmware, wherein the first field is used for determining whether the first firmware is burnt or not, and the second field is used for determining whether the first firmware is burnt successfully or not; burning the first field to the first storage partition of the third memory to obtain a third field; and burning the second field to the first storage partition of the third memory to obtain a fourth field.
Optionally, after obtaining the third field and the fourth field, the loader is further configured to: acquiring the third field, determining that the second firmware is burnt under the condition that the third field is the same as the first preset field, and acquiring the fourth field; determining that the second firmware is successfully burnt under the condition that the fourth field is the same as a second preset field; determining that the second firmware is not burned under the condition that the third field is different from the first preset field; and if the fourth field is different from the second preset field, determining that the second firmware burning is unsuccessful.
Optionally, in the case that the second firmware burning is determined to be unsuccessful, the loader is further configured to: loading second backup data of the first storage partition, wherein the second backup data is backup data of the first backup data; and adjusting the fourth field to the second preset field.
Optionally, in the case that it is determined that the second firmware has been burned, the loader is further configured to: loading the second firmware stored in the first storage partition to the first memory and the second memory to obtain third firmware; obtaining a checksum of the third firmware to obtain a second checksum; determining whether the second checksum is the same as the first checksum, and if the second checksum is the same as the first checksum, determining that the third firmware is successfully loaded; and under the condition that the second checksum is different from the first checksum, determining that the third firmware is unsuccessfully loaded, and loading the first backup data of the second firmware stored in the second storage partition to the first memory and the second memory to obtain fourth firmware.
By applying the technical scheme, the burning device comprises a micro control unit, a loader and a third memory, wherein the micro control unit comprises a central processing unit, a first memory and a second memory, the central processing unit is respectively in communication connection with the first memory and the second memory, the first memory is used for storing data of first firmware, the second memory is used for storing an instruction set and a program of the first firmware, and the central processing unit is used for processing the data of the first firmware according to the instruction set and the program of the first firmware; the loader is connected with the micro-control unit through a communication bus and is used for burning the first firmware into the third memory to obtain the second firmware; and the third memory is connected with the micro control unit and the loader through a communication bus and comprises a first storage partition and a second storage partition, wherein the first storage partition is used for storing second firmware, and the second storage partition is used for storing first backup data of the second firmware. On the basis of the original burning device comprising the MCU and the loader, a third memory is added, the memory stores updated firmware and first backup data of the updated firmware at the same time, and a double-backup mode is adopted, so that flexible loading of the firmware can be further ensured, the firmware is protected from being damaged, correct firmware can be updated in time after damage occurs, the using robustness of the microcontroller is improved, and the problem that the robustness of the microcontroller is poor due to firmware burning faults in the firmware burning process in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 shows a hardware block diagram of a recording apparatus according to an embodiment of the present application;
fig. 2 shows a hardware configuration block diagram of a third memory provided in an embodiment according to the present application.
Wherein the above figures include the following reference numerals:
100. a micro control unit; 101. a central processing unit; 102. a first memory; 103. a second memory; 200. an loader; 300. a communication bus; 400. and a third memory.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As described in the background art, in the prior art, the robustness of the microcontroller is poor due to the firmware burning fault in the firmware burning process, so as to solve the above problem, the embodiment of the present application provides a burning device.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Fig. 1 is a block diagram of a hardware configuration of a recording apparatus according to an embodiment of the present application. As shown in fig. 1, the recording apparatus includes:
the micro control unit 100 comprises a central processing unit 101, a first memory 102 and a second memory 103, wherein the central processing unit 101 is respectively in communication connection with the first memory 102 and the second memory 103, the first memory 102 is used for storing data of the first firmware, the second memory 103 is used for storing an instruction set and a program of the first firmware, and the central processing unit 101 is used for processing the data of the first firmware according to the instruction set and the program of the first firmware;
in particular, firmware is a piece of software embedded in the hardware of the device that provides the basic functions and control of the device. It is commonly used to control and manage the hardware operations of devices, including starting, running, and communicating with other devices. The firmware may be loaded into the hardware during device manufacturing or updated by updating. The first memory may be a random access memory (Random Access Memory, simply referred to as RAM) for storing data required for executing the program, such as variables, arrays, and input/output buffers. Since the data memory stores real-time data, it may be constantly changed as the program is executed and the capacity of the data memory is generally small. Because the data memory needs to read and write data frequently, the access speed is also faster. The second Memory is a program Memory, which is used for storing instructions of a program and guiding the MCU to execute specific operations, and the program Memory may be a Read-Only Memory (ROM) or a Flash Memory (Flash), and the stored program instructions may not be changed when the program is executed. Since the program memory stores fixed program instructions, these instructions remain unchanged during program execution. Program memory typically has a larger capacity than data memory to store complete program code. The central processor may be a RISC-V core, which is a processor core based on a RISC-V instruction set architecture. RISC-V core is a processor core implemented according to the RISC-V instruction set specification that may perform operations defined in the RISC-V instruction set. RISC-V core may be used as the basis for the entire processor to perform various computing tasks.
The loader 200 is connected with the micro control unit 100 through the communication bus 300, and the loader 200 is used for burning the first firmware into the third memory 400 to obtain the second firmware;
in particular, a loader is a program or component in a computer system that loads software or data into the memory of the computer for execution or use. The loader is typically part of an operating system and is responsible for loading executable files or library files into memory and setting up the execution environment so that the program can run properly. The loader can also handle tasks such as symbol resolution, address relocation, and rights control to ensure that the program can be loaded and executed correctly. The loader plays an important role when the operating system is started or when new software or data is loaded on the fly.
And a third memory 400 connected to the micro control unit 100 and the loader 200 through the communication bus 300, the third memory 400 including a first memory partition for storing the second firmware and a second memory partition for storing the first backup data of the second firmware.
Specifically, the third memory may be an electronic flash (Electronics Flash Memory, abbreviated as eFlash) or may be another kind of memory. Because of the unique structure of eFlash, only the erase function, with full slice or page erase, can all initialize logic cells to 1. External writing can only write 1 to 0, and cannot write 0 to 1. Therefore, the address space is used to allocate memory contents, firmware (firmware) is backed up into 2 copies, and the copies are stored in the firmware a, i.e., the first memory partition, the firmware B, and the second memory partition space, respectively. The firmware a includes a storage space corresponding to the first memory and a storage space corresponding to the second memory, and is used for storing corresponding contents. Similarly, the firmware B includes a storage space corresponding to the first memory and a storage space corresponding to the second memory.
Through the embodiment, the burning device comprises a micro control unit, a loader and a third memory, wherein the micro control unit comprises a central processing unit, a first memory and a second memory, the central processing unit is used for processing first firmware, the first memory is used for storing data of the first firmware, and the second memory is used for storing an instruction set and a program of the first firmware; the loader is connected with the micro-control unit through a communication bus and is used for burning the first firmware into the third memory to obtain the second firmware; and the third memory is connected with the micro control unit and the loader through a communication bus and comprises a first storage partition and a second storage partition, wherein the first storage partition is used for storing second firmware, and the second storage partition is used for storing first backup data of the second firmware. On the basis of the original burning device comprising the MCU and the loader, a third memory is added, the memory stores updated firmware and first backup data of the updated firmware at the same time, and a double-backup mode is adopted, so that flexible loading of the firmware can be further ensured, the firmware is protected from being damaged, correct firmware can be updated in time after damage occurs, the using robustness of the microcontroller is improved, and the problem that the robustness of the microcontroller is poor due to firmware burning faults in the firmware burning process in the prior art is solved.
In order to further meet the demands of customers at various stages of the chip through various writing modes, the loader comprises a UART serial port and an I2C serial port, and the loader is further used for one of the following: burning the first firmware to a third memory through a UART serial port; burning the first firmware to a third memory through an I2C serial port; the first firmware is burned into the third memory through the central processing unit.
Specifically, the first firmware is burned to the third memory through the UART serial port in a corresponding UART burning mode, where the burning mode is the most friendly burning mode for the user. The writing of the first firmware to the third memory through the I2C serial port corresponds to the I2C serial port writing mode, and the writing mode is the writing mode with the highest speed because no downloading is needed, so that the writing method is suitable for large-scale rapid writing. The writing of the first firmware into the third memory by the central processing unit corresponds to RISC-V software writing, and the writing mode can be used for writing after RISC-V is normally started, and is suitable for the debugging stage of a factory and used when the program needs to be modified occasionally.
In a specific implementation process, the above-mentioned programming device of the present application further includes an upper computer, and the loader is configured to program the first firmware to the third memory through the UART serial port, including: loading the first firmware sent by the upper computer to the first memory and the second memory through the UART serial port to obtain data of the first firmware and an instruction set and a program of the first firmware; burning the data of the first firmware in the first memory and the instruction set and the program of the first firmware in the second memory to a first memory partition of the third memory to obtain the second firmware; and copying the second firmware to the second storage partition to obtain the first backup data. The device copies the content of the first storage partition to the second storage partition, and adopts a double-backup mode to protect the firmware from being damaged, so that the correct firmware can be updated in time after the firmware is damaged.
Specifically, the UART burning method includes the following steps: the upper computer downloads firmware into the data memory and the program memory through the UART serial port, after the downloading is completed, the hardware starts an automatic burning mode, firstly the loader state machine automatically burns the content of the data memory and the program memory into the memory space corresponding to the first memory in the first memory partition and the memory space corresponding to the second memory in the third memory, and after the firmware A is configured, the loader state machine backs up all data in the first memory partition into the space of the second memory partition. And after the backup is completed, resetting the whole hardware, and starting the loading flow of the loader.
The loader is further configured to burn the first firmware to the third memory through the I2C serial port, including: the data of the first firmware in the first memory and the instruction set and the program of the first firmware of the second memory are burnt to a first storage partition of the third memory through the I2C serial port to obtain the second firmware; and copying the second firmware to the second storage partition to obtain the first backup data. The device can further meet the requirement of large-scale quick burning through realizing an I2C burning mode, and saves the downloading time.
Specifically, the above I2C writing manner can directly write the space content of the third memory, so that the UART downloading and the automatic writing time of the state machine can be saved. However, in this method, the host computer needs to acquire the firmware content and the checksum calculation value, and at the same time, needs to write the space of the first memory partition and the second memory partition.
In some embodiments, the loader further configured to burn, by the central processing unit, the first firmware into the third memory includes: the method comprises the steps that data of a first firmware in a first memory and an instruction set and a program of the first firmware in a second memory are burnt into a first storage partition of a third memory through a central processing unit, so that a second firmware is obtained; and copying the second firmware to the second storage partition to obtain the first backup data. The CPU burning mode of the device can further meet the use requirement of occasionally modifying programs in the factory debugging stage.
Specifically, the above-mentioned burning mode can be implemented by RISC-V software, RISC-V is an open-source instruction set architecture, and can be applied to embedded systems and other computing devices. RISC-V software burning is the process of loading a software program of a written RISC-V instruction set architecture onto a RISC-V processor. The RISC-V software burning process is as follows: firstly, a software program of a RISC-V instruction set architecture is written by using RISC-V assembly language or high-level programming language; after the writing is completed, compiling and linking the software program into an executable file by using a compiler and a linker in a RISC-V tool chain; selecting a corresponding burning tool to load the executable file onto the target RISC-V processor, wherein the burning tool is such as OpenOCD, JTAG and the like; and then the burning tool is connected with the target RISC-V processor, so that the connection is ensured to be stable and reliable, and the burning tool can be correctly communicated with the target processor. And carrying out corresponding configuration according to a specific burning tool, wherein the configuration comprises the steps of selecting a correct target chip model, setting burning parameters and the like. The executable file is loaded into the memory of the target processor using a burn tool. This typically involves writing the machine code of the executable file into the memory or flash memory of the processor.
In other embodiments, the loader for burning data of the first firmware in the first memory and an instruction set and program of the first firmware of the second memory to the first memory partition of the third memory comprises: acquiring a first starting address corresponding to data of second firmware in a first storage partition and a second starting address corresponding to an instruction set and a program of the second firmware in the first storage partition; burning the data of the first firmware to a first starting address; the data of the first firmware is burnt to the second starting address. The device can further realize the burning of the first firmware into the space of the corresponding address of the corresponding memory through the starting address.
Specifically, the starting addresses of the corresponding data memory and program memory in the first memory partition and the second memory partition in the third memory can be configured through the register, and then the loader state machine automatically burns the contents of the data memory and the program memory space to the respective starting addresses of the data memory and the program memory of the first memory partition in the third memory configured by the register. In addition, the positions of the first starting address and the second starting address in the first storage partition and the second storage partition may be different, so that a person skilled in the art can flexibly configure the first storage partition and the second storage partition according to actual situations, and the configuration manner can further avoid bad areas in storage.
In another embodiment, the loader is further for: calculating a checksum of the first firmware to obtain a first checksum, and burning the first checksum to a first storage partition of the third memory; acquiring a first field of the first firmware and a second field of the first firmware, wherein the first field is used for determining whether the first firmware is burnt or not, and the second field is used for determining whether the first firmware is burnt successfully or not; burning the first field to a first storage partition of a third memory to obtain a third field; and burning the second field to the first storage partition of the third memory to obtain a fourth field. The device can quickly determine whether the abnormality occurs in the burning process by comparing the checksum, the first field and the second field.
Specifically, as shown in fig. 2, the third memory includes a first storage partition firmware a and a second storage partition firmware B, where the firmware a stores a third field a, a fourth field a, a version number a, a checksum a, a storage space a corresponding to the first memory, and a storage space a corresponding to the second memory, and the firmware B stores a third field B, a fourth field B, a version number B, a checksum B, a storage space B corresponding to the first memory, and a storage space B corresponding to the second memory.
After deriving the third and fourth fields, the loader is further configured to: acquiring a third field, determining that the second firmware is burnt under the condition that the third field is the same as the first preset field, and acquiring a fourth field; under the condition that the fourth field is the same as the second preset field, determining that the second firmware is successfully burnt; determining that the second firmware is not successfully burned under the condition that the fourth field is different from the second preset field; and determining that the second firmware is not burned in the case that the third field is different from the first predetermined field. The device can further quickly determine whether the firmware is burnt or not through the third field, and can further quickly determine whether the firmware is burnt or not successfully through the fourth field.
Specifically, whether the firmware a has been already programmed is determined by reading the third field of the firmware a, if the third field of the firmware a is the same as the first predetermined field, it indicates that the current firmware a has been programmed, and if the third field of the firmware a is different from the first predetermined field, it indicates that the eFlash has not been programmed or has failed to be programmed. And when the third field of the firmware A is correct, namely the third field is the same as the first preset field, reading the fourth field of the firmware A to judge whether the firmware A is available at present, and if the fourth field of the firmware A is the same as the second preset field, starting to move the firmware A content in the eFlash from the initial address of the storage space A corresponding to the first memory, and moving the storage data with the corresponding size from the initial address of the storage space A corresponding to the second memory.
In the event that the second firmware burn is determined to be unsuccessful, the loader is further configured to: copying the first backup data of the second firmware stored in the second storage partition to the first storage partition; the fourth field is adjusted to a second predetermined field. The device can further ensure that the firmware A program is normally used when the hardware is powered on and loaded again by modifying the fourth field into the second preset field which represents successful burning.
Specifically, when firmware A loads in error, firmware B may be loaded. Meanwhile, firmware A can be repaired, the loader burning state machine automatically backs up data of firmware B space into firmware A space according to the error request, and the fourth field is modified to be available.
In the case where it is determined that the second firmware has been burned, the loader is further configured to: loading the second firmware stored in the first storage partition to the first memory and the second memory to obtain third firmware; obtaining a checksum of the third firmware to obtain a second checksum; determining whether the second checksum is the same as the first checksum, and if so, determining that the third firmware is successfully loaded; and under the condition that the second checksum is different from the first checksum, determining that the third firmware is unsuccessfully loaded, and loading the first backup data of the second firmware stored in the second storage partition to the first memory and the second memory to obtain the fourth firmware. The device can judge whether the data is changed or damaged through the judgment of the checksum, and further improves the data accuracy in the burning process.
Specifically, the checksum value of the entire firmware is calculated during the burning process. And after the firmware content is moved, burning the calculated checksum value into a corresponding field, wherein the checksum is used for detecting errors in data transmission, obtaining a value with a fixed length by carrying out mathematical operation on the data, and comparing the value with the checksum calculated in the transmission process to judge whether the data is changed or damaged. The sender calculates the checksum at the time of sending the data and appends it to the data packet. The receiver also calculates a checksum when receiving the data and compares it to the received checksum. If the two checksums do not match, it indicates that the data is in error during transmission. Since the checksum can only detect a part of the errors, e.g. bit errors or simple transmission errors, but cannot detect all possible errors. Therefore, in some cases, the problem in the burning process can be further judged through the first field and the second field. And finally, burning the first field and the second field. The first field is used for judging whether the firmware A is burnt or not, and the second field is used for judging whether the firmware A is damaged or not. Finally, the loader state machine reads the data from the first memory and the second memory again to calculate the checksum, and compares the checksum with the pre-stored checksum stored in the checksum field in the eFlash to judge whether the firmware A is loaded successfully. If the comparison is correct, resetting the hardware release system, and starting to run the software program; if the judgment is wrong, the loading of the firmware A fails, the state machine can repeatedly load the firmware A for a plurality of times, and if all the firmware A fails, the state machine writes back the fourth field into a failure state. The contents of firmware B are then loaded, and the loading process is the same as that of firmware A. If firmware B is loaded successfully, the microcontroller runs a software program and can select to repair firmware A content according to configuration requirements. If the firmware B fails to be loaded, the software of the chip fails to be loaded, and the eFlash is re-burned next time.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
the burning device comprises a micro control unit, a loader and a third memory, wherein the micro control unit comprises a central processing unit, a first memory and a second memory, the central processing unit is respectively in communication connection with the first memory and the second memory, the first memory is used for storing data of first firmware, the second memory is used for storing an instruction set and a program of the first firmware, and the central processing unit is used for processing the data of the first firmware according to the instruction set and the program of the first firmware; the loader is connected with the micro-control unit through a communication bus and is used for burning the first firmware into the third memory to obtain the second firmware; and the third memory is connected with the micro control unit and the loader through a communication bus and comprises a first storage partition and a second storage partition, wherein the first storage partition is used for storing second firmware, and the second storage partition is used for storing first backup data of the second firmware. On the basis of the original burning device comprising the MCU and the loader, a third memory is added, the memory stores updated firmware and first backup data of the updated firmware at the same time, and a double-backup mode is adopted, so that flexible loading of the firmware can be further ensured, the firmware is protected from being damaged, correct firmware can be updated in time after damage occurs, the using robustness of the microcontroller is improved, and the problem that the robustness of the microcontroller is poor due to firmware burning faults in the firmware burning process in the prior art is solved.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. A burning apparatus, comprising:
the micro control unit comprises a central processing unit, a first memory and a second memory, wherein the central processing unit is respectively in communication connection with the first memory and the second memory, the first memory is used for storing data of first firmware, the second memory is used for storing an instruction set and a program of the first firmware, and the central processing unit is used for processing input data of the central processing unit according to the instruction set and the program of the first firmware and the data of the first firmware;
the loader is connected with the micro control unit through a communication bus and is used for burning the first firmware into a third memory to obtain a second firmware;
the third memory is connected with the micro control unit and the loader through the communication bus, and comprises a first storage partition and a second storage partition, wherein the first storage partition is used for storing the second firmware, and the second storage partition is used for storing first backup data of the second firmware.
2. The recording device of claim 1, wherein the loader comprises a UART serial port and an I2C serial port, the loader further configured to one of:
burning the first firmware to the third memory through the UART serial port;
burning the first firmware to the third memory through the I2C serial port;
and burning the first firmware into the third memory through the central processing unit.
3. The recording device according to claim 2, further comprising a host computer, wherein the loader is configured to record the first firmware to the third memory through the UART serial port, and the recording device comprises:
loading a first firmware sent by the upper computer to the first memory and the second memory through the UART serial port to obtain data of the first firmware and an instruction set and a program of the first firmware;
burning the data of the first firmware in the first memory and the instruction set and the program of the first firmware in the second memory to the first memory partition of the third memory to obtain the second firmware;
and copying the second firmware to the second storage partition to obtain the first backup data.
4. The programming device of claim 2, wherein the loader further to program the first firmware to the third memory through the I2C serial port comprises:
the data of the first firmware in the first memory and the instruction set and the program of the first firmware of the second memory are directly burnt into the first memory partition of the third memory through the I2C serial port, so that the second firmware is obtained;
and copying the second firmware to the second storage partition to obtain the first backup data.
5. The burning apparatus of claim 2, wherein the loader further for burning the first firmware to the third memory by the central processor comprises:
the UART serial port and the central processing unit are used for directly burning the data of the first firmware in the first memory and the instruction set and the program of the first firmware of the second memory to the first memory partition of the third memory to obtain the second firmware;
and copying the second firmware to the second storage partition to obtain the first backup data.
6. The burning apparatus according to any one of claims 3 to 5, wherein the loader for burning the data of the first firmware in the first memory and the instruction set and program of the first firmware of the second memory to the first memory partition of the third memory includes:
acquiring a first starting address corresponding to data of the second firmware in the first storage partition and a second starting address corresponding to an instruction set and a program of the second firmware in the first storage partition;
burning the data of the first firmware to the first starting address;
and burning the instruction set and the program of the first firmware to the second starting address.
7. The recording apparatus of claim 1, wherein the loader is further configured to:
calculating a checksum of the first firmware to obtain a first checksum, and burning the first checksum to the first storage partition of the third memory;
acquiring a first field of the first firmware and a second field of the first firmware, wherein the first field is used for determining whether the first firmware is burnt or not, and the second field is used for determining whether the first firmware is burnt successfully or not;
burning the first field to the first storage partition of the third memory to obtain a third field;
and burning the second field to the first storage partition of the third memory to obtain a fourth field.
8. The recording apparatus of claim 7, wherein after obtaining the third field and the fourth field, the loader is further to:
acquiring the third field, determining that the second firmware is burnt under the condition that the third field is the same as the first preset field, and acquiring the fourth field;
determining that the second firmware is successfully burnt under the condition that the fourth field is the same as a second preset field;
determining that the second firmware is not burned under the condition that the third field is different from the first preset field;
and if the fourth field is different from the second preset field, determining that the second firmware burning is unsuccessful.
9. The programming device of claim 8, wherein, in the event that the second firmware programming is determined to be unsuccessful, the loader is further configured to:
loading second backup data of the first storage partition, wherein the second backup data is backup data of the first backup data;
and adjusting the fourth field to the second preset field.
10. The burning apparatus according to claim 9, wherein in case it is determined that the second firmware has been burned, the loader is further configured to:
loading the second firmware stored in the first storage partition to the first memory and the second memory to obtain third firmware;
obtaining a checksum of the third firmware to obtain a second checksum;
determining whether the second checksum is the same as the first checksum, and if the second checksum is the same as the first checksum, determining that the third firmware is successfully loaded;
and under the condition that the second checksum is different from the first checksum, determining that the third firmware is unsuccessfully loaded, and loading the first backup data of the second firmware stored in the second storage partition to the first memory and the second memory to obtain fourth firmware.
CN202311460129.6A 2023-11-03 2023-11-03 Burning device Pending CN117407006A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311460129.6A CN117407006A (en) 2023-11-03 2023-11-03 Burning device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311460129.6A CN117407006A (en) 2023-11-03 2023-11-03 Burning device

Publications (1)

Publication Number Publication Date
CN117407006A true CN117407006A (en) 2024-01-16

Family

ID=89494200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311460129.6A Pending CN117407006A (en) 2023-11-03 2023-11-03 Burning device

Country Status (1)

Country Link
CN (1) CN117407006A (en)

Similar Documents

Publication Publication Date Title
US7861119B1 (en) Updating a firmware image using a firmware debugger application
CN106951345B (en) Consistency test method and device for disk data of virtual machine
CN110096300B (en) FPGA program file backup management system, operation method and upgrading method
CN110990204B (en) Memory pressure testing method, device, equipment and computer readable storage medium
CN110618892A (en) Bug positioning method and device for solid state disk, electronic equipment and medium
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN113157303A (en) Upgrading method, embedded system, terminal and computer storage medium
CN105630661A (en) Automatic cross-system program debugging method and device
CN116049207A (en) Application SQL script processing method and device, processor and electronic equipment
WO2015184732A1 (en) Bootstrap storage method, bootstrap fault recovery method and device, and computer storage medium
CN109933374B (en) Computer starting method
KR20190108458A (en) Method, device and server for checking a defective function
WO2023207973A1 (en) Compiler test method and apparatus, case generation method and apparatus, and instruction storage structure
CN113377586A (en) Automatic server detection method and device and storage medium
US7490321B2 (en) Method for updating firmware via determining program code
CN100476745C (en) Method for implementing automatic fault-tolerance of image file in Linux operating system booting process
CN117407006A (en) Burning device
CN115684882A (en) Test method, system, medium and computing device for system-on-chip
CN112052031B (en) Method and device for automatically matching and upgrading CPLD (complex programmable logic device) by service board card
CN115034173A (en) Test method of chip simulation model
CN114510375A (en) Flash chip data area dynamic sharing system and method
CN114398087A (en) Method for improving running stability of single chip microcomputer after program updating and single chip microcomputer
CN104751881B (en) flash memory burning method
CN113535468A (en) Starting method and starting device of DSP chip
TWI417888B (en) An embedded chip system, a method for burning a wafer, and a computer program product

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