CN107894899A - ROM program upgrade systems and upgrade method - Google Patents

ROM program upgrade systems and upgrade method Download PDF

Info

Publication number
CN107894899A
CN107894899A CN201711277903.4A CN201711277903A CN107894899A CN 107894899 A CN107894899 A CN 107894899A CN 201711277903 A CN201711277903 A CN 201711277903A CN 107894899 A CN107894899 A CN 107894899A
Authority
CN
China
Prior art keywords
rom
function
flash
main control
control chip
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
Application number
CN201711277903.4A
Other languages
Chinese (zh)
Other versions
CN107894899B (en
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.)
BEIJING WINNER MICROELECTRONICS Co Ltd
Original Assignee
BEIJING WINNER MICROELECTRONICS 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 BEIJING WINNER MICROELECTRONICS Co Ltd filed Critical BEIJING WINNER MICROELECTRONICS Co Ltd
Priority to CN201711277903.4A priority Critical patent/CN107894899B/en
Publication of CN107894899A publication Critical patent/CN107894899A/en
Application granted granted Critical
Publication of CN107894899B publication Critical patent/CN107894899B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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]

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 discloses ROM program upgrade systems and upgrade method, including:Host computer, communication transfer interface module, main control chip and outside Flash;The RS232 interface of host computer is connected with communication transfer interface module, and communication transfer interface module is connected with the UART interface of main control chip, and the SPI interface of main control chip is connected with outside Flash, and outside Flash is used to write packed upgrade file;Main control chip includes RAM, internal Flash and ROM, ROM and include an array of function pointer, and each array of function pointer correspond to different ROM power functions execution addresses, and ROM power functions are performed into address during system operation is loaded into RAM;The present invention supports to be jumped to after the completion of any legal address operation of internal Flash code spaces by ROM Space simultaneously returns to ROM Space, can solve the problems, such as existing Flash bad blocks and process integrity.

Description

ROM program upgrade systems and upgrade method
Technical field
The present invention relates to ROM program upgrade techniques field, more particularly to ROM program upgrade systems and upgrade method.
Background technology
Traditional ROM programs are just solidificated in chip ROM memory in chip production manufacturing process, and its major function is Application program is downloaded to by internal Flash code spaces by a kind of available serial peripheral (UART, CAN, USB, I2C etc.) In.
Publication No. CN102243587A Chinese patent is disclosed in a kind of embedded system to the upgrading side of ROM programs Method, the system need to open up one piece of independent program upgrading area in Flash to preserve ROMPaq bag, soft when needing to upgrade During part, the program for making ROMPaq bag and ROMPaq bag being written to Flash upgrades area.Upgrade calling program module detection Whether there is ROMPaq bag in Flash, if not finding described ROMPaq bag, perform the original program in rom software.Should Scheme upgrades area to carry out the upgrading of ROM programs using fixed Flash, has service life because Flash is erasable, frequently Erasable same Flash areas can cause the appearance of bad block, the reliability of ROM upgradings reduces;Meanwhile the program is not to replacing The integrality of program is that the correctness of data is verified.
The content of the invention
Weak point present in regarding to the issue above, the present invention provide ROM program upgrade systems and upgrade method.
To achieve the above object, the present invention provides a kind of ROM program upgrade systems, including:Host computer, for RS232 turn UART communication transfer interface module, main control chip and outside Flash;
The RS232 interface of the host computer is connected with communication transfer interface module, the communication transfer interface module and main control chip UART interface is connected, and the SPI interface of the main control chip is connected with outside Flash, and the outside Flash is packed for writing Upgrade file;
The main control chip includes RAM, internal Flash and ROM, and the ROM includes an array of function pointer, each function Array of pointers corresponds to different ROM power functions and performs address, is loaded into ROM power functions execution address during system operation In RAM.
As a further improvement on the present invention, the main control chip is MCU.
As a further improvement on the present invention, the outside Flash is SPI Flash.
The present invention also provides a kind of upgrade method of ROM program upgrade systems, including:
Step 1, packed upgrade file write in outside Flash;
Step 2, host computer issue the instruction of renewal ROM programs to main control chip, and reading is outer after main control chip receives instruction Portion Flash specifies the data head of address into RAM, and verifies the correct of data head according to the check information included in data head Property;
After step 3, data head are verified, the data in data head are parsed, the code in outside Flash is read and write Enter the inside Flash address spaces by being specified in data head, and according to the code check included in data head and carry out Validation Code The correctness of data;
By rear, the instruction that host computer issues in judgment step 2 is function replacement instruction or increasing for step 4, code verification Add New function function instruction;
Step 5, if function replacement instruction, then the function provided in outside Flash is provided and replaces related data, is replaced The corresponding of array of function pointer in RAM performs address;When performing corresponding function, jump to internal Flash spaces and perform, After the completion of return to ROM Space;
If the execution entrance of increase New function function instruction, then the information parsing what's new function in data head Address, call new power function.
As a further improvement on the present invention, also include between step 1 and step 2:
Main control chip initialization and the UART interface of communication transfer interface module after system electrification, and by communication transfer interface module with Host computer communicates, while main control chip initialization and outside Flash SPI interface;Host computer is completed by communication transfer interface module Communicated with the data of main control chip UART interface.
As a further improvement on the present invention, in steps of 5, it is always individual including replacement function to replace related data for the function Number, the index of new function respective function array of pointers and new function perform address.
Compared with prior art, beneficial effects of the present invention are:
Invention enhances the flexibility of rom software, one directly runs pre-defined ROM power functions, secondly such as Fruit finds that existing capability is unable to meet demand in ROM, can be realized by the function that function is replaced, thirdly ROM upgrading can be with Carried out just for the partial function for needing to change, the replacement without carrying out whole ROM function table, its four ROM program function Data check and integrity verification are carried out when function is replaced, only verification is by can just carry out ROM upgradings.
Brief description of the drawings
Fig. 1 is the frame diagram of ROM program upgrade systems disclosed in an embodiment of the present invention.
In figure:
10th, host computer;20th, communication transfer interface module;30th, main control chip;31、RAM;32nd, internal Flash;33、ROM;40、 Outside Flash.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is The part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
In the description of the invention, it is necessary to explanation, term " " center ", " on ", " under ", "left", "right", " vertical ", The orientation or position relationship of the instruction such as " level ", " interior ", " outer " be based on orientation shown in the drawings or position relationship, merely to Be easy to the description present invention and simplify description, rather than instruction or imply signified device or element must have specific orientation, With specific azimuth configuration and operation, therefore it is not considered as limiting the invention.In addition, term " first ", " second ", " the 3rd " is only used for describing purpose, and it is not intended that instruction or hint relative importance.
In the description of the invention, it is also necessary to explanation, unless otherwise clearly defined and limited, term " installation ", " connected ", " connection " should be interpreted broadly, for example, it may be being fixedly connected or being detachably connected, or integratedly be connected Connect;Can be mechanical connection or electrical connection;Can be joined directly together, can also be indirectly connected by intermediary, can To be the connection of two element internals.For the ordinary skill in the art, above-mentioned term can be understood with concrete condition Concrete meaning in the present invention.
The present invention is described in further detail below in conjunction with the accompanying drawings:
In order to solve the problems, such as existing Flash bad blocks and process integrity, the present invention provides a kind of highly reliable ROM programs Upgrade-system and upgrade method, while support that jumping to internal any legal address of Flash code spaces by ROM Space has run Into rear return ROM Space.
As shown in figure 1, the present invention provides a kind of ROM program upgrade systems, including:Host computer 10, for RS232 turn UART Communication transfer interface module 20, main control chip 30 and outside Flash 40;Wherein:Main control chip 30 is MCU, and outside Flash40 is SPI Flash。
The RS232 interface of the position machine 10 of the present invention is connected with communication transfer interface module 20, communication transfer interface module 20 and master control core The UART interface of piece 30 is connected, and the SPI interface of main control chip 30 is connected with outside Flash 40, and outside Flash 40 is used to write Packed upgrade file.
Main control chip 30 includes comprising a function referring in RAM 31, internal Flash 32 and the program of ROM 33, ROM 33 Pin array, each array of function pointer correspond to different ROM power functions and perform address, can be by ROM power functions during system operation Perform address to be loaded into RAM, the function for entering only replace respective items in RAM when line function is replaced performs address.
The present invention provides a kind of upgrade method based on ROM program upgrade systems, including:
Step 1, when needing to upgrade ROM programs, packed upgrade file is write in outside Flash;System electrification Main control chip initialization and the UART interface of communication transfer interface module afterwards, and communicated by communication transfer interface module with host computer, simultaneously Main control chip initializes the SPI interface with outside Flash;Host computer is completed to connect with main control chip UART by communication transfer interface module The data communication of mouth.
Step 2, host computer issue the instruction of renewal ROM programs to main control chip, instruct as function replacement instruction or increase New function function instruction;The outside Flash of reading specifies the data head of address into RAM after main control chip receives instruction, and according to The correctness of the check information checking data head included in data head;
After step 3, data head are verified, the data in data head are parsed, the code in outside Flash is read and write Enter the inside Flash address spaces by being specified in data head;Data are completed after outside Flash writes internal Flash, further according to The code check included in data head and the correctness for carrying out Validation Code data;
By rear, the instruction that host computer issues in judgment step 2 is function replacement instruction or increasing for step 4, code verification Add New function function instruction;
Step 5, if function replacement instruction, then the function provided in outside Flash is provided and replaces related data, function replaces Change related data packets and include replacement function total number, the index of new function respective function array of pointers and new function execution address; Replace the corresponding of the array of function pointer in RAM and perform address;So when performing corresponding function, inside can be jumped to Flash spaces perform, after the completion of return to ROM Space.
If the execution entrance of increase New function function, then the information parsing what's new function in data head Location, call new power function.
The calling of the array of function pointer preserved in ROM programs of the present invention and replacement, replacement function storage address can match somebody with somebody logical Cross in data header information and specify, the inside Flash spaces of erasable fixing address will not be gone to reach load balancing.
Invention enhances the flexibility of rom software, one directly runs pre-defined ROM power functions, secondly such as Fruit finds that existing capability is unable to meet demand in ROM, can be realized by the function that function is replaced, thirdly ROM upgrading can be with Carried out just for the partial function for needing to change, the replacement without carrying out whole ROM function table, its four ROM program function Data check and integrity verification are carried out when function is replaced, only verification is by can just carry out ROM upgradings.
The preferred embodiments of the present invention are these are only, are not intended to limit the invention, for those skilled in the art For member, the present invention can have various modifications and variations.Any modification within the spirit and principles of the invention, being made, Equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (6)

  1. A kind of 1. ROM program upgrade systems, it is characterised in that including:Host computer, the communication modulus of conversion for turning for RS232 UART Block, main control chip and outside Flash;
    The RS232 interface of the host computer is connected with communication transfer interface module, the UART of the communication transfer interface module and main control chip Interface is connected, and the SPI interface of the main control chip is connected with outside Flash, and the outside Flash is used to write packed liter Level file;
    The main control chip includes RAM, internal Flash and ROM, and the ROM includes an array of function pointer, each function pointer Array corresponds to different ROM power functions and performs address, ROM power functions execution address is loaded into RAM during system operation.
  2. 2. ROM program upgrade systems as claimed in claim 1, it is characterised in that the main control chip is MCU.
  3. 3. ROM program upgrade systems as claimed in claim 1, it is characterised in that the outside Flash is SPI Flash.
  4. A kind of 4. upgrade method of ROM program upgrade systems as claimed in claim 1, it is characterised in that including:
    Step 1, packed upgrade file write in outside Flash;
    Step 2, host computer issue the instruction of renewal ROM programs to main control chip, and main control chip reads outside after receiving instruction Flash specifies the data head of address into RAM, and the correctness of data head is verified according to the check information included in data head;
    After step 3, data head are verified, parse data head in data, by the code in outside Flash read and write by The inside Flash address spaces specified in data head, and according to the code check included in data head and carry out Validation Code data Correctness;
    By rear, the instruction that host computer issues in judgment step 2 is that function replacement instruction or increase are new for step 4, code verification Power function instructs;
    Step 5, if function replacement instruction, then the function provided in outside Flash is provided and replaces related data, is replaced in RAM The corresponding of array of function pointer perform address;When performing corresponding function, jump to internal Flash spaces and perform, complete After return to ROM Space;
    If the execution entrance of increase New function function instruction, then the information parsing what's new function in data head Location, call new power function.
  5. 5. the upgrade method of ROM program upgrade systems as claimed in claim 4, it is characterised in that step 1 and step 2 it Between also include:
    Main control chip initialization and the UART interface of communication transfer interface module after system electrification, and by communication transfer interface module with it is upper Machine communicates, while main control chip initialization and outside Flash SPI interface;Host computer is completed by communication transfer interface module and master Control the data communication of chip UART interface.
  6. 6. the upgrade method of ROM program upgrade systems as claimed in claim 4, it is characterised in that in steps of 5, the letter Number replaces related data and performs ground including replacement function total number, the index of new function respective function array of pointers and new function Location.
CN201711277903.4A 2017-12-06 2017-12-06 ROM program upgrading system and upgrading method Active CN107894899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711277903.4A CN107894899B (en) 2017-12-06 2017-12-06 ROM program upgrading system and upgrading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711277903.4A CN107894899B (en) 2017-12-06 2017-12-06 ROM program upgrading system and upgrading method

Publications (2)

Publication Number Publication Date
CN107894899A true CN107894899A (en) 2018-04-10
CN107894899B CN107894899B (en) 2021-04-06

Family

ID=61806140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711277903.4A Active CN107894899B (en) 2017-12-06 2017-12-06 ROM program upgrading system and upgrading method

Country Status (1)

Country Link
CN (1) CN107894899B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933358A (en) * 2019-01-28 2019-06-25 金卡智能集团股份有限公司 For reducing the control method of measuring equipment program upgrading amount
CN110308953A (en) * 2019-04-01 2019-10-08 深圳市德名利电子有限公司 ROM code function amending method based on 32 MCU master controls
CN112463230A (en) * 2020-11-23 2021-03-09 浙江地芯引力科技有限公司 Program operation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174680A1 (en) * 2005-11-08 2007-07-26 Mstar Semiconductor, Inc. Method for patching built-in code in read only memory
CN102243587A (en) * 2010-05-14 2011-11-16 康佳集团股份有限公司 Method for upgrading read only memory (ROM) program in embedded system
CN102945174A (en) * 2012-11-08 2013-02-27 大连捷成实业发展有限公司 Method for upgrading singlechip program by means of connected off-chip Flash
EP2778910A1 (en) * 2013-03-15 2014-09-17 Maxim Integrated Products, Inc. Systems and methods to extend rom functionality
CN104090796A (en) * 2014-07-08 2014-10-08 成都万维图新信息技术有限公司 Embedded device program updating method and system
US20150160940A1 (en) * 2013-12-09 2015-06-11 Dspace Digital Signal Processing And Control Engineering Gmbh Method for changing the software in the memory of an electronic control unit

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174680A1 (en) * 2005-11-08 2007-07-26 Mstar Semiconductor, Inc. Method for patching built-in code in read only memory
CN102243587A (en) * 2010-05-14 2011-11-16 康佳集团股份有限公司 Method for upgrading read only memory (ROM) program in embedded system
CN102945174A (en) * 2012-11-08 2013-02-27 大连捷成实业发展有限公司 Method for upgrading singlechip program by means of connected off-chip Flash
EP2778910A1 (en) * 2013-03-15 2014-09-17 Maxim Integrated Products, Inc. Systems and methods to extend rom functionality
US20150160940A1 (en) * 2013-12-09 2015-06-11 Dspace Digital Signal Processing And Control Engineering Gmbh Method for changing the software in the memory of an electronic control unit
CN104090796A (en) * 2014-07-08 2014-10-08 成都万维图新信息技术有限公司 Embedded device program updating method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933358A (en) * 2019-01-28 2019-06-25 金卡智能集团股份有限公司 For reducing the control method of measuring equipment program upgrading amount
CN109933358B (en) * 2019-01-28 2022-06-24 金卡智能集团股份有限公司 Control method for reducing program upgrading amount of metering equipment
CN110308953A (en) * 2019-04-01 2019-10-08 深圳市德名利电子有限公司 ROM code function amending method based on 32 MCU master controls
CN112463230A (en) * 2020-11-23 2021-03-09 浙江地芯引力科技有限公司 Program operation method and device, electronic equipment and storage medium
CN112463230B (en) * 2020-11-23 2023-08-25 浙江地芯引力科技有限公司 Program running method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107894899B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
US8086919B2 (en) Controller having flash memory testing functions, and storage system and testing method thereof
CN107894899A (en) ROM program upgrade systems and upgrade method
CN101814318B (en) Multi level cell NAND flash storage system as well as controller and access method thereof
CN101110039B (en) Terminal unit self-installing and self-starting system and method thereof
CN102945173B (en) User program online upgrade system and upgrade method
TWI443512B (en) Block management method, memory controller and memory stoarge apparatus
CN101699402B (en) Multi-mode startup embedded system
CN103942061A (en) Battery firmware updating method, portable electronic device and rechargeable battery module
CN102163155A (en) Upgrade controlling device and method for upgrading memory device
CN109656608A (en) A kind of MCU firmware upgrade method and its relevant device
CN100473090C (en) A system for hardware drive program of intelligent loading mobile phone
CN101576853A (en) Data access method and controller and memory system using same
CN107861764A (en) For the program upgrade system of cooking appliance, method and cooking appliance
CN109189434A (en) A kind of online upgrading method of electric energy meter
CN114138333B (en) Program loading method and related device
CN111459744A (en) Firmware burning method and firmware debugging method of video processing chip
CN102768331B (en) The MCU test set of a kind of OTP type and testing method thereof
CN109857433B (en) Single chip microcomputer software upgrading tool and method
US8943289B2 (en) Data moving method for flash memory module, and memory controller and memory storage apparatus using the same
CN102890645A (en) Memory storage device, memory controller and data writing method
CN107168750A (en) A kind of firmware upgrade guard method and system
CN103440334A (en) Driver matching method and device of mobile terminal
CN103294837B (en) A kind of verifying and debugging method and system of integrated circuit
CN106597663A (en) Head-mounted display equipment, associated equipment and method for enabling equipment compatible with different external devices
KR20150072963A (en) Multisystem, and method of booting the same

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