CN111930408A - Software upgrading method - Google Patents

Software upgrading method Download PDF

Info

Publication number
CN111930408A
CN111930408A CN202010613014.6A CN202010613014A CN111930408A CN 111930408 A CN111930408 A CN 111930408A CN 202010613014 A CN202010613014 A CN 202010613014A CN 111930408 A CN111930408 A CN 111930408A
Authority
CN
China
Prior art keywords
file
upgrade
upgrading
mcu
mpu
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
CN202010613014.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.)
Dongfeng Electric Drive Systems Co Ltd
Original Assignee
Dongfeng Electric Drive Systems 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 Dongfeng Electric Drive Systems Co Ltd filed Critical Dongfeng Electric Drive Systems Co Ltd
Priority to CN202010613014.6A priority Critical patent/CN111930408A/en
Publication of CN111930408A publication Critical patent/CN111930408A/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/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Abstract

The invention provides a software upgrading method and a device, wherein the method comprises the following steps: after a USB insertion event is acquired, carrying out USB flash disk mounting operation and starting an upgrading program; and reading the upgrade packet header file, and executing the upgrade operation of the MCU or the MPU according to the header file content of the upgrade packet. By the scheme, the problem that next program upgrading cannot be performed due to the fact that upgrading of the automobile MPU and the MCU fails in application of the instrument is solved, the influence of the automobile MCU and the MPU application program due to the fact that upgrading of the instrument fails can be effectively avoided, and normal upgrading of the MCU and the MPU program at the automobile end is guaranteed.

Description

Software upgrading method
Technical Field
The invention relates to the field of automotive electronic instruments, in particular to a software upgrading method and device.
Background
The system configuration based on the combination meter and the all-liquid crystal meter generally comprises a plurality of core units, wherein a unit responsible for signal interaction with other vehicle bodies is called MCU, and a unit responsible for displaying signals is called MPU. The program of the MCU is designed as a boot program and an application program, and the program of the MPU generally runs an operating system, and is divided into a kernel program and an application program. With the new definition of the functionality of a meter, it is often necessary to upgrade the MCU and MPU applications of the meter.
At present, for software upgrading of the MCU and the MPU in the automobile, because an upgrading file is usually contained in a meter application program, when the meter application program cannot be started normally, the MCU and the MPU cannot be upgraded.
Disclosure of Invention
In view of this, embodiments of the present invention provide a software upgrading method and apparatus, so as to solve the problem that the failure of upgrading the application of the instrument in the existing software upgrading method affects the next normal upgrading of the program in the MCU and the MPU.
In a first aspect of the embodiments of the present invention, a software upgrading method is provided, including:
after a USB insertion event is acquired, carrying out USB flash disk mounting operation and starting an upgrading program;
reading an upgrade packet header file, and executing the upgrade operation of the MCU or the MPU according to the header file content of the upgrade packet, wherein the header file content at least comprises a file name, a file type and a write-in position.
In a second aspect of the embodiments of the present invention, there is provided a software upgrading apparatus including:
the starting module is used for executing the USB flash disk mounting operation and starting an upgrading program after acquiring the USB inserting event;
and the upgrading module is used for reading the upgrading header file and executing the upgrading operation of the MCU or the MPU according to the header file content of the upgrading packet, wherein the header file content at least comprises a file name, a file type and a writing position.
In a third aspect of the embodiments of the present invention, a readable storage medium is provided, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method provided in the first aspect of the embodiments of the present invention
In the embodiment of the invention, after a USB insertion event is acquired, a USB flash disk mounting operation is executed and an upgrading program is started; and reading the upgrade packet header file, and executing the upgrade operation of the MCU or the MPU according to the header file content of the upgrade packet. Based on the triggering of the USB flash disk inserting event, the upgrading operation of the MCU or the MPU can avoid influencing the next upgrading of the MPU and the MCU due to the upgrading failure of the instrument application, the upgrading program is separated from the instrument application program, so that the MCU and the MPU of the instrument can be upgraded even when the instrument application program cannot be started, the problem that the next upgrading of the MPU and the MCU cannot be carried out due to the failure of the upper computer or the manual operation in the prior art is solved, and the normal upgrading of the display program at the vehicle end is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a software upgrading method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a software upgrading apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, 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, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons skilled in the art without any inventive work shall fall within the protection scope of the present invention, and the principle and features of the present invention shall be described below with reference to the accompanying drawings.
The terms "comprises" and "comprising," when used in this specification and claims, and in the accompanying drawings and figures, are intended to cover non-exclusive inclusions, such that a process, method or system, or apparatus that comprises a list of steps or elements is not limited to the listed steps or elements.
Referring to fig. 1, fig. 1 is a schematic flow chart of a software upgrading method according to an embodiment of the present invention, including:
s101, after a USB insertion event is obtained, carrying out USB flash disk mounting operation and starting an upgrading program;
after the USB flash disk is connected into a vehicle end instrument system through a USB interface, the system detects the insertion operation and triggers the upgrading operation of the MCU or the MPU.
And the upgrading program can read the upgrading package file in the USB flash disk and analyze the file. Other programs currently running on the system may be shut down before the upgrade program initiates the upgrade.
And S102, reading the upgrade packet header file, and executing the upgrade operation of the MCU or the MPU according to the header file content of the upgrade packet.
The header file content at least comprises a file name, a file type and a writing position, and the header file content also comprises an upgrade file size.
For example, it is assumed that the 3 file names of the header file description in the upgrade package are xx.bin, ui.out, and server.out respectively, the types are MCUAPP, mpoapp, and mpoapp respectively, and the write locations are 0x400000,/usr/app/ui.out,/usr/app/server.out, and the sizes are 15K, 1M, and 2M respectively.
For the MCU type upgrade file, the upgrade data is sent to the MCU through the serial port, a bootloader (boot loader) of the MCU writes the upgrade file into the FLASH according to the sent information, and a verification and retransmission mechanism is added in the sending process to ensure the consistency of the data.
For the MPU type upgrade file, it is preferable to perform a backup operation first, and backup the upgraded file to the usb disk. And writing the upgrade file into the designated position by the operation mode set by the C language file. The method comprises the steps of writing an upgrade file in a segmented mode, reading file data written in the segmented mode, judging whether the file data written in the segmented mode is correct or not, and rewriting the wrong segmented file data when the file written in the segmented mode is wrong. The process of writing the upgrade file is executed by writing first, reading and comparing, if the compared data has no problem, the next writing is carried out, and if the compared data has problem, the rewriting operation is executed.
When the writing process is detected to fail, the backup file is written into the original position again, the situation that the running state of the instrument cannot be confirmed by a user due to the fact that the instrument cannot be displayed next time when the instrument is started is avoided, and the situation that the next upgrading process cannot be carried out no matter whether the current writing process is successful or failed is avoided.
Preferably, in the software upgrading process, the name and the type of the currently upgraded file and the current file upgrading progress are acquired and displayed. And if the upgrading process is interrupted, stopping progress updating, and prompting upgrading failure information through an interface.
In one embodiment, the upgrading file is divided into an MCU APP and an MPU APP, the MCU and the MPU program needing to be upgraded are described by xml in the header part of the upgrading file, the name and the type of the MCU upgrading file and the position stored in the MCU are specified by xml, and since the MCU is a bare computer program, the storage position is an internal flash address such as 0x 00400000. The name, type, location that needs to be stored in the MPU, which is typically an internal file location, such as user/app/ui.out, since the MPU is the operating system, is specified by xml.
Compiled MCU and MPU files are also included in the upgrade file, and the name of the xml description needs to be consistent with the names of the MCU and MPU programs.
And reading the XML file through an upgrade package making program, and synthesizing and generating an upgrade package according to the information described by the XML. The header part in the upgrade package describes the name and type of the file to be upgraded, the position, size and the like of the file in the upgrade package, and the position to be upgraded, and the data behind the header part is the MCU or MPU file to be upgraded.
It should be noted that, conventionally, since the upgrade file is usually included in the meter application program, when the application program cannot be started normally, the MCU and MPU in the meter program cannot be upgraded. The upgrading program and the instrument application program are designed to be separated, no matter whether the instrument application program is normally started or not, the operation of the upgrading program of the MPU and the MCU cannot be influenced, and the starting condition of the upgrading program is that the insertion action of the USB flash disk is detected.
In the embodiment of the invention, the condition that the next upgrading cannot be carried out due to the upgrading failure can not occur based on the triggering of the USB flash disk inserting event. And when the upgrade package is not identified, prompting information through an interface. And prompting the upgrading progress in the upgrading process, and prompting the upgrading success when all files are upgraded.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 2 is a schematic structural diagram of a software upgrading apparatus provided in an embodiment of the present invention, where the apparatus includes:
the starting module 210 is configured to execute a mounting USB disk operation and start an upgrade program after acquiring a USB insertion event;
wherein the starting up the upgrade program further comprises: and closing the application program which is currently running in the system.
And the upgrade module 220 is configured to read an upgrade header file, and execute an upgrade operation of the MCU or the MPU according to a header file content of the upgrade packet, where the header file content at least includes a file name, a file type, and a write-in location.
Optionally, the upgrade module 220 includes:
the MCU upgrading unit is used for sending the upgrading file to the MCU through the serial port when the upgrading file is of the MCU type and ensuring data consistency based on a verification and retransmission mechanism; the BootLoader of the MCU writes the upgrade file into the flash according to the upgrade file information;
optionally, the upgrade module 220 further includes:
the MCU upgrading unit is used for backing up the upgraded file to the USB flash disk when the upgraded file is of an MPU type; and writing the upgrade file into a specified position.
Preferably, the writing the upgrade file to the specified location further includes:
writing the upgrade file in segments, reading the file data written in segments and judging whether the file data written in segments is correct or not;
and when the file written by the segments has errors, rewriting the data of the erroneous segment file.
Preferably, the backing up the upgraded file to the usb disk further includes:
and when the upgrade file is failed to be written, rewriting the backup file into the specified position of the MPU.
Preferably, the upgrade module 220 further includes:
and the display module is used for acquiring and displaying the name, the type and the upgrading progress of the upgrading file, stopping the software upgrading process when the upgrading process is detected to be interrupted, and prompting upgrading failure information.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method of upgrading software, comprising:
after a USB insertion event is acquired, carrying out USB flash disk mounting operation and starting an upgrading program;
reading an upgrade packet header file, and executing the upgrade operation of the MCU or the MPU according to the header file content of the upgrade packet, wherein the header file content at least comprises a file name, a file type and a write-in position.
2. The method of claim 1, wherein the initiating an upgrade procedure further comprises:
before starting the upgrading program, closing the application program which is currently operated by the system.
3. The method according to claim 1, wherein the performing an upgrade operation of the MCU or MPU according to the header file content of the upgrade package comprises:
when the upgrade file is of the MCU type, the upgrade file is sent to the MCU through the serial port, and the data consistency is ensured based on a verification and retransmission mechanism;
and the BootLoader of the MCU writes the upgrade file into the flash according to the upgrade file information.
4. The method according to claim 1, wherein the performing an upgrade operation of the MCU or MPU according to the header file content of the upgrade package comprises:
when the upgrade file is in an MPU type, backing up the upgraded file to a USB flash disk;
and writing the upgrade file into a specified position.
5. The method of claim 4, wherein writing the upgrade file to the specified location further comprises:
writing the upgrade file into a designated position in a segmented manner, reading the file data written in the segmented manner and judging whether the file data written in the segmented manner is correct or not;
and when the file written by the segments has errors, rewriting the data of the erroneous segment file.
6. The method of claim 4, wherein backing up the upgraded file to the USB flash disk further comprises:
and when the upgrade file is failed to be written, rewriting the backup file into the specified position of the MPU.
7. The method of claim 1, wherein reading the upgrade packet header file, and performing an upgrade operation of the MCU or the MPU according to the header file content of the upgrade packet further comprises:
and acquiring and displaying the name, the type and the upgrading progress of the upgrading file, stopping the software upgrading progress when the upgrading process is detected to be interrupted, and prompting upgrading failure information.
8. A software upgrading apparatus, comprising:
the starting module is used for executing the USB flash disk mounting operation and starting an upgrading program after acquiring the USB inserting event;
and the upgrading module is used for reading the upgrading header file and executing the upgrading operation of the MCU or the MPU according to the header file content of the upgrading packet, wherein the header file content at least comprises a file name, a file type and a writing position.
9. A readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202010613014.6A 2020-06-29 2020-06-29 Software upgrading method Pending CN111930408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010613014.6A CN111930408A (en) 2020-06-29 2020-06-29 Software upgrading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010613014.6A CN111930408A (en) 2020-06-29 2020-06-29 Software upgrading method

