CN110673872B - Improved IAP upgrading code method, system and equipment to be upgraded - Google Patents
Improved IAP upgrading code method, system and equipment to be upgraded Download PDFInfo
- Publication number
- CN110673872B CN110673872B CN201910840419.0A CN201910840419A CN110673872B CN 110673872 B CN110673872 B CN 110673872B CN 201910840419 A CN201910840419 A CN 201910840419A CN 110673872 B CN110673872 B CN 110673872B
- Authority
- CN
- China
- Prior art keywords
- iap
- code
- upgraded
- equipment
- upgrade
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/654—Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of software, and provides an improved IAP upgrading code method, an improved IAP upgrading system and to-be-upgraded equipment, wherein the to-be-upgraded equipment comprises an IAP interface and a chip, the chip comprises a ROM and a FLASH, the IAP_BSP code is pre-stored in the ROM, the IAP_USER code is pre-stored in the FLASH, the IAP host and the to-be-upgraded equipment are provided with the IAP interface for communication with each other, and an IAP developer only needs to develop the IAP_USER code and upgrade an APP application code on the to-be-upgraded equipment through the IAP interface without considering a chip programming process with complex bottom layers, so that the IAP difficulty and the development and debugging cost of products are greatly reduced.
Description
[ technical field ]
The present invention relates to the field of software technologies, and in particular, to an improved IAP upgrade code method, system, and device to be upgraded.
Background art
In electronic products, a common code upgrading method is IAP, the english of which is In Application Programming, and the IAP upgrading principle is: the code storage medium stores APP codes and upgrade processing codes, the English of the APP is called Application, and the Application software is called Application software, when the APP codes are identified to upgrade commands in running, the Application codes are jumped to the upgrade processing code area for execution, new codes are written into the Application codes area according to the received upgrade commands, and after the upgrade is successful, the codes after the upgrade is reset or executed next time.
Because IAP and application schemes are closely related, communication media and communication protocols of different schemes are varied, developers often make different IAP communication media and protocols according to specific application schemes, for example, SD card can be used for upgrading in a scheme supporting SD card, and similarly, the IAP communication media and protocols can be upgraded in a wired mode such as UART, SWD, SPI, USB and a wireless mode such as Bluetooth, WIFI; IAP is basically completed by a developer himself, IAP codes are usually put together with application codes and only stored, old codes APP1 are erased when IAP upgrades, new codes APP2 are written, and no APP is run if power is lost and restarted before writing new codes APP2 is completed, that is, IAP upgrades have a risk of failure. This has the following problems: firstly, a developer is required to know a complex chip programming process to be capable of performing IAP, and for most software developers, the development of the bottom layer is often difficult to understand and debug, and the development difficulty is high; secondly, IAP codes are stored in user codes, so that the IAP process is often limited by incapability of powering down and the like, and the IAP process is restarted without APP code operation after powering down, so that the risk of IAP upgrading failure exists.
Summary of the invention
The invention provides an improved IAP upgrading code method, an improved IAP upgrading system and equipment to be upgraded, which can realize IAP upgrading without knowing complicated chip programming flow and reduce development difficulty. The invention is realized by the following technical scheme:
the first aspect of the present invention is thus realized, an improved IAP upgrade code method, for an IAP host to upgrade an APP application code on a device to be upgraded through an IAP interface; the method comprises the following steps:
(1) Pre-storing IAP_BSP codes in ROM of a chip of the equipment to be upgraded; (2) Pre-storing IAP_USER codes in FLASH of a chip of equipment to be upgraded;
(3) Powering up equipment to be upgraded, executing an APP application code, and initializing an IAP interface;
(4) The device to be upgraded confirms whether the IAP interface receives the IAP request of the IAP host, if yes, the step (5) is entered, otherwise, the IAP request is continuously tried to be received;
(5) Executing IAP_UESR codes by the equipment to be upgraded, and analyzing the received IAP request by the instruction;
(6) The IAP_USER code analyzes whether an IAP command sent by the host is valid, if yes, the step (7) is entered, and if not, the step (4) is returned;
(7) The IAP_USER code calls the IAP_BSP code to complete the command function appointed by the IAP host;
(8) The IAP_USER code confirms whether the IAP_BSP code is executed successfully, if yes, the step (9) is entered, otherwise, the step (4) is returned;
(9) The IAP_USER code confirms whether the IAP upgrade is completed, if yes, the process of the IAP upgrade code is ended, otherwise, the step (4) is returned.
Preferably, the original old code APP1 is reserved in the IAP upgrading process, meanwhile, the upgrading code is additionally stored as a code APP2, and the latest code APP2 is reset, detected and operated.
The second aspect of the present invention is realized in that the device to be upgraded comprises an IAP interface and a chip, the chip comprises a ROM and a FLASH, the iap_bsp code is pre-stored in the ROM, and the iap_user code is pre-stored in the FLASH.
The third aspect of the present invention is realized in that an improved IAP upgrade code system comprises an IAP host and a device to be upgraded, wherein IAP interfaces for communication with each other are provided on the IAP host and the device to be upgraded, a chip is provided on the device to be upgraded, and the chip comprises a ROM and a FLASH; the system performs the method of the improved IAP upgrade code described above.
Preferably, the IAP interface is applied in UART, SPI, USB, SDIO, IIC, WIFI or bluetooth.
The beneficial effects of the invention are as follows:
compared with the prior art, the method has the advantages that the IAP is realized in the way of storing the IAP_BSP codes in the chip ROM, an IAP developer only needs to develop the IAP_USER codes, and the APP codes on the equipment to be upgraded are upgraded through the IAP interface, so that the complex chip programming process of the bottom layer is not required to be considered, and the IAP difficulty and the development and debugging cost of the product are greatly reduced; the original old codes APP1 are reserved in the IAP upgrading process, the upgrading codes are additionally stored as codes APP2, the latest codes APP2 are reset, and the abnormality that the APP operates when power is turned off and restarted in the upgrading process is avoided.
Description of the drawings
FIG. 1 is a schematic illustration of the connection of an embodiment of the present invention;
FIG. 2 is a schematic diagram of portions of a chip in the device to be upgraded of FIG. 1;
FIG. 3 is a schematic diagram of the steps of a method of practicing the invention;
wherein the reference numerals are as follows: 10. an IAP host; 20. equipment to be upgraded; 30. an IAP interface; 40. and a chip.
The following describes the embodiments of the present invention in further detail with reference to the drawings.
Best mode for carrying out the invention
The preferred embodiment of the present invention is shown in fig. 1-3, which are used for supplementing the description of the text portion of the specification with figures to facilitate understanding of the technical features of the present invention and the technical solution as a whole, but should not be construed as limiting the present invention. Technical words that have not been specifically explained in the description of the present invention are to be considered as broad meanings in the prior art.
As shown in fig. 1-3, an improved IAP upgrade code system includes an IAP host 10 and a device to be upgraded 20, IAP interfaces 30 for communicating with each other are provided on the IAP host 10 and the device to be upgraded 20, and a VCC power line and a GND ground line are further required to be electrically connected between the IAP host 10 and the device to be upgraded 20, preferably, the IAP interfaces 30 may be set to a serial bus connection mode of UART, SPI, USB, SDIO or IIC, or a wireless connection mode of WIFI or bluetooth according to the needs of a user. The device 20 to be upgraded is provided with a chip 40, the chip 40 comprises a ROM and a FLASH, the ROM is called Read Only Memory, an iap_bsp code for APP writing operation is pre-stored in the ROM, BSP in the iap_bsp code is abbreviated as english Board Support Package, the iap_bsp code is translated into a board level supporting package and is a layer between the main board hardware and an operating system, the iap_bsp code belongs to a part of the operating system, the iap_bsp code is software specially customized for a protocol of a developer of the chip 40, the iap_bsp code is responsible for operations of erasing, reading and security management of the chip 40, and is convenient to operate. The FLASH is the refreshable memory, and the IAP_BSP code is responsible for erasure, writing, reading, checking and locking of the FLASH of the chip 40, so that the safety management is convenient to operate. After the chip 40 containing the IAP_BSP code is received by a developer, the IAP_USER code is written in the FLASH of the chip 40, and is responsible for receiving and analyzing commands, and the IAP_USER code belongs to a relatively shallow display and is close to the thinking habit of people, so that the IAP_USER code is simple and easy to understand and debug by the developer, and the IAP_USER code and the IAP_BSP code are both provided with interfaces at a software level, namely interface functions, and can call the IAP_BSP code through the IAP_BSP interface, and the IAP_USER code and the IAP_BSP code are matched into an improved IAP upgrading code method. The IAP developer does not need to consider the programming process of the chip 40 with complex bottom layer, realizes the code upgrading of the product, namely IAP by the way of embedding the IAP_BSP code in the ROM of the chip 40, and greatly reduces the IAP difficulty and development and debugging cost of the product.
The embodiment also provides an improved IAP upgrading code method, which is used for upgrading the APP application code on the device 20 to be upgraded by the IAP host 10 through the IAP interface 30; the method comprises the following steps:
(1) Pre-storing IAP_BSP codes in ROM of a chip of the equipment to be upgraded; (2) Pre-storing IAP_USER codes in FLASH of a chip of equipment to be upgraded;
(3) Powering up equipment to be upgraded, executing an APP application code, and initializing an IAP interface;
(4) The device to be upgraded confirms whether the IAP interface receives the IAP request of the IAP host, if yes, the step (5) is entered, otherwise, the IAP request is continuously tried to be received;
(5) Executing IAP_UESR codes by the equipment to be upgraded, and analyzing the received IAP request by the instruction;
(6) The IAP_USER code analyzes whether an IAP command sent by the host is valid, if yes, the step (7) is entered, and if not, the step (4) is returned;
(7) The IAP_USER code calls the IAP_BSP code to complete the command function appointed by the IAP host;
(8) The IAP_USER code confirms whether the IAP_BSP code is executed successfully, if yes, the step (9) is entered, otherwise, the step (4) is returned;
(9) The IAP_USER code confirms whether the IAP upgrade is completed, if yes, the process of the IAP upgrade code is ended, otherwise, the step (4) is returned.
Specifically, while the original old code APP1 is reserved in the IAP upgrading process, the upgrading code is additionally saved as the code APP2, and the latest code APP2 is reset, detected and operated. And the abnormality of APP operation caused by power failure and restarting in the upgrading process is avoided.
The above embodiments are merely preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood that the present invention is not limited to the above embodiments, but is limited to the following modifications, variations and modifications.
Claims (4)
1. An improved IAP upgrading code method is used for an IAP host to upgrade an APP application code on equipment to be upgraded through an IAP interface; characterized in that the method comprises the steps of:
(1) Pre-storing IAP_BSP codes in ROM of a chip of the equipment to be upgraded;
(2) Pre-storing IAP_USER codes in FLASH of a chip of equipment to be upgraded;
(3) Powering up equipment to be upgraded, executing an APP application code, and initializing an IAP interface;
(4) The device to be upgraded confirms whether the IAP interface receives the IAP request of the IAP host, if yes, the step (5) is entered, otherwise, the IAP request is continuously tried to be received;
(5) Executing IAP_UESR codes by the equipment to be upgraded, and analyzing the received IAP request by the instruction;
(6) The IAP_USER code analyzes whether an IAP command sent by the host is valid, if yes, the step (7) is entered, and if not, the step (4) is returned;
(7) The IAP_USER code calls the IAP_BSP code to complete the command function appointed by the IAP host;
(8) The IAP_USER code confirms whether the IAP_BSP code is executed successfully, if yes, the step (9) is entered, otherwise, the step (4) is returned;
(9) The IAP_USER code confirms whether the IAP upgrade is completed, if yes, the process of the IAP upgrade code is ended, otherwise, the step (4) is returned.
2. The method of claim 1, wherein the upgrade code is additionally saved as code APP2 while retaining the original old code APP1 during IAP upgrade, and the latest code APP2 is reset detected and run.
3. An improved IAP upgrading code system comprises an IAP host and equipment to be upgraded, wherein IAP interfaces for communication are arranged on the IAP host and the equipment to be upgraded, a chip is arranged on the equipment to be upgraded, and the chip comprises ROM and FLASH; characterized in that the system performs the method of claim 1.
4. The system of an improved IAP upgrade code of claim 3, wherein the IAP interface application scheme is UART, SPI, USB, SDIO, IIC, WIFI or bluetooth.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910840419.0A CN110673872B (en) | 2019-09-06 | 2019-09-06 | Improved IAP upgrading code method, system and equipment to be upgraded |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910840419.0A CN110673872B (en) | 2019-09-06 | 2019-09-06 | Improved IAP upgrading code method, system and equipment to be upgraded |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110673872A CN110673872A (en) | 2020-01-10 |
CN110673872B true CN110673872B (en) | 2023-05-26 |
Family
ID=69076580
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910840419.0A Active CN110673872B (en) | 2019-09-06 | 2019-09-06 | Improved IAP upgrading code method, system and equipment to be upgraded |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110673872B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109683941A (en) * | 2018-12-27 | 2019-04-26 | 四川九洲空管科技有限责任公司 | A kind of answering machine method for upgrading software based on single-chip on-line loaded |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247615B (en) * | 2008-03-07 | 2011-02-02 | 上海华为技术有限公司 | Method and device for improving reliability of communication equipment |
CN103019788A (en) * | 2012-12-14 | 2013-04-03 | 上海邮政科学研究院 | Remote online upgrading method based on CAN (Controller Area Network) bus |
CN106569847B (en) * | 2016-10-14 | 2020-03-31 | 数源科技股份有限公司 | Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network |
-
2019
- 2019-09-06 CN CN201910840419.0A patent/CN110673872B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109683941A (en) * | 2018-12-27 | 2019-04-26 | 四川九洲空管科技有限责任公司 | A kind of answering machine method for upgrading software based on single-chip on-line loaded |
Also Published As
Publication number | Publication date |
---|---|
CN110673872A (en) | 2020-01-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110231952B (en) | ECU program backup and cyclic upgrade control method and device | |
CN101431441B (en) | Method for on-line updating FPGA system embedded with CPU | |
CN104123153A (en) | Apparatus and method for firmware upgrade using USB | |
US20040015941A1 (en) | Information-processing apparatus equipped with nonvolatile memory device and firmware-updating method for use in the apparatus | |
CN111813428A (en) | Method and device for upgrading terminal firmware, electronic equipment and storage medium | |
US20090119659A1 (en) | Method of Computer Based Data Card Software Downloading and Updating | |
CN101650662A (en) | Memory device of embedded system and staring method and upgrading of firmware | |
CN105579953A (en) | Flexible bootstrap code architecture | |
KR20210058896A (en) | Memory cards, memory card adapters and terminal devices | |
CN105760191A (en) | Embedded system equipment programming mass production method | |
JP2010140266A (en) | Electronic device system and electronic device | |
CN112947978A (en) | Method for upgrading firmware based on chip usbhid, terminal device and computer readable storage medium | |
CN112667265A (en) | Method and device for updating bootstrap program | |
CN101505331A (en) | Method and apparatus for updating system software of smart phone | |
CN114138295A (en) | Method, device and system for upgrading application program firmware of electronic equipment | |
CN110673872B (en) | Improved IAP upgrading code method, system and equipment to be upgraded | |
CN110908733B (en) | Working mode determining method and device, and control method and device | |
CN116954674A (en) | eMMC firmware upgrading method, firmware upgrading equipment and storage device | |
KR100860402B1 (en) | Device and method for upgradin system using two step bootloader | |
CN114996717A (en) | Upgrade program design method for preventing error erasure | |
CN102467522B (en) | Self-programming method and device of file system based on NAND flash | |
CN211427090U (en) | Micro control unit device | |
CN114296764A (en) | System upgrading method and device, storage medium and electronic equipment | |
CN118092989B (en) | Firmware upgrading method, system, equipment and medium of memory | |
CN108052337A (en) | A kind of firmware upgrade method and device of eMMC production tools |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |