CN112445508A - ARM application program online upgrading method based on CAN bus - Google Patents
ARM application program online upgrading method based on CAN bus Download PDFInfo
- Publication number
- CN112445508A CN112445508A CN202011113731.9A CN202011113731A CN112445508A CN 112445508 A CN112445508 A CN 112445508A CN 202011113731 A CN202011113731 A CN 202011113731A CN 112445508 A CN112445508 A CN 112445508A
- Authority
- CN
- China
- Prior art keywords
- upgrading
- arm
- upgrade
- data
- bus
- 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.)
- Granted
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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1004—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method for upgrading ARM application programs on line based on a CAN bus, which realizes the purpose of upgrading the ARM application programs on line through a CAN bus interface, enters a BOOT program, enters an on-line upgrading mode when an upgrading indicating signal is low level, finishes upgrading handshake when receiving an on-line upgrading instruction through the bus within a specified time, receives on-line upgrading data through the bus, acquires the number of upgrading data packets through a header file, starts counting operation, writes the received data into an off-chip SRAM (static random access memory) and performs CRC (cyclic redundancy check) on the upgrading data. The invention solves the problem of remote online upgrading of the ARM application program, simplifies the upgrading process of the product application program based on the ARM, effectively improves the product upgrading efficiency, and saves the labor, material resources and time cost.
Description
Technical Field
The invention relates to the field of electronic circuit design, in particular to an online application program upgrading method.
Background
ARM is a 32-bit reduced instruction set processor architecture, and is widely used in many embedded system designs. The method has the characteristics of fixed instruction length, high execution efficiency, small size, low power consumption, low cost, high performance and the like. ARM is usually composed of a control unit, an arithmetic logic unit and a register. The ARM is widely applied to products such as commercial microcontrollers, automobile control systems, motor control systems, large household appliance controllers, medical equipment, network equipment, airborne equipment and the like. Due to the characteristics of low cost, high performance and the like of the ARM, the ARM is more and more widely applied.
The ARM usually integrates a FLASH memory on chip for storing codes and data. The program updating process is a process for updating the application program stored in the FLASH. The ARM common program updating mode has two modes, the emulator is programmed through a serial JTAG interface, and the serial port is programmed in the system through the serial port. In both modes, an upgrade worker needs to arrive at the field to update the ARM program through the upgrade equipment, and certain inconvenience exists in upgrade.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a method for upgrading an ARM application program on line based on a CAN bus, which realizes the purpose of upgrading the ARM application program on line through a CAN bus interface.
The technical scheme adopted by the invention for solving the technical problem comprises the following steps:
step 1: after the ARM is powered on, the ARM enters a BOOT program, firstly, an upgrade indicating signal is judged, when the upgrade indicating signal is at a high level, the upgrade is not performed correspondingly, the program jumps to an application program, and when the upgrade indicating signal is at a low level, an online upgrade mode is entered;
step 2: in an online upgrading mode, ARM waits for an online upgrading instruction of a CAN bus, and when the upgrading instruction is not received within a specified time T, ARM reports an upgrading failure message through the bus, and upgrading fails; when an online upgrading instruction is received through the bus within a specified time T, upgrading handshake is completed, and the ARM waits for the bus to send an upgrading data packet;
and step 3: the ARM receives online upgrade data through a bus, acquires the number of upgrade data packets through a header file, starts counting operation, and writes the received data into an off-chip SRAM;
in order to ensure that the transmission process of the upgrade data is not changed, after the data is written into the SRAM, the ARM performs CRC on the upgrade data, compares the CRC result with the CRC result at the end of the upgrade file, and proves that the data is not changed when the comparison is consistent; if the comparison is inconsistent, reporting upgrading failure by the bus;
and 4, step 4: the ARM executes erasing operation on the application program in the chip, and writes the application upgrading data stored in the SRAM into the chip for storage after the erasing is finished;
after the writing is finished, the ARM reads back the upgrade data written in the chip and compares and checks the upgrade data with the upgrade data in the SRAM outside the chip, and after the comparison is correct, an upgrade success message is reported through the bus, so that the on-line upgrade of the ARM application program is finished.
The upgrade data packet is composed of 3 parts as shown in fig. 2, each 8 bytes is defined as 1 packet data, the upgrade data is composed of a header file, upgrade data and a CRC check result, the header file corresponds to the number of the online upgrade data packets, and the end of the data packet is the CRC check result.
The prescribed time T is 2S.
The invention has the advantages that the problem of remote online upgrading of the ARM application program is solved due to the adoption of the ARM online upgrading scheme based on the CAN bus, the upgrading process of the product application program based on the ARM is simplified, the upgrading efficiency of the product is effectively improved, and the labor, material and time costs are saved.
Drawings
FIG. 1 is a schematic block diagram of an ARM online upgrade of the present invention.
FIG. 2 is a diagram of upgrade data package composition according to the present invention.
FIG. 3 is a flowchart illustrating an ARM online upgrade process according to the present invention.
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
Programs in the ARM are divided into a BOOT program and an application program, and the BOOT program is responsible for finishing the work of bus communication, upgrade state judgment, ARM application program upgrade data writing, data verification, state reporting and the like. And the ARM is electrified to enter a BOOT program, functions of receiving an upgrade data packet, checking data CRC, updating program data, comparing data and the like are completed according to the CAN bus instruction, and when the checking of the written program data is completed, the ARM application program is successfully upgraded.
Fig. 1 is a schematic block diagram of online upgrade, where an ARM receives data required for upgrade through a bus and completes upgrade of its own application program, and a specific upgrade flow is as follows:
a BOOT program and an application program exist in the ARM at the same time, the storage positions of the BOOT program and the application program are different, the program used for online upgrading is stored in the BOOT program, the storage positions of the BOOT program and the application program are different in storage, and the application program can be upgraded through the upgrading program in the BOOT.
The online upgrade flow chart is shown in fig. 3, and the detailed steps are as follows:
step 1: after the ARM is powered on, the ARM enters a BOOT program, firstly, an upgrade indicating signal is judged, when the upgrade indicating signal is at a high level, the upgrade is not performed correspondingly, the program jumps to an application program, and when the upgrade indicating signal is at a low level, an online upgrade mode is entered;
step 2: in the online upgrading mode, ARM waits for the online upgrading instruction of the CAN bus, and when the upgrading instruction is not received in 2S, ARM reports upgrading failure information through the bus, and upgrading fails; when an online upgrading instruction is received through the bus in 2S, upgrading handshake is completed, and the ARM waits for the bus to send an upgrading data packet;
and step 3: the ARM receives online upgrade data through a bus, acquires the number of upgrade data packets through a header file, starts counting operation, and writes the received data into an off-chip SRAM;
in order to ensure that the transmission process of the upgrade data is not changed, after the data is written into the SRAM, the ARM performs CRC on the upgrade data, compares the CRC result with the CRC result at the end of the upgrade file, and proves that the data is not changed when the comparison is consistent; if the comparison is inconsistent, reporting upgrading failure by the bus;
and 4, step 4: the ARM executes erasing operation on the application program in the chip, and writes the application upgrading data stored in the SRAM into the chip for storage after the erasing is finished;
after the writing is finished, the ARM reads back the upgrade data written in the chip and compares and checks the upgrade data with the upgrade data in the SRAM outside the chip, and after the comparison is correct, an upgrade success message is reported through the bus, so that the on-line upgrade of the ARM application program is finished.
The upgrade data packet is composed of 3 parts as shown in fig. 2, each 8 bytes is defined as 1 packet data, the upgrade data is composed of a header file, upgrade data and a CRC check result, the header file corresponds to the number of the online upgrade data packets, and the end of the data packet is the CRC check result.
Claims (3)
1. A method for upgrading ARM application program on line based on CAN bus is characterized by comprising the following steps:
step 1: after the ARM is powered on, the ARM enters a BOOT program, firstly, an upgrade indicating signal is judged, when the upgrade indicating signal is at a high level, the upgrade is not performed correspondingly, the program jumps to an application program, and when the upgrade indicating signal is at a low level, an online upgrade mode is entered;
step 2: in an online upgrading mode, ARM waits for an online upgrading instruction of a CAN bus, and when the upgrading instruction is not received within a specified time T, ARM reports an upgrading failure message through the bus, and upgrading fails; when an online upgrading instruction is received through the bus within a specified time T, upgrading handshake is completed, and the ARM waits for the bus to send an upgrading data packet;
and step 3: the ARM receives online upgrade data through a bus, acquires the number of upgrade data packets through a header file, starts counting operation, and writes the received data into an off-chip SRAM;
in order to ensure that the transmission process of the upgrade data is not changed, after the data is written into the SRAM, the ARM performs CRC on the upgrade data, compares the CRC result with the CRC result at the end of the upgrade file, and proves that the data is not changed when the comparison is consistent; if the comparison is inconsistent, reporting upgrading failure by the bus;
and 4, step 4: the ARM executes erasing operation on the application program in the chip, and writes the application upgrading data stored in the SRAM into the chip for storage after the erasing is finished;
after the writing is finished, the ARM reads back the upgrade data written in the chip and compares and checks the upgrade data with the upgrade data in the SRAM outside the chip, and after the comparison is correct, an upgrade success message is reported through the bus, so that the on-line upgrade of the ARM application program is finished.
2. The method for upgrading the ARM application program based on the CAN bus according to claim 1, wherein the method comprises the following steps:
the upgrade data packet is composed of 3 parts, each 8 bytes is specified as 1 packet data, the upgrade data is composed of a header file, upgrade data and a CRC (cyclic redundancy check) result, the header file corresponds to the number of the online upgrade data packets, and the CRC result is at the end of each data packet.
3. The method for upgrading the ARM application program based on the CAN bus according to claim 1, wherein the method comprises the following steps:
the prescribed time T is 2S.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011113731.9A CN112445508B (en) | 2020-10-17 | 2020-10-17 | ARM application program online upgrading method based on CAN bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011113731.9A CN112445508B (en) | 2020-10-17 | 2020-10-17 | ARM application program online upgrading method based on CAN bus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112445508A true CN112445508A (en) | 2021-03-05 |
CN112445508B CN112445508B (en) | 2022-10-04 |
Family
ID=74736476
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011113731.9A Active CN112445508B (en) | 2020-10-17 | 2020-10-17 | ARM application program online upgrading method based on CAN bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112445508B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113672271A (en) * | 2021-08-24 | 2021-11-19 | 天津津航计算技术研究所 | Domestic FPGA remote upgrading system and method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6735766B1 (en) * | 1999-03-03 | 2004-05-11 | Microsoft Corporation | Method and computer-readable medium for installing an upgrade to an application program |
CN102546821A (en) * | 2012-02-16 | 2012-07-04 | 北京优科利尔能源设备有限公司 | Remotely-upgraded controller area network (CAN) protocol converter |
CN103019788A (en) * | 2012-12-14 | 2013-04-03 | 上海邮政科学研究院 | Remote online upgrading method based on CAN (Controller Area Network) bus |
CN103838588A (en) * | 2012-11-20 | 2014-06-04 | 广州市暨华医疗器械有限公司 | Method for conducting online program updating on AT90 single-chip microcomputer through CAN interface |
WO2016202088A1 (en) * | 2015-06-17 | 2016-12-22 | 中兴通讯股份有限公司 | Bootstrap program upgrade method, embedded device, control device and embedded system |
CN110457056A (en) * | 2019-08-01 | 2019-11-15 | 无锡格林通安全装备有限公司 | Instrument online upgrading method and reception device based on HART bus |
CN110837385A (en) * | 2019-11-07 | 2020-02-25 | 北京特种机械研究所 | DSP application program online upgrading method based on CANopen protocol |
-
2020
- 2020-10-17 CN CN202011113731.9A patent/CN112445508B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6735766B1 (en) * | 1999-03-03 | 2004-05-11 | Microsoft Corporation | Method and computer-readable medium for installing an upgrade to an application program |
CN102546821A (en) * | 2012-02-16 | 2012-07-04 | 北京优科利尔能源设备有限公司 | Remotely-upgraded controller area network (CAN) protocol converter |
CN103838588A (en) * | 2012-11-20 | 2014-06-04 | 广州市暨华医疗器械有限公司 | Method for conducting online program updating on AT90 single-chip microcomputer through CAN interface |
CN103019788A (en) * | 2012-12-14 | 2013-04-03 | 上海邮政科学研究院 | Remote online upgrading method based on CAN (Controller Area Network) bus |
WO2016202088A1 (en) * | 2015-06-17 | 2016-12-22 | 中兴通讯股份有限公司 | Bootstrap program upgrade method, embedded device, control device and embedded system |
CN110457056A (en) * | 2019-08-01 | 2019-11-15 | 无锡格林通安全装备有限公司 | Instrument online upgrading method and reception device based on HART bus |
CN110837385A (en) * | 2019-11-07 | 2020-02-25 | 北京特种机械研究所 | DSP application program online upgrading method based on CANopen protocol |
Non-Patent Citations (3)
Title |
---|
XIAN-MIN MA等: ""Coal gangue online recognition and automation selection system based on ARM and CAN bus"", 《2005 INTERNATIONAL CONFERENCE ON MACHINE LEARNING AND CYBERNETICS》 * |
陈丽红: ""基于CAN总线的SoC产品测试系统的设计"", 《中国优秀硕士学位论文全文数据库•信息科技辑》 * |
龚行梁等: ""CAN总线实现的ZYNQ-7000程序在线升级方法"", 《单片机与嵌入式系统应用》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113672271A (en) * | 2021-08-24 | 2021-11-19 | 天津津航计算技术研究所 | Domestic FPGA remote upgrading system and method |
Also Published As
Publication number | Publication date |
---|---|
CN112445508B (en) | 2022-10-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106569847B (en) | Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network | |
CN110134415A (en) | A kind of controller and its method for upgrading software and device | |
CN113377408B (en) | High-reliability SRAM type FPGA online upgrading method and system | |
CN114281394A (en) | Method, system, equipment and medium for fast on-line upgrading program | |
CN103365701A (en) | Work method of analog card reader and analog communication system | |
CN106874054A (en) | A kind of repeater inner module program on-line upgrading method and system | |
CN102750249B (en) | The method that host computer communicates with slave computer, Apparatus and system | |
CN113094072A (en) | Vehicle upgrading method and device, electronic device and storage medium | |
CN110389772B (en) | Dual-core MCU application program upgrading method | |
CN112445508B (en) | ARM application program online upgrading method based on CAN bus | |
CN102722408B (en) | Method and apparatus for communication equipment software update | |
CN114860279A (en) | Rapid empty-film upgrading method | |
CN112698857A (en) | Data flashing method and device | |
CN108845823B (en) | Software online upgrading method based on F2812 chip | |
CN111414182B (en) | SPI-based FPGA remote upgrading method | |
US7934050B2 (en) | Microcomputer for flash memory rewriting | |
CN102866900A (en) | Method and system for updating configuration data of FPGA (Field Programmable Gate Array) control unit | |
CN114489732A (en) | Method and device for updating FPGA (field programmable Gate array) firmware of equipment and electronic equipment | |
CN112181455B (en) | Online upgrading method of microcontroller, microcontroller and storage medium | |
CN116501357A (en) | Online upgrade method of singlechip | |
CN104678292A (en) | Test method and device for CPLD (Complex Programmable Logic Device) | |
CN113380308B (en) | Data storage method for simulating EEPROM by using PFLASH software | |
CN113190259B (en) | Data programming method and device, internet module and storage medium | |
CN114115957A (en) | FPGA (field programmable Gate array) online updating method with backup and system thereof | |
CN104699514A (en) | Remote-control end system updating method and device |
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 |