WO2021000535A1 - 一种升级单片机存储器内boot的方法 - Google Patents

一种升级单片机存储器内boot的方法 Download PDF

Info

Publication number
WO2021000535A1
WO2021000535A1 PCT/CN2019/126609 CN2019126609W WO2021000535A1 WO 2021000535 A1 WO2021000535 A1 WO 2021000535A1 CN 2019126609 W CN2019126609 W CN 2019126609W WO 2021000535 A1 WO2021000535 A1 WO 2021000535A1
Authority
WO
WIPO (PCT)
Prior art keywords
boot
chip microcomputer
upgrading
memory
area
Prior art date
Application number
PCT/CN2019/126609
Other languages
English (en)
French (fr)
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 WO2021000535A1 publication Critical patent/WO2021000535A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Definitions

  • the invention belongs to the field of electronics, and specifically relates to a method for upgrading BOOT in a single-chip microcomputer memory.
  • the BOOT stored in the MCU will be burned before leaving the factory, and a fixed storage area, but if the product has been shipped, the BOOT is defective or the needs change, the need to modify the BOOT will become abnormal It is cumbersome.
  • the general method is to unpack to the emulation port of the single-chip microcomputer to re-burn the BOOT through the emulator, but this will bring tedious unboxing, purchase a special emulator, and install special development software, which is not easy to implement.
  • the technical problem to be solved by the present invention is that the upgrade logic is firstly written by BOOT.
  • the response of the upgrade instruction, flash erasure, flash content burning, and integrity verification are all implemented by BOOT code.
  • This part of the logic in the BOOT must be run to upgrade the BOOT has become a major difficulty, and it has also become a major difficulty to ensure the success rate of the upgrade.
  • BOOT upgrade is more convenient, faster and lower cost.
  • the method for upgrading the BOOT in the single-chip microcomputer memory according to the present invention has the following steps:
  • the host computer sends the flash erase command.
  • the application program in the microcontroller first copies the contents of the BOOT area to the RAM area and the FLASH area, and then jumps to the entry function of the RAM area BOOT to execute the logic in the BOOT, and BOOT directly transfers the contents of the BOOT area Erase
  • the host computer sends the flash content, and BOOT burns the content of the corresponding position into the flash;
  • the host computer sends an upgrade stop command, and BOOT checks the integrity of the burned area. If it fails, it will restore the BOOT in the original FLASHA area to the BOOT area. If it passes, it will reset and run the new BOOT.
  • the recovery procedure is performed by unpacking.
  • the incomplete BOOT can be traced back to the previous BOOT.
  • the first step after restarting is to check the integrity of the BOOT, if it is not complete, perform a backtracking operation to restore the BOOT.
  • the present invention discloses a method for upgrading the BOOT in the memory of the single-chip microcomputer, which realizes that the bottom BOOT can be upgraded without tedious steps such as emulator and unboxing, and the initial state of the upgrade data error or upgrade interruption can be traced back to upgrade the bottom BOOT More convenient, faster, and lower costs.
  • a method for upgrading the BOOT in the memory of the single-chip microcomputer the steps of the method for upgrading the BOOT in the memory of the single-chip microcomputer are as follows:
  • the host computer sends the flash erase command.
  • the application program in the microcontroller first copies the contents of the BOOT area to the RAM area and the FLASH area, and then jumps to the entry function of the RAM area BOOT to execute the logic in the BOOT, and BOOT directly transfers the contents of the BOOT area Erase
  • the host computer sends the flash content, and BOOT burns the content of the corresponding position into the flash;
  • the host computer sends the upgrade stop command, and the BOOT checks the integrity of the burned area. If it fails, it will restore the BOOT in the original FLASHA area to the BOOT area. If it passes, it will reset and run the new BOOT.
  • the unpacking operation refers to the operation that must be done for products that do not expose the programming port of the single-chip microcomputer.
  • the incomplete BOOT can be traced back to the previous BOOT.
  • the first step after restarting is to check the integrity of the BOOT, if it is not complete, perform a backtracking operation to restore the BOOT.
  • the advantages of the present invention realize that the bottom BOOT can be upgraded without tedious steps such as emulator and unboxing, and the initial state of upgrade data error or upgrade interruption can be traced back, which makes the bottom BOOT upgrade more convenient and faster, and reduces the cost.

Landscapes

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

Abstract

一种升级单片机存储器内BOOT的方法,实现无需仿真器、拆箱等繁琐步骤亦可升级底层BOOT,并且升级数据出错或升级中断亦可回溯初始状态,使底层BOOT升级更加方便,更加快捷,降低成本。

Description

一种升级单片机存储器内BOOT的方法 技术领域
本发明属于涉及电子领域,具体涉及一种升级单片机存储器内BOOT的方法。
背景技术
一般情况下,存储于单片机内部的BOOT在出厂之前就会烧录完成,且固定一块存储区域,但是如果在产品已出厂,BOOT存在缺陷或者需求发生变化的情况下,需要修改BOOT就变得异常繁琐,一般做法是需要拆箱到单片机的仿真口通过仿真器重新烧录BOOT,但这样带来很繁琐的拆箱、购买专用仿真器、安装专用的开发软件,不易实现。
发明内容
发明目的:本发明要解决的技术问题,首先升级的逻辑是通过BOOT来编写的,升级指令的响应、flash的擦除、flash内容的烧录、完整性校验均由BOOT内代码实现,要升级BOOT必须运行BOOT内的这部分逻辑成为一大难点,且保证升级成功率也成为一大难点,通过解决上述问题,来实现无需仿真器、拆箱等繁琐步骤亦可升级底层BOOT,使底层BOOT升级更加方便,更加快捷,降低成本。
技术方案:本发明所述的一种升级单片机存储器内BOOT的方法,所述升级单片机存储器内BOOT的方法步骤如下:
A、将上位机与单片机建立数据连接;
B、上位机发送flash擦除指令,单片机内应用程序先将BOOT区域的内容复制到RAM区与FLASHA区,然后跳转至RAM区域BOOT的入口函数执行BOOT内逻辑,BOOT直接将BOOT区域的内容擦除;
C、上位机发送flash内容,BOOT将对应位置的内容烧录进flash;
D、上位机发送升级停止指令,BOOT对所烧录区域进行完整性校验,若不通过则将原FLASHA区的BOOT还原至BOOT区,若通过则复位,运行新BOOT。
进一步的,所述执行升级单片机存储器内BOOT的方法时,必须保证MCU在任意时间段内均有一版BOOT的完整代码。
进一步的,所述数据丢失后,通过拆箱进行恢复程序。
进一步的,所述上位机与单片机的总线上若出现数据错乱,BOOT出现不完整情况可以回溯到上一BOOT。
进一步的,所述在升级过程中若出现断电,重启后第一步并检查BOOT完整性,若不完整即执行回溯操作恢复BOOT。
有益效果:本发明揭示了一种升级单片机存储器内BOOT的方法,实现无需仿真器、拆箱等繁琐步骤亦可升级底层BOOT,并且升级数据出错或升级中断亦可回溯初始状态,使底层BOOT升级更加方便,更加快捷,降低成本。
具体实施方式
一种升级单片机存储器内BOOT的方法,所述升级单片机存储器内BOOT的方法步骤如下:
A、将上位机与单片机建立数据连接;
B、上位机发送flash擦除指令,单片机内应用程序先将BOOT区域的内容复制到RAM区与FLASHA区,然后跳转至RAM区域BOOT的入口函数执行BOOT内逻辑,BOOT直接将BOOT区域的内容擦除;
C、上位机发送flash内容,BOOT将对应位置的内容烧录进flash;
D、上位机发送升级停止指令,BOOT对所烧录区域进行完整性校验,若不 通过则将原FLASHA区的BOOT还原至BOOT区,若通过则复位,运行新BOOT。
在该方法中还设有一下功能:
本实例中,所述执行升级单片机存储器内BOOT的方法时,必须保证MCU在任意时间段内均有一版BOOT的完整代码。
本实例中,所述数据丢失后,通过拆箱进行恢复程序,拆箱操作是指针对单片机烧录口不外露的产品必须这样操作。
本实例中,所述总线上若出现数据错乱,BOOT出现不完整情况可以回溯到上一BOOT。
本实例中,所述在升级过程中若出现断电,重启后第一步并检查BOOT完整性,若不完整即执行回溯操作恢复BOOT。
本发明的优点:实现无需仿真器、拆箱等繁琐步骤亦可升级底层BOOT,并且升级数据出错或升级中断亦可回溯初始状态,使底层BOOT升级更加方便,更加快捷,降低成本。
以上所述,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专业的技术人员,在不脱离本发明技术方案范围内,当可利用上述揭示的技术内容作出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。

Claims (5)

  1. 一种升级单片机存储器内BOOT的方法,其特征在于:所述升级单片机存储器内BOOT的方法步骤如下:
    A、将上位机与单片机建立数据连接;
    B、上位机发送flash擦除指令,单片机内应用程序先将BOOT区域的内容复制到RAM区与FLASHA区,然后跳转至RAM区域BOOT的入口函数执行BOOT内逻辑,BOOT直接将BOOT区域的内容擦除;
    C、上位机发送flash内容,BOOT将对应位置的内容烧录进flash;
    D、上位机发送升级停止指令,BOOT对所烧录区域进行完整性校验,若不通过则将原FLASHA区的BOOT还原至BOOT区,若通过则复位,运行新BOOT。
  2. 根据权利要求1所述的一种升级单片机存储器内BOOT的方法,其特征在于:所述执行升级单片机存储器内BOOT的方法时,必须保证MCU在任意时间段内均有一版BOOT的完整代码。
  3. 根据权利要求1所述的一种升级单片机存储器内BOOT的方法,其特征在于:所述数据丢失后,通过拆箱进行恢复程序。
  4. 根据权利要求1所述的一种升级单片机存储器内BOOT的方法,其特征在于:所述上位机与单片机的总线上若出现数据错乱,BOOT出现不完整情况可以回溯到上一BOOT。
  5. 根据权利要求1所述的一种升级单片机存储器内BOOT的方法,其特征在于:所述在升级过程中若出现断电,重启后第一步并检查BOOT完整性,若不完整即执行回溯操作恢复BOOT。
PCT/CN2019/126609 2019-06-29 2019-12-19 一种升级单片机存储器内boot的方法 WO2021000535A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910581093.4A CN110333900A (zh) 2019-06-29 2019-06-29 一种升级单片机存储器内boot的方法
CN201910581093.4 2019-06-29

Publications (1)

Publication Number Publication Date
WO2021000535A1 true WO2021000535A1 (zh) 2021-01-07

Family

ID=68144592

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/126609 WO2021000535A1 (zh) 2019-06-29 2019-12-19 一种升级单片机存储器内boot的方法

Country Status (2)

Country Link
CN (1) CN110333900A (zh)
WO (1) WO2021000535A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110333900A (zh) * 2019-06-29 2019-10-15 沃太能源南通有限公司 一种升级单片机存储器内boot的方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461644A (zh) * 2014-12-18 2015-03-25 山东超越数控电子有限公司 一种国产计算机平台烧录ec固件的方法
CN105677388A (zh) * 2015-12-31 2016-06-15 清华大学苏州汽车研究院(吴江) 电动汽车电机控制器的固件更新方法
CN106598654A (zh) * 2016-11-30 2017-04-26 中国兵器装备集团自动化研究所 一种在线更新PowerPC主板引导芯片的方法
CN108182079A (zh) * 2017-12-21 2018-06-19 中国船舶重工集团公司第七0七研究所 一种基于串口的tms320c6748程序加载方法
CN110333900A (zh) * 2019-06-29 2019-10-15 沃太能源南通有限公司 一种升级单片机存储器内boot的方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100700578B1 (ko) * 2005-06-09 2007-03-28 엘지전자 주식회사 휴대폰의 펌웨어 업그레이드 방법
CN105867977B (zh) * 2016-04-01 2019-06-14 天津七所精密机电技术有限公司 DSP用户程序升级及Flash下载方法
CN106227572A (zh) * 2016-08-30 2016-12-14 深圳市蓝海华腾技术股份有限公司 一种变频器控制系统程序升级方法
CN106569833B (zh) * 2016-11-14 2020-04-10 积成电子股份有限公司 一种具有二级boot的dsp程序在线升级方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461644A (zh) * 2014-12-18 2015-03-25 山东超越数控电子有限公司 一种国产计算机平台烧录ec固件的方法
CN105677388A (zh) * 2015-12-31 2016-06-15 清华大学苏州汽车研究院(吴江) 电动汽车电机控制器的固件更新方法
CN106598654A (zh) * 2016-11-30 2017-04-26 中国兵器装备集团自动化研究所 一种在线更新PowerPC主板引导芯片的方法
CN108182079A (zh) * 2017-12-21 2018-06-19 中国船舶重工集团公司第七0七研究所 一种基于串口的tms320c6748程序加载方法
CN110333900A (zh) * 2019-06-29 2019-10-15 沃太能源南通有限公司 一种升级单片机存储器内boot的方法

Also Published As

Publication number Publication date
CN110333900A (zh) 2019-10-15

Similar Documents

Publication Publication Date Title
US10139876B2 (en) Efficient reboot of an operating system executed in a virtual machine
US9720808B2 (en) Offline debugging using a replicated operating environment
EP3080693B1 (en) Devices, updaters, methods for controlling a device, and methods for controlling an updater
WO2017186089A1 (zh) 一种车载解码器软件升级文件的方法
CN104407878B (zh) C6000数字信号处理器在线升级方法
US9836417B2 (en) Bridge configuration in computing devices
CN105760191A (zh) 嵌入式系统设备程序烧写量产方法
CN105653330A (zh) 一种基于SD卡的NorFlash烧写系统和方法
CN106990985A (zh) 基于bmc更新及备份系统uefi固件的设备和方法
US10586048B2 (en) Efficient reboot of an operating system
WO2021000535A1 (zh) 一种升级单片机存储器内boot的方法
TWI514281B (zh) 具spi介面的sata儲存裝置、應用該sata儲存裝置之開機方法及基本輸入輸出系統程式碼更新方法
CN110704113A (zh) 一种基于fpga平台的启动方法、系统及开发板装置
WO2018014687A1 (zh) 一种参数传递方法、装置及计算机存储介质
CN110825421A (zh) 一种固件升级方法、系统及可读存储介质
CN111984329B (zh) 一种boot引导软件标准化生成、执行方法及系统
JP2013171345A (ja) メッセージ出力制御装置及びメッセージ出力制御方法
CN111857788A (zh) 一种整车控制器回读历史版本程序的方法
CN106873951A (zh) 一种麻醉机上位机软件移植到嵌入式Linux的方法
TWI793998B (zh) 用於控制系統的韌體架構及開機方法
Pandey et al. Triforce QNX Syscall Fuzzer
CN118132123B (zh) 一种应用软件在线升级及安全启动方法
Pandit et al. Development of BSP for ARM9 Evaluation Board
US20240111543A1 (en) Concurrent execution and copy of updated basic input/output system instructions
CN118092989A (zh) 一种存储器的固件升级方法、系统、设备及介质

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: 19935887

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: 19935887

Country of ref document: EP

Kind code of ref document: A1