Publications (1)

Publication Number Publication Date
CN111930408A true CN111930408A (en) 2020-11-13

Family

ID=73316811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010613014.6A Pending CN111930408A (en) 2020-06-29 2020-06-29 Software upgrading method

Country Status (1)

Country Link
CN (1) CN111930408A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506551A (en) * 2020-12-30 2021-03-16 珠海华网科技有限责任公司 USB software upgrading method based on ARM device
CN112559008A (en) * 2020-12-15 2021-03-26 航宇救生装备有限公司 Method for on-line upgrading multi-board software

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559008A (en) * 2020-12-15 2021-03-26 航宇救生装备有限公司 Method for on-line upgrading multi-board software
CN112506551A (en) * 2020-12-30 2021-03-16 珠海华网科技有限责任公司 USB software upgrading method based on ARM device

Similar Documents

Publication Publication Date Title
US8806476B2 (en) Implementing a software installation process
CN101650662B (en) Memory device of embedded system and staring method and upgrading of firmware
US9471435B2 (en) Information processing device, information processing method, and computer program
US8132055B2 (en) Operating system-firmware interface update recovery
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
US20090254898A1 (en) Converting a device from one system to another
CN107678762B (en) System version upgrading method and device
CN104123153A (en) Apparatus and method for firmware upgrade using USB
US7725892B2 (en) Field-replaceable unit revision compatibility
CN111930408A (en) Software upgrading method
CN110289039B (en) Debugging method and device of eMMC
CN115762625A (en) Method, system, electronic device and storage medium for verifying eMMC function
CN103455288B (en) Information processor and control method
US20060129520A1 (en) System and method for automatically updating a program in a computer
EP3540598A1 (en) Method, device and server for checking a defective function
JP2005284902A (en) Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating
CN110618908A (en) Method for quickly verifying screen and machine display interface
EP4296860A1 (en) Method for running startup program of electronic device, and electronic device
CN111258617B (en) Electronic equipment
CN113900693A (en) Firmware upgrading method, device and system, electronic equipment and storage medium
CN112069009A (en) Method and device for pressure test in Recovery mode and terminal equipment
JP4735765B2 (en) Linux program startup system
CN111352764A (en) Chip repairing method, device, equipment and storage medium
JP2001209527A (en) Method for recovering preinstalled software
CN117675576A (en) Method and device for upgrading server firmware, server and electronic equipment

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