WO2017075852A1 - Method and system for protecting working program of mcu - Google Patents

Method and system for protecting working program of mcu Download PDF

Info

Publication number
WO2017075852A1
WO2017075852A1 PCT/CN2015/095517 CN2015095517W WO2017075852A1 WO 2017075852 A1 WO2017075852 A1 WO 2017075852A1 CN 2015095517 W CN2015095517 W CN 2015095517W WO 2017075852 A1 WO2017075852 A1 WO 2017075852A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
mcu
working
storage module
download
Prior art date
Application number
PCT/CN2015/095517
Other languages
French (fr)
Chinese (zh)
Inventor
陈海燕
王志刚
Original Assignee
邦彦技术股份有限公司
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 邦彦技术股份有限公司 filed Critical 邦彦技术股份有限公司
Publication of WO2017075852A1 publication Critical patent/WO2017075852A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present invention relates to the field of chip work program control, and in particular, to a method and system for protecting an MCU work program.
  • MCU Microcontroller Unit, Micro Control Unit.
  • Running memory refers to the memory when the MCU runs the program, also called RAM (referred to as the memory).
  • Flash Flash
  • Memory generally referred to as “Flash”
  • Flash is a type of memory device and is a kind of non-volatile memory.
  • an object of the present invention is to provide a method for protecting a working MCU that can facilitate the upgrading of a working program, is convenient to use, and reduces the occupation of an MCU bus resource.
  • another object of the present invention is to provide a protection MCU working program system which can facilitate the upgrading of the working program, is convenient to use, and reduces the occupation of the MCU bus resources.
  • a method for protecting an MCU working program comprising the steps of: S1, running a downloading program; S2, determining, by the downloading program, whether the working program should be run or should be upgraded, and if the working program is running, proceeding to step S3, if an upgrade is required
  • the program proceeds to step S4; S3, the download program moves the working program code from the external storage module to the corresponding address in the memory, and the MCU runs the working program after the completion of the movement; S4, the MCU receives the working program from the upper computer, and the download program works.
  • the program is written to the corresponding location in the external memory module, and then resets to repeat steps S1 and S2.
  • the download program and the work program are stored in different storage sectors of the same external storage module.
  • the external storage module is a FLASH memory.
  • the method for protecting the working program of the MCU further comprises the steps of: S01, first moving the BOOT code from the external storage module into the memory, and then running the BOOT code; S02, the BOOT code performing the action: moving the download program from the external storage module And / or work program to the corresponding address in the memory, after the completion of the move, perform step S1.
  • a system for protecting an MCU working program the system for implementing a method for protecting an MCU working program, the system comprising: an MCU, respectively connected to an external storage module and a memory, for running a downloading program and a working program; and an external storage module
  • the external storage module includes a first storage sector for storing a download program, a second storage sector for storing a work program, and a memory for The MCU's commands store download programs and/or work programs.
  • the first storage sector stores a BOOT code for guiding the MCU to move and run the download program and/or the work program.
  • the external storage module is a FLASH memory.
  • the invention firstly downloads the program by burning in the FLASH of the MCU, and after the MCU is powered on, the downloading program is run, and then the downloading program is used to upgrade the working program or to run the working program, so that the working program can be conveniently deleted after being deleted.
  • the implementation is upgraded and run.
  • a part of the sector storage program of the external storage module another part of the sector stores the working program, which saves the MCU interface bus resources, thereby saving cost; again, the invention has high security and convenient use.
  • the operation is stable and reliable, with good economic and social benefits.
  • the invention can be widely applied to various MCU work program management systems.
  • FIG. 1 is a schematic structural diagram of an embodiment of a system for protecting an MCU working program according to the present invention.
  • the method can be implemented as follows: in the FLASH memory of the MCU, the download program is first burned, the download program is run after the MCU is powered on, and then the download program is used to upgrade the work program or to run the work program. This way, when the work program is deleted, it can still be easily upgraded and run.
  • the implementation of the above method can be realized by externally connecting two pieces of FLASH memory, one piece of storage downloading program, and one piece of storing work program. After the download program runs, move the work program from another FLASH memory to the memory and run the work program. It can also be implemented with a piece of FLASH memory. When the MCU has more external chips, the interface resources will be tight. At this time, the advantage of FLASH is reflected.
  • part of the sector of the FLASH stores the download program
  • another part of the sector stores the work program.
  • the download program is moved from the address of the FLASH storing the download program to the memory, and after running.
  • the work program needs to be upgraded or the work program is moved from the address of the FLASH storing the work program to the memory.
  • the work program is deleted, it can be easily upgraded to protect the security of the work program.
  • the specific plan is as follows:
  • a system for protecting an MCU working program the system is used to implement a method for protecting an MCU working program, and the system includes:
  • the MCU is connected to the external storage module and the memory respectively for running the download program, the working program, and the moving of the BOOT code from the FLASH memory to the memory.
  • the external storage module adopts a FLASH memory
  • the FLASH memory includes a first storage sector for storing a download program, and the second storage sector for storing a working program, the first storage sector further storing a BOOT code for guiding the MCU to move and run a download program and/or a work program, the BOOT code being stored at a starting position of the first storage sector .
  • the memory is used to store the download program and/or the work program according to the command of the MCU, and is also a space for storing the program itself and running the program.
  • a method for protecting an MCU working program comprising the steps of: S1, running a downloading program; S2, determining, by the downloading program, whether the working program should be run or should be upgraded, and if the working program is running, proceeding to step S3, if an upgrade is required
  • the program proceeds to step S4; S3, the download program moves the working program code from the external storage module to the corresponding address in the memory, and the MCU runs the working program after the completion of the movement; S4, the MCU receives the working program from the upper computer, and the download program works.
  • the program is written to the corresponding location in the external memory module, and then resets to repeat steps S1 and S2.
  • the download program and the work program are stored in different storage sectors of the same external storage module.
  • the external storage module is a FLASH memory.
  • the method for protecting the working program of the MCU further comprises the steps of: S01, first moving the BOOT code from the external storage module into the memory, and then running the BOOT code; S02, the BOOT code performing the action: moving the download program from the external storage module And / or work program to the corresponding address in the memory, after the completion of the move, perform step S1.
  • the first 1K space of the FLASH memory (the starting position of the first storage sector) is used to store the BOOT code.
  • the BOOT code is included in the download program. When the MCU is powered on, the MCU moves 1K from the first address of the FLASH memory. The BOOT code is in the 1K space starting at the 0 address of the memory, and then the BOOT code is run.
  • the function of the BOOT code is to move the program after the BOOT code from the FLASH memory to the corresponding address in the memory, and start the download program after the completion of the move.
  • the downloading program starts to move the working program code from the working program storage location in the FLASH memory to the corresponding address in the memory, and after completing the moving, jumps to the entry function of the working program, and then the MCU runs all. Is the working procedure.
  • step 3 it is judged that the working program needs to be upgraded, and the working program is sent by the host computer to the MCU, and the downloading program writes the working program to the corresponding position in the FLASH.
  • the invention firstly downloads the program by burning in the FLASH of the MCU, and after the MCU is powered on, the downloading program is run, and then the downloading program is used to upgrade the working program or to run the working program, so that the working program can be conveniently deleted after being deleted.
  • the implementation is upgraded and run.
  • a part of the sector storage program of the external storage module another part of the sector stores the working program, which saves the MCU interface bus resources, thereby saving cost; again, the invention has high security and convenient use.
  • the operation is stable and reliable, with good economic and social benefits.
  • the invention can be widely applied to various MCU work program management systems.

Landscapes

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

Abstract

A method and system for protecting a working program of an MCU. The method comprises the steps of: S1, running a download program; and S2, determining, by the download program, whether a working program is to be run or needs to be upgraded, if the working program is to be run, entering step S3, and if the working program needs to be upgraded, entering step S4. The system comprises an MCU, an external storage module, and a memory. First, the download program is burned into a flash of the MCU, the MCU runs the download program after being powered on, and then the download program upgrades the working program or is responsible for running the working program, so that the working program can still be easily upgraded and run after being deleted; second, the download program is stored by a part of sector of the external storage module, and the working program is stored by the other part of sector, so that MCU interface bus resources are reduced, thereby reducing costs. The method and system are widely applicable to various management systems for a working program of an MCU.

Description

一种保护MCU工作程序的方法及系统  Method and system for protecting MCU working program
技术领域Technical field
本发明涉及芯片工作程序控制领域,尤其涉及一种保护MCU工作程序的方法及系统。The present invention relates to the field of chip work program control, and in particular, to a method and system for protecting an MCU work program.
背景技术Background technique
MCU: Microcontroller Unit, 微控制单元。MCU: Microcontroller Unit, Micro Control Unit.
内存:运行内存,是指MCU运行程序时的内存,也叫RAM(简称运存)。Memory: Running memory refers to the memory when the MCU runs the program, also called RAM (referred to as the memory).
FLASH:闪存,闪存的英文名称是"Flash Memory",一般简称为"Flash",它属于内存器件的一种,是一种不挥发性内存。FLASH: Flash, the English name of the flash is "Flash" Memory", generally referred to as "Flash", is a type of memory device and is a kind of non-volatile memory.
目前一些电子产品因特殊需求设有自动销毁程序,在发生紧急情况触发销毁程序后,工作程序就会被删除,想要再次使用该设备时就需要重新烧录程序,为使用带来不便。At present, some electronic products have automatic destruction procedures due to special needs. After an emergency triggers the destruction process, the work program is deleted. If the device is to be used again, the program needs to be re-burned, which is inconvenient for use.
发明内容Summary of the invention
为了解决上述技术问题,本发明的目的是提供一种可方便工作程序升级,使用方便,同时减少占用MCU总线资源的保护MCU工作程序方法。In order to solve the above technical problem, an object of the present invention is to provide a method for protecting a working MCU that can facilitate the upgrading of a working program, is convenient to use, and reduces the occupation of an MCU bus resource.
为了解决上述技术问题,本发明的另一个目的是提供一种可方便工作程序升级,使用方便,同时减少占用MCU总线资源的保护MCU工作程序系统。In order to solve the above technical problem, another object of the present invention is to provide a protection MCU working program system which can facilitate the upgrading of the working program, is convenient to use, and reduces the occupation of the MCU bus resources.
本发明所采用的技术方案是:The technical solution adopted by the invention is:
一种保护MCU工作程序的方法,其包括步骤:S1,运行下载程序;S2,由下载程序判断是应该运行工作程序还是应该升级工作程序,如果是运行工作程序则进入步骤S3,如需要升级工作程序则进入步骤S4;S3,下载程序则从外部存储模块中搬移工作程序代码到内存中对应地址,完成搬移后MCU运行工作程序;S4,MCU接收来自上位机的工作程序,由下载程序把工作程序写到外部存储模块中的对应位置,然后复位重复步骤S1和S2。A method for protecting an MCU working program, comprising the steps of: S1, running a downloading program; S2, determining, by the downloading program, whether the working program should be run or should be upgraded, and if the working program is running, proceeding to step S3, if an upgrade is required The program proceeds to step S4; S3, the download program moves the working program code from the external storage module to the corresponding address in the memory, and the MCU runs the working program after the completion of the movement; S4, the MCU receives the working program from the upper computer, and the download program works. The program is written to the corresponding location in the external memory module, and then resets to repeat steps S1 and S2.
优选的,所述下载程序和工作程序存储在同一外部存储模块的不同存储扇区中。Preferably, the download program and the work program are stored in different storage sectors of the same external storage module.
优选的,所述外部存储模块为一个FLASH存储器。Preferably, the external storage module is a FLASH memory.
优选的,所述保护MCU工作程序的方法还包括步骤:S01,先从外部存储模块中搬移BOOT代码到内存中,然后运行BOOT代码;S02,BOOT代码执行动作:从外部存储模块中搬移下载程序和/或工作程序到内存中对应的地址,搬移完成后执行步骤S1。Preferably, the method for protecting the working program of the MCU further comprises the steps of: S01, first moving the BOOT code from the external storage module into the memory, and then running the BOOT code; S02, the BOOT code performing the action: moving the download program from the external storage module And / or work program to the corresponding address in the memory, after the completion of the move, perform step S1.
一种保护MCU工作程序的系统,所述系统用于实施保护MCU工作程序的方法,所述系统包括:MCU,分别与外部存储模块和内存连接,用于运行下载程序、工作程序;外部存储模块,所述外部存储模块包括第一存储扇区和第二存储扇区,所述第一存储扇区用于存储下载程序,所述第二存储扇区用于存储工作程序;内存,用于根据MCU的命令存储下载程序和/或工作程序。A system for protecting an MCU working program, the system for implementing a method for protecting an MCU working program, the system comprising: an MCU, respectively connected to an external storage module and a memory, for running a downloading program and a working program; and an external storage module The external storage module includes a first storage sector for storing a download program, a second storage sector for storing a work program, and a memory for The MCU's commands store download programs and/or work programs.
优选的,所述第一存储扇区存储有BOOT代码,所述BOOT代码用于引导MCU搬移和运行下载程序和/或工作程序。Preferably, the first storage sector stores a BOOT code for guiding the MCU to move and run the download program and/or the work program.
优选的,所述外部存储模块为一个FLASH存储器。Preferably, the external storage module is a FLASH memory.
本发明的有益效果是:The beneficial effects of the invention are:
本发明首先通过在MCU的FLASH中先烧录进去下载程序,MCU上电后运行下载程序,然后由下载程序来升级工作程序或者负责把工作程序运行起来,实现当工作程序被删除后依然可以方便的实现升级并运行;其次,通过利用外部存储模块的一部分扇区存储下载程序,另一部分扇区存储工作程序,节省了MCU接口总线资源,从而节省成本;再次,本发明安全性高,使用方便,运行稳定可靠,具有良好的经济和社会效益。The invention firstly downloads the program by burning in the FLASH of the MCU, and after the MCU is powered on, the downloading program is run, and then the downloading program is used to upgrade the working program or to run the working program, so that the working program can be conveniently deleted after being deleted. The implementation is upgraded and run. Secondly, by using a part of the sector storage program of the external storage module, another part of the sector stores the working program, which saves the MCU interface bus resources, thereby saving cost; again, the invention has high security and convenient use. The operation is stable and reliable, with good economic and social benefits.
本发明可广泛应用于各种MCU工作程序管理系统。The invention can be widely applied to various MCU work program management systems.
附图说明DRAWINGS
下面结合附图对本发明的具体实施方式作进一步说明:The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings:
图1是本发明保护MCU工作程序的系统一种实施例的结构示意图。1 is a schematic structural diagram of an embodiment of a system for protecting an MCU working program according to the present invention.
具体实施方式detailed description
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
为了背景技术中提出的问题,可以如下方式实现,在MCU的FLASH存储器中先烧录进去下载程序,MCU上电后运行下载程序,然后由下载程序来升级工作程序或者负责把工作程序运行起来,这样当工作程序被删除后依然可以方便的实现升级并运行。实施上述方法,可以通过外接两片FLASH存储器实现,一片存储下载程序,一片存储工作程序。下载程序运行起来后从另一片FLASH存储器中搬移工作程序到内存中然后运行工作程序。也可以采用一片FLASH存储器实现。当MCU外接芯片较多时会出现接口资源紧张的情况,这时一片FLASH的优势就体现出来了。在一片FLASH的情况下,FLASH的一部分扇区存储下载程序,另一部分扇区存储工作程序,当MCU上电后,先从存储下载程序的FLASH的地址搬移下载程序到内存中运行,运行起来后根据情况再决定是需要升级工作程序或者是从存储工作程序的FLASH的地址搬移工作程序到内存中运行。当工作程序被删除后,可以方便的实现升级,保护了工作程序的安全性。具体方案如下:For the problems raised in the background art, the method can be implemented as follows: in the FLASH memory of the MCU, the download program is first burned, the download program is run after the MCU is powered on, and then the download program is used to upgrade the work program or to run the work program. This way, when the work program is deleted, it can still be easily upgraded and run. The implementation of the above method can be realized by externally connecting two pieces of FLASH memory, one piece of storage downloading program, and one piece of storing work program. After the download program runs, move the work program from another FLASH memory to the memory and run the work program. It can also be implemented with a piece of FLASH memory. When the MCU has more external chips, the interface resources will be tight. At this time, the advantage of FLASH is reflected. In the case of one FLASH, part of the sector of the FLASH stores the download program, and another part of the sector stores the work program. After the MCU is powered on, the download program is moved from the address of the FLASH storing the download program to the memory, and after running. According to the situation, it is decided that the work program needs to be upgraded or the work program is moved from the address of the FLASH storing the work program to the memory. When the work program is deleted, it can be easily upgraded to protect the security of the work program. The specific plan is as follows:
如图1所示,一种保护MCU工作程序的系统,所述系统用于实施保护MCU工作程序的方法,所述系统包括:As shown in FIG. 1, a system for protecting an MCU working program, the system is used to implement a method for protecting an MCU working program, and the system includes:
MCU,分别与外部存储模块和内存连接,用于运行下载程序、工作程序,还有实现BOOT代码从FLASH存储器到内存的搬移。The MCU is connected to the external storage module and the memory respectively for running the download program, the working program, and the moving of the BOOT code from the FLASH memory to the memory.
外部存储模块,本实施例采用一FLASH存储器,FLASH存储器包括第一存储扇区和第二存储扇区,所述第一存储扇区用于存储下载程序,所述第二存储扇区用于存储工作程序,所述第一存储扇区还存储有BOOT代码,所述BOOT代码用于引导MCU搬移和运行下载程序和/或工作程序,所述BOOT代码存储在第一存储扇区的起始位置。The external storage module, the embodiment adopts a FLASH memory, the FLASH memory includes a first storage sector for storing a download program, and the second storage sector for storing a working program, the first storage sector further storing a BOOT code for guiding the MCU to move and run a download program and/or a work program, the BOOT code being stored at a starting position of the first storage sector .
内存,用于根据MCU的命令存储下载程序和/或工作程序,也是存储程序本身、运行程序的空间。The memory is used to store the download program and/or the work program according to the command of the MCU, and is also a space for storing the program itself and running the program.
一种保护MCU工作程序的方法,其包括步骤:S1,运行下载程序;S2,由下载程序判断是应该运行工作程序还是应该升级工作程序,如果是运行工作程序则进入步骤S3,如需要升级工作程序则进入步骤S4;S3,下载程序则从外部存储模块中搬移工作程序代码到内存中对应地址,完成搬移后MCU运行工作程序;S4,MCU接收来自上位机的工作程序,由下载程序把工作程序写到外部存储模块中的对应位置,然后复位重复步骤S1和S2。A method for protecting an MCU working program, comprising the steps of: S1, running a downloading program; S2, determining, by the downloading program, whether the working program should be run or should be upgraded, and if the working program is running, proceeding to step S3, if an upgrade is required The program proceeds to step S4; S3, the download program moves the working program code from the external storage module to the corresponding address in the memory, and the MCU runs the working program after the completion of the movement; S4, the MCU receives the working program from the upper computer, and the download program works. The program is written to the corresponding location in the external memory module, and then resets to repeat steps S1 and S2.
优选的,所述下载程序和工作程序存储在同一外部存储模块的不同存储扇区中。Preferably, the download program and the work program are stored in different storage sectors of the same external storage module.
优选的,所述外部存储模块为一个FLASH存储器。Preferably, the external storage module is a FLASH memory.
优选的,所述保护MCU工作程序的方法还包括步骤:S01,先从外部存储模块中搬移BOOT代码到内存中,然后运行BOOT代码;S02,BOOT代码执行动作:从外部存储模块中搬移下载程序和/或工作程序到内存中对应的地址,搬移完成后执行步骤S1。Preferably, the method for protecting the working program of the MCU further comprises the steps of: S01, first moving the BOOT code from the external storage module into the memory, and then running the BOOT code; S02, the BOOT code performing the action: moving the download program from the external storage module And / or work program to the corresponding address in the memory, after the completion of the move, perform step S1.
下面结合图1所示的实施例详述本发明方法的具体实施步骤。The specific implementation steps of the method of the present invention are described in detail below with reference to the embodiment shown in FIG.
1.FLASH存储器的前面1K的空间(第一存储扇区的起始位置)用于存储BOOT代码,BOOT代码包含在下载程序中,当MCU上电后,MCU从FLASH存储器的首地址搬移1K的BOOT代码到内存的0地址开始的1K空间中,然后运行BOOT代码。1. The first 1K space of the FLASH memory (the starting position of the first storage sector) is used to store the BOOT code. The BOOT code is included in the download program. When the MCU is powered on, the MCU moves 1K from the first address of the FLASH memory. The BOOT code is in the 1K space starting at the 0 address of the memory, and then the BOOT code is run.
2.BOOT代码的功能是从FLASH存储器中搬移BOOT代码之后的程序到内存中对应的地址,搬移完成后开始运行下载程序。2. The function of the BOOT code is to move the program after the BOOT code from the FLASH memory to the corresponding address in the memory, and start the download program after the completion of the move.
3.下载程序运行后判断是运行工作程序还是需要升级工作程序。3. After the download program runs, determine whether to run the work program or upgrade the work program.
4.如果是运行工作程序,那么下载程序则从FLASH存储器中工作程序存储位置开始搬移工作程序代码到内存中对应地址,完成搬移后跳转到工作程序的入口函数执行,以后MCU运行的则全部是工作程序。4. If it is running the working program, then the downloading program starts to move the working program code from the working program storage location in the FLASH memory to the corresponding address in the memory, and after completing the moving, jumps to the entry function of the working program, and then the MCU runs all. Is the working procedure.
5.如果出现紧急情况后FLASH中的工作程序被删除。在步骤3则判断需要升级工作程序,由上位机发送工作程序到MCU,下载程序把工作程序写到FLASH中的对应位置。5. If an emergency occurs, the work program in FLASH is deleted. In step 3, it is judged that the working program needs to be upgraded, and the working program is sent by the host computer to the MCU, and the downloading program writes the working program to the corresponding position in the FLASH.
6.然后由下载程序进行复位,重新运行下载程序,再由下载程序搬移工作程序并运行。6. Then reset by the download program, re-run the download program, and then move the work program and run it by the download program.
本发明首先通过在MCU的FLASH中先烧录进去下载程序,MCU上电后运行下载程序,然后由下载程序来升级工作程序或者负责把工作程序运行起来,实现当工作程序被删除后依然可以方便的实现升级并运行;其次,通过利用外部存储模块的一部分扇区存储下载程序,另一部分扇区存储工作程序,节省了MCU接口总线资源,从而节省成本;再次,本发明安全性高,使用方便,运行稳定可靠,具有良好的经济和社会效益。The invention firstly downloads the program by burning in the FLASH of the MCU, and after the MCU is powered on, the downloading program is run, and then the downloading program is used to upgrade the working program or to run the working program, so that the working program can be conveniently deleted after being deleted. The implementation is upgraded and run. Secondly, by using a part of the sector storage program of the external storage module, another part of the sector stores the working program, which saves the MCU interface bus resources, thereby saving cost; again, the invention has high security and convenient use. The operation is stable and reliable, with good economic and social benefits.
本发明可广泛应用于各种MCU工作程序管理系统。The invention can be widely applied to various MCU work program management systems.
以上是对本发明的较佳实施进行了具体说明,但本发明创造并不限于所述实施例,熟悉本领域的技术人员在不违背本发明精神的前提下还可做作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。The above is a detailed description of the preferred embodiments of the present invention, but the present invention is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the invention. Such equivalent modifications or alternatives are intended to be included within the scope of the claims.

Claims (7)

  1. 一种保护MCU工作程序的方法,其特征在于,其包括步骤: A method for protecting an MCU working program, characterized in that it comprises the steps of:
    S1,运行下载程序;S1, running the download program;
    S2,由下载程序判断是应该运行工作程序还是应该升级工作程序,如果是运行工作程序则进入步骤S3,如需要升级工作程序则进入步骤S4;S2, it is determined by the downloading program whether the working program should be run or should be upgraded, if it is running the working program, then proceeds to step S3, if it is necessary to upgrade the working program, then proceeds to step S4;
    S3,下载程序则从外部存储模块中搬移工作程序代码到内存中对应地址,完成搬移后MCU运行工作程序;S3, the downloading program moves the working program code from the external storage module to the corresponding address in the memory, and the MCU runs the working program after the moving is completed;
    S4,MCU接收来自上位机的工作程序,由下载程序把工作程序写到外部存储模块中的对应位置,然后复位重复步骤S1和S2。S4, the MCU receives the working program from the upper computer, and the download program writes the working program to the corresponding position in the external storage module, and then repeats steps S1 and S2.
  2. 根据权利要求1所述的一种保护MCU工作程序的方法,其特征在于:所述下载程序和工作程序存储在同一外部存储模块的不同存储扇区中。A method of protecting an MCU operating program according to claim 1, wherein said downloading program and said working program are stored in different storage sectors of the same external storage module.
  3. 根据权利要求2所述的一种保护MCU工作程序的方法,其特征在于:所述外部存储模块为一个FLASH存储器。The method for protecting an MCU working program according to claim 2, wherein the external storage module is a FLASH memory.
  4. 根据权利要求1至3任一项所述的一种保护MCU工作程序的方法,其特征在于,所述保护MCU工作程序的方法还包括步骤:,The method for protecting an MCU working program according to any one of claims 1 to 3, wherein the method for protecting an MCU working program further comprises the steps of:
    S01,先从外部存储模块中搬移BOOT代码到内存中,然后运行BOOT代码;S01, first move the BOOT code from the external storage module to the memory, and then run the BOOT code;
    S02,BOOT代码执行动作:从外部存储模块中搬移下载程序和/或工作程序到内存中对应的地址,搬移完成后执行步骤S1。S02: BOOT code execution action: moving the download program and/or the work program from the external storage module to the corresponding address in the memory, and executing step S1 after the transfer is completed.
  5. 一种保护MCU工作程序的系统,其特征在于,所述系统用于实施如权利要求1至4任意一项所述的一种保护MCU工作程序的方法,所述系统包括:A system for protecting an MCU working program, characterized in that the system is for implementing a method for protecting an MCU working program according to any one of claims 1 to 4, the system comprising:
    MCU,分别与外部存储模块和内存连接,用于运行下载程序、工作程序;The MCU is respectively connected to an external storage module and a memory for running a download program and a work program;
    外部存储模块,所述外部存储模块包括第一存储扇区和第二存储扇区,所述第一存储扇区用于存储下载程序,所述第二存储扇区用于存储工作程序;An external storage module, the external storage module including a first storage sector for storing a download program, and the second storage sector for storing a work program;
    内存,用于根据MCU的命令存储下载程序和/或工作程序。Memory for storing download programs and/or work programs according to the commands of the MCU.
  6. 根据权利要求5所述的一种保护MCU工作程序的系统,其特征在于,所述第一存储扇区存储有BOOT代码,所述BOOT代码用于引导MCU搬移和运行下载程序和/或工作程序。A system for protecting an MCU work program according to claim 5, wherein said first storage sector stores a BOOT code for guiding the MCU to move and run the download program and/or the work program. .
  7. 根据权利要求5或6所述的一种保护MCU工作程序的系统,其特征在于,所述外部存储模块为一个FLASH存储器。A system for protecting an MCU working program according to claim 5 or 6, wherein the external storage module is a FLASH memory.
PCT/CN2015/095517 2015-11-05 2015-11-25 Method and system for protecting working program of mcu WO2017075852A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510747324.6A CN105354061A (en) 2015-11-05 2015-11-05 Method and system for protecting MCU working program
CN201510747324.6 2015-11-05

Publications (1)

Publication Number Publication Date
WO2017075852A1 true WO2017075852A1 (en) 2017-05-11

Family

ID=55330035

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/095517 WO2017075852A1 (en) 2015-11-05 2015-11-25 Method and system for protecting working program of mcu

Country Status (2)

Country Link
CN (1) CN105354061A (en)
WO (1) WO2017075852A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897709A (en) * 2018-05-25 2018-11-27 上海乘讯信息科技有限公司 A kind of routine interface download system
CN111459468A (en) * 2020-04-09 2020-07-28 西安现代控制技术研究所 DSP program on-line upgrading system and method for high-reliability serial port communication
CN113741944A (en) * 2021-08-16 2021-12-03 南京苏美达智能技术有限公司 Machine program system with upgrading function, upgrading method and application

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708592B (en) * 2017-01-25 2021-12-03 北京鸿智电通科技有限公司 Microcontroller and code burning method for microcontroller
CN110377303B (en) * 2019-07-10 2022-11-04 杭州洲钜电子科技有限公司 Method and equipment for upgrading program based on spare storage area mode

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1543107A (en) * 2003-11-04 2004-11-03 中兴通讯股份有限公司 Method of singleboard Node B software download and upgrade
CN1808385A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Guide system of embedded system
KR20080023841A (en) * 2006-09-12 2008-03-17 카시와야마 토요히테 The method of firmware upgrade and automatic firmware recovery system
CN102567054A (en) * 2011-12-22 2012-07-11 深圳市大富科技股份有限公司 Control method of two-tower amplifier and corresponding device
CN104486355A (en) * 2014-12-30 2015-04-01 大连楼兰科技股份有限公司 Method and device for preventing malicious manipulation of codes

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100351797C (en) * 2003-08-19 2007-11-28 华为技术有限公司 On-line updating method and apparatus of single-chip apparatus
CN102360304B (en) * 2011-10-18 2014-04-02 华南理工大学 Embedded microprocessor system and method for updating firmware thereof
CN102662718B (en) * 2012-05-03 2015-07-01 天津市英贝特航天科技有限公司 Module for starting multiple user programs by single FLASH
CN104102486A (en) * 2014-07-17 2014-10-15 福建升腾资讯有限公司 External storage module-based method for expanding MCU (micro controller unit) program space

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1543107A (en) * 2003-11-04 2004-11-03 中兴通讯股份有限公司 Method of singleboard Node B software download and upgrade
CN1808385A (en) * 2006-01-20 2006-07-26 北京朗通环球科技有限公司 Guide system of embedded system
KR20080023841A (en) * 2006-09-12 2008-03-17 카시와야마 토요히테 The method of firmware upgrade and automatic firmware recovery system
CN102567054A (en) * 2011-12-22 2012-07-11 深圳市大富科技股份有限公司 Control method of two-tower amplifier and corresponding device
CN104486355A (en) * 2014-12-30 2015-04-01 大连楼兰科技股份有限公司 Method and device for preventing malicious manipulation of codes

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897709A (en) * 2018-05-25 2018-11-27 上海乘讯信息科技有限公司 A kind of routine interface download system
CN111459468A (en) * 2020-04-09 2020-07-28 西安现代控制技术研究所 DSP program on-line upgrading system and method for high-reliability serial port communication
CN113741944A (en) * 2021-08-16 2021-12-03 南京苏美达智能技术有限公司 Machine program system with upgrading function, upgrading method and application

Also Published As

Publication number Publication date
CN105354061A (en) 2016-02-24

Similar Documents

Publication Publication Date Title
WO2017075852A1 (en) Method and system for protecting working program of mcu
US10209999B2 (en) Devices, updaters, methods for controlling a device, and methods for controlling an updater
US9778844B2 (en) Installation of operating system on host computer using virtual storage of BMC
US9910664B2 (en) System and method of online firmware update for baseboard management controller (BMC) devices
WO2016127835A1 (en) Single chip microcomputer and online programming method therefor
CN108132890B (en) Garbage recycling method, device and equipment for memory chip and storage medium
TWI590044B (en) Test system and test method thereof
CN105808270A (en) Firmware variable updating method
JP6136127B2 (en) Controller, electronic apparatus and USB device control method
US9298371B1 (en) System and method of reducing write cycles and increasing longevity of non-volatile memory in baseboard management controller (BMC)
CN103744708A (en) Method of fixing disk device names in Linux operating system
WO2013174169A1 (en) Upgrade method for capacitive screen firmware of android mobile terminal
WO2016188037A1 (en) Version burning method, system and terminal, and computer storage medium
US8370618B1 (en) Multiple platform support in computer system firmware
TWI813869B (en) Data storage device and method for maintaining normal boot operation of data storage device
CN114138360B (en) Multi-core programming starting method and system for DSP (digital Signal processor) on Flash
CN104050006A (en) Updating system and updating method of FPGA
US20140298319A1 (en) Method for installing operating system on electronic device
TW201337551A (en) Method of obtaining command for triggering function
CN105138308A (en) Method and device for updating register
US11256519B2 (en) Using a single process to install a UEFI-supported OS or a non-UEFI supported OS on a hardware platform
RU2454739C1 (en) Method of programming nand flash memory ic and apparatus for realising said method
KR20150072963A (en) Multisystem, and method of booting the same
CN110262349A (en) A kind of the remote online programmed method and system of C8051F series monolithic
CN110515665B (en) Starting method, system and device of processor system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15907694

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15907694

Country of ref document: EP

Kind code of ref document: A1