[go: up one dir, main page]

TWI854882B - Method of performing full firmware update procedure on embedded electronic device - Google Patents

Method of performing full firmware update procedure on embedded electronic device Download PDF

Info

Publication number
TWI854882B
TWI854882B TW112142470A TW112142470A TWI854882B TW I854882 B TWI854882 B TW I854882B TW 112142470 A TW112142470 A TW 112142470A TW 112142470 A TW112142470 A TW 112142470A TW I854882 B TWI854882 B TW I854882B
Authority
TW
Taiwan
Prior art keywords
file
update
sub
storage unit
complete
Prior art date
Application number
TW112142470A
Other languages
Chinese (zh)
Other versions
TW202441372A (en
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 四零四科技股份有限公司
Priority to US18/515,228 priority Critical patent/US12417088B2/en
Priority to EP23212863.7A priority patent/EP4446876A1/en
Priority to JP2024000876A priority patent/JP7683165B2/en
Application granted granted Critical
Publication of TWI854882B publication Critical patent/TWI854882B/en
Publication of TW202441372A publication Critical patent/TW202441372A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

When performing a full firmware update procedure on an electronic device, a full firmware update file is first divided into a first sub update file and a second sub update file, a header file associated the sizes of each sub update file is created, and the header file, the first sub update file and the second sub update file are merged into a full FOTA file before being uploaded to the electronic device. The electronic device accesses each sub update file based on the header file, stores the accessed first sub update file into a first storage unit of the electronic device, and stores the accessed second sub update file into a second storage unit of a sub-system in the electronic device. After performing the firmware update steps associated with the first sub update file, the second sub update file stored in the second storage unit is copied to the first storage unit before performing the firmware update steps associated with the second sub update file.

Description

對嵌入式電子裝置執行完整韌體更新程序之方法 Method for performing a complete firmware update procedure on an embedded electronic device

本發明相關於一種對嵌入式電子裝置執行完整韌體更新程序之方法,尤指一種透過FOTA技術對內建記憶體空間有限之嵌入式電子裝置執行完整韌體更新程序之方法。 The present invention relates to a method for executing a complete firmware update procedure on an embedded electronic device, and in particular to a method for executing a complete firmware update procedure on an embedded electronic device with limited built-in memory space through FOTA technology.

嵌入式電子裝置通常包含硬體、軟體和韌體。硬體泛指所有系統用以發揮功能所需的實體元件,例如主機板、顯示卡、中央處理器、通風風扇、網路攝影機和電源供應器等,彼此可透過電路板相互連接。軟體泛指用程式語言所打造出來的非實體產品,例如應用程式(APP)、網頁和各類作業系統等,用來使硬體能提供使用者各種方便的服務。韌體是指嵌入在硬體裝置中的軟體,可透過程式語言來操控硬體,一般常見的韌體存在於主機板上的基本的輸入/輸出系統(basic input/output system)晶片、光碟機、燒錄機、網際網路協定閘道器/路由器(IP gateway/router)、無線基地台(wireless access point,WAP)和數據機等資訊產品中。使用者可以透過指定介面來遙控和操作韌體中的設定與功能,查詢目前硬體的運作狀態,以及執行硬體的設定、升級與調校。 Embedded electronic devices usually include hardware, software and firmware. Hardware refers to all physical components required for the system to function, such as motherboards, graphics cards, central processing units, ventilation fans, network cameras and power supplies, which can be connected to each other through circuit boards. Software refers to non-physical products created with programming languages, such as applications (APPs), web pages and various operating systems, which are used to enable hardware to provide users with various convenient services. Firmware refers to software embedded in hardware devices that can control hardware through programming languages. Common firmware is found in basic input/output system chips on motherboards, optical drives, burners, Internet protocol gateways/routers, wireless access points (WAPs), modems and other information products. Users can remotely control and operate the settings and functions in the firmware through a designated interface, query the current operating status of the hardware, and perform hardware settings, upgrades and adjustments.

韌體可視為包含所有官方特制軟體的套件,通常被儲存在嵌入式電子裝置內的快閃記憶體中,使用者可以透過特定的裝置與方法來執行韌體更新程序。韌體更新的主要目的包含更正程式碼中的錯誤、增加或改善執行功能、調整系統安全性,以及提升韌體效率。 Firmware can be considered as a package containing all official special software, which is usually stored in the flash memory of embedded electronic devices. Users can perform firmware update procedures through specific devices and methods. The main purpose of firmware updates includes correcting errors in the code, adding or improving execution functions, adjusting system security, and improving firmware efficiency.

第一種習知韌體更新方式是讓嵌入式電子裝置利用通用序列匯流排(universal serial bus,USB)埠連接至電腦主機,接著搭配FlashTool線刷軟體來下載官方FTF格式的最新版本韌體檔案,然後在離線狀態下更新。此種技術可以傳輸大資料量的韌體檔案以進行完整韌體更新,但在特定應用場所中,上述有線資料傳輸並不可行或極為不便。 The first known firmware update method is to connect the embedded electronic device to the host computer via the universal serial bus (USB) port, and then use the FlashTool flash software to download the latest version of the official FTF format firmware file, and then update it offline. This technology can transfer large amounts of firmware files for complete firmware updates, but in certain application scenarios, the above wired data transmission is not feasible or extremely inconvenient.

第二種習知韌體更新方式是利用韌體廣播(firmware over-the-air,FOTA)技術來自動更新嵌入式電子裝置之作業系統,在嵌入式電子裝置與伺服器建立連結後,不需連接至電腦主機即可下載及更新韌體。然而,若嵌入式電子裝置之根文件系統(root file system,rootfs)或數據機發生錯誤,此時將無法以連網方式進行韌體更新。此外,行動電子裝置的內建快閃記憶體之儲存空間通常不足以應付以FOTA技術進行完整韌體更新所要求的檔案大小,因此內建記憶體空間有限的電子裝置只能採用上述第一種習知韌體更新方式來進行完整韌體更新,對使用者來說並不方便。 The second learned firmware update method is to use firmware over-the-air (FOTA) technology to automatically update the operating system of embedded electronic devices. After the embedded electronic device establishes a connection with the server, it can download and update the firmware without connecting to the computer host. However, if the root file system (rootfs) or modem of the embedded electronic device has an error, the firmware update will not be possible via the network. In addition, the storage space of the built-in flash memory of mobile electronic devices is usually insufficient to cope with the file size required for full firmware updates using FOTA technology. Therefore, electronic devices with limited built-in memory space can only use the first learned firmware update method mentioned above to perform full firmware updates, which is inconvenient for users.

因此,需要一種透過FOTA技術對內建記憶體空間有限的電 子裝置進行完整韌體更新之方法。 Therefore, a method is needed to perform a complete firmware update on electronic devices with limited built-in memory space through FOTA technology.

本發明提供一種對一嵌入式電子裝置執行一完整韌體更新程序之方法,其包含將一完整韌體更新檔案切割為複數筆更新資料;將該複數筆更新資料區分為一第一子更新檔案和一第二子更新檔案;製作相關每一子更新檔案之檔案大小的一標頭檔;依序將該標頭檔、該第一子更新檔案和該第二子更新檔案組合成一完整FOTA檔案;將該完整FOTA檔案上傳至該嵌入式電子裝置;依據該標頭檔來從該完整FOTA檔案中提取相關該第一子更新檔之內容,並將提取出之該第一子更新檔存放至該嵌入式電子裝置之一第一儲存單元內;清除該嵌入式電子裝置之一子系統模組中一第二儲存單元之記憶體空間;依據該標頭檔來從該完整FOTA檔案中提取相關第二子更新檔之內容,並將提取出之該第二子更新檔存放至該第二儲存單元內;在一第一時間點執行相關該第一儲存單元內存該第一子更新檔案之韌體更新步驟;在該第一時間點之後的一第二時間點將該第二儲存單元內存之該第二子更新檔案複製到該第一儲存單元內;以及在該第二時間點之後的一第三時間點執行相關該第一儲存單元內存該第二子更新檔案之韌體更新步驟。在該嵌入式電子裝置運作期間,該第一儲存單元係提供一第一可用記憶體空間,而該第二儲存單元係提供一第二可用記憶體空間,其中該完整韌體更新檔案之檔案大小超過該第一可用記憶空間,但不超過該第一可用記憶空間和該第二可用記憶空間之加總。 The present invention provides a method for executing a complete firmware update program on an embedded electronic device, which includes cutting a complete firmware update file into a plurality of update data; dividing the plurality of update data into a first sub-update file and a second sub-update file; making a header file related to the file size of each sub-update file; sequentially combining the header file, the first sub-update file and the second sub-update file into a complete FOTA file; uploading the complete FOTA file to the embedded electronic device; extracting the content of the first sub-update file from the complete FOTA file according to the header file, and storing the extracted first sub-update file in one of the embedded electronic device. The invention relates to a method for performing a firmware update on the first storage unit; clearing the memory space of a second storage unit in a subsystem module of the embedded electronic device; extracting the content of the relevant second sub-update file from the complete FOTA file according to the header file, and storing the extracted second sub-update file in the second storage unit; executing a firmware update step on the first sub-update file stored in the first storage unit at a first time point; copying the second sub-update file stored in the second storage unit to the first storage unit at a second time point after the first time point; and executing a firmware update step on the second sub-update file stored in the first storage unit at a third time point after the second time point. During the operation of the embedded electronic device, the first storage unit provides a first available memory space, and the second storage unit provides a second available memory space, wherein the file size of the complete firmware update file exceeds the first available memory space, but does not exceed the sum of the first available memory space and the second available memory space.

100:嵌入式電子裝置 100:Embedded electronic devices

110:處理單元 110: Processing unit

120:子系統模組 120: Subsystem module

131:第一儲存單元 131: First storage unit

132:第二儲存單元 132: Second storage unit

140:使用者介面 140: User Interface

200-320:步驟 200-320: Steps

第1圖為本發明實施例中一種嵌入式電子裝置之功能方塊圖。 Figure 1 is a functional block diagram of an embedded electronic device in an embodiment of the present invention.

第2圖為本發明實施例中一種透過FOTA技術來對嵌入式電子裝置執行完整韌體更新程序之方法流程圖。 Figure 2 is a flow chart of a method for executing a complete firmware update procedure on an embedded electronic device using FOTA technology in an embodiment of the present invention.

第3圖為本發明實施例嵌入式電子裝置在執行完整韌體更新程序之檔案切割後之相關資料示意圖。 Figure 3 is a schematic diagram of the relevant data of the embedded electronic device after the file cutting of the complete firmware update program is executed in the embodiment of the present invention.

第4圖為本發明實施例嵌入式電子裝置在執行完整韌體更新程序時所產生完整FOTA檔案之示意圖。 Figure 4 is a schematic diagram of the complete FOTA file generated when the embedded electronic device of the embodiment of the present invention executes the complete firmware update procedure.

第5圖至第9圖為本發明實施例嵌入式電子裝置在透過FOTA技術執行完整韌體更新程序時各階段之資料示意圖。 Figures 5 to 9 are schematic diagrams of data at various stages when the embedded electronic device of the embodiment of the present invention executes a complete firmware update procedure through FOTA technology.

第10圖為本發明實施例嵌入式電子裝置執行完整韌體更新程序後之資料示意圖。 Figure 10 is a schematic diagram of the data after the embedded electronic device of the embodiment of the present invention executes a complete firmware update procedure.

第1圖為本發明實施例中一種嵌入式電子裝置100之功能方塊圖。嵌入式電子裝置100至少包含一處理單元110、一子系統模組120、一第一儲存單元131,以及一使用者介面140。 Figure 1 is a functional block diagram of an embedded electronic device 100 in an embodiment of the present invention. The embedded electronic device 100 at least includes a processing unit 110, a subsystem module 120, a first storage unit 131, and a user interface 140.

在本發明實施例中,嵌入式電子裝置100可為針對工業、醫療、通訊、儲存或汽車等不同應用所設計的物聯網(IoT)裝置、行動聯網裝置(mobile Internet device,MID)或智慧型手機等,但不侷限於此。 In the embodiment of the present invention, the embedded electronic device 100 may be an Internet of Things (IoT) device, a mobile Internet device (MID) or a smart phone designed for different applications such as industry, medical, communication, storage or automobile, but is not limited thereto.

在本發明實施例中,子系統模組120至少包含一第二儲存單元132,其內存有子系統韌體以提供嵌入式電子裝置100之應用所需的 功能。舉例來說,當嵌入式電子裝置100為一網際網路連線服務公司(Internet Service Provider,ISP)裝置時,子系統模組120可為一數據機模組。然而,嵌入式電子裝置100和其內子系統模組120之種類並不限定本發明之範疇。 In the embodiment of the present invention, the subsystem module 120 includes at least a second storage unit 132, which stores subsystem firmware to provide the functions required for the application of the embedded electronic device 100. For example, when the embedded electronic device 100 is an Internet Service Provider (ISP) device, the subsystem module 120 can be a modem module. However, the types of the embedded electronic device 100 and the subsystem module 120 therein do not limit the scope of the present invention.

在本發明實施例中,第一儲存單元131係為嵌入式電子裝置100之內建記憶體,例如可為一嵌入式多媒體卡(embedded multimedia card,eMMC)、一通用快閃記憶體儲存(universal flash storage,UFS),或一快速非揮發性記憶體(non-volatile memory,NVMe),但不侷限於此。 In the embodiment of the present invention, the first storage unit 131 is a built-in memory of the embedded electronic device 100, such as an embedded multimedia card (eMMC), a universal flash storage (UFS), or a fast non-volatile memory (NVMe), but is not limited thereto.

在本發明實施例中,第二儲存單元132係為子系統模組120之內建記憶體,可包含一種或多種記憶體裝置,例如包含快閃記憶體、隨機存取記憶體(random access memory,RAM),及/或唯讀記憶體(read-only memory,ROM)等,但不侷限於此。 In the embodiment of the present invention, the second storage unit 132 is a built-in memory of the subsystem module 120, and may include one or more memory devices, such as flash memory, random access memory (RAM), and/or read-only memory (ROM), etc., but is not limited thereto.

在本發明實施例中,嵌入式電子裝置100係為有高度薄型化和輕量化需求的產品,因此其內建第一儲存單元131僅能提供有限的可用記憶體空間。更詳細地說,在嵌入式電子裝置100運作的期間,第一儲存單元131所提供之可用記憶體空間並無法應付執行完整韌體更新程序所需要的記憶體空間。 In the embodiment of the present invention, the embedded electronic device 100 is a product that has a high requirement for thinness and lightness, so its built-in first storage unit 131 can only provide limited available memory space. More specifically, during the operation of the embedded electronic device 100, the available memory space provided by the first storage unit 131 cannot cope with the memory space required to execute a complete firmware update procedure.

在本發明實施例中,當嵌入式電子裝置100在運作時,第一儲存單元131所能提供之可用記憶空間小於執行完整韌體更新程序所需之記憶體空間,但第一儲存單元131和第二儲存單元132所提供之總 可用記憶空間大於執行完整韌體更新程序所需之記憶體空間。因此,當嵌入式電子裝置100在執行完整韌體更新程序時,本發明會利用子系統模組120中第二儲存單元132所能提供的額外可用記憶空間來支援執行完整韌體更新程序所需之記憶體空間。 In the embodiment of the present invention, when the embedded electronic device 100 is in operation, the available memory space provided by the first storage unit 131 is less than the memory space required to execute the complete firmware update procedure, but the total available memory space provided by the first storage unit 131 and the second storage unit 132 is greater than the memory space required to execute the complete firmware update procedure. Therefore, when the embedded electronic device 100 is executing the complete firmware update procedure, the present invention will use the additional available memory space provided by the second storage unit 132 in the subsystem module 120 to support the memory space required to execute the complete firmware update procedure.

第2圖為本發明實施例中一種透過FOTA技術來對嵌入式電子裝置100執行完整韌體更新程序之方法流程圖,其包含下列步驟: Figure 2 is a flow chart of a method for executing a complete firmware update procedure on an embedded electronic device 100 using FOTA technology in an embodiment of the present invention, which includes the following steps:

步驟200:將一完整韌體更新檔案切割為複數筆更新資料。 Step 200: Split a complete firmware update file into multiple update data.

步驟210:將複數筆更新資料區分為一第一子更新檔案和一第二子更新檔案。 Step 210: Divide the plurality of update data into a first sub-update file and a second sub-update file.

步驟220:製作相關韌體版本、驗證碼和每一子更新檔案之大小的標頭檔(header)。 Step 220: Create a header file containing the firmware version, verification code, and size of each sub-update file.

步驟230:依序將標頭檔、第一子更新檔案和第二子更新檔案組合成一完整FOTA檔案。 Step 230: Sequentially combine the header file, the first sub-update file, and the second sub-update file into a complete FOTA file.

步驟240:將完整FOTA檔案上傳至嵌入式電子裝置100。 Step 240: Upload the complete FOTA file to the embedded electronic device 100.

步驟250:判斷完整FOTA檔案是否能通過正確性驗證;若是,執行步驟260;若否,執行步驟320。 Step 250: Determine whether the complete FOTA file can pass the correctness verification; if so, execute step 260; if not, execute step 320.

步驟260:依據完整FOTA檔案的標頭檔來提取相關第一子更新檔之內容,並將提取出之第一子更新檔存放至第一儲存單元131內。 Step 260: Extract the content of the relevant first sub-update file based on the header file of the complete FOTA file, and store the extracted first sub-update file in the first storage unit 131.

步驟270:清除子系統模組120之第二儲存單元132內的記憶體空間。 Step 270: Clear the memory space in the second storage unit 132 of the subsystem module 120.

步驟280:依據完整FOTA檔案的標頭檔來提取相關第二子更新檔之內容,並將提取出之第二子更新檔存放至第二儲存單元132 內。 Step 280: Extract the content of the relevant second sub-update file based on the header file of the complete FOTA file, and store the extracted second sub-update file in the second storage unit 132.

步驟290:判斷第一子更新檔案和第二子更新檔案是否完整;若是,執行步驟300;若否,執行步驟320。 Step 290: Determine whether the first sub-update file and the second sub-update file are complete; if so, execute step 300; if not, execute step 320.

步驟300:重啟系統,接著執行相關第一儲存單元131內存第一子更新檔案之韌體更新步驟。 Step 300: Restart the system, and then execute the firmware update step of the first sub-update file in the memory of the first storage unit 131.

步驟310:重啟系統,將第二儲存單元132內存之第二子更新檔案複製到第一儲存單元131內,接著執行相關第一儲存單元131內存第二子更新檔案之韌體更新步驟。 Step 310: Restart the system, copy the second sub-update file in the second storage unit 132 to the first storage unit 131, and then execute the firmware update step related to the second sub-update file in the first storage unit 131.

步驟320:提示韌體更新失敗,並退出韌體更新程序。 Step 320: The system will prompt that the firmware update has failed and exit the firmware update program.

在步驟200中,本發明會將一完整韌體更新檔案切割為複數筆更新資料,其中每一更新資料可分別為針對核心(kernel)、根文件系統(root file system,rootfs)、原始設備製造商(original equipment manufacturer,OEM)套裝,和子系統韌體之更新資料。在一實施例中,步驟200可使用任何相關檔案切割工具或檔案切割軟體來完成。 In step 200, the present invention will cut a complete firmware update file into multiple update data, each of which can be update data for the kernel, root file system (rootfs), original equipment manufacturer (OEM) package, and subsystem firmware. In one embodiment, step 200 can be completed using any relevant file cutting tool or file cutting software.

在步驟210中,本發明會將複數筆更新資料區分為第一子更新檔案和第二子更新檔案。假設在步驟200中將完整韌體更新檔案切割為(M+N)筆更新資料,且每一筆更新資料之內容不同,第一子更新檔案可包含M筆更新資料,而第二子更新檔案可包含N筆更新資料,其中M和N為正整數。如前所述,執行完整韌體更新程序時之完整韌體更新檔案其檔案大小會超過第一儲存單元131所能提供之可用記憶體空間,但不會超過第一儲存單元131和第二儲存單元132兩者所能提供之總可用記憶體空間。在一實施例中,本發明可依據第一儲存單元131 和第二儲存單元132所能提供之可用記憶體空間之比例來決定第一子更新檔案和第二子更新檔案之大小。 In step 210, the present invention divides the plurality of update data into a first sub-update file and a second sub-update file. Assuming that the complete firmware update file is divided into (M+N) update data in step 200, and the content of each update data is different, the first sub-update file may include M update data, and the second sub-update file may include N update data, where M and N are positive integers. As mentioned above, when executing the complete firmware update procedure, the file size of the complete firmware update file will exceed the available memory space that the first storage unit 131 can provide, but will not exceed the total available memory space that the first storage unit 131 and the second storage unit 132 can provide. In one embodiment, the present invention can determine the size of the first sub-update file and the second sub-update file based on the ratio of available memory space that can be provided by the first storage unit 131 and the second storage unit 132.

在本發明實施例中,第二子更新檔案會包含完整韌體更新檔案中之子系統韌體更新資料,其中執行相關第一子更新檔案之更新步驟的時間點會早於執行相關第二子更新檔案之更新步驟的時間點。 In the embodiment of the present invention, the second sub-update file will include the sub-system firmware update data in the complete firmware update file, and the time point of executing the update steps of the relevant first sub-update file will be earlier than executing the relevant second sub-update. The time point of the file update step.

第3圖為本發明實施例嵌入式電子裝置100在執行完整韌體更新程序之步驟210後之相關資料示意圖。為了說明目的,假設完整韌體更新檔案被切割為4筆更新資料:rootfs更新資料、OEM套裝更新資料、kernel更新資料,和子系統韌體更新資料,其總檔案大小約為144MB。假設第一儲存單元131和第二儲存單元132所能提供之可用記憶體空間相近,在執行步驟210後,第一子更新檔案可包含rootfs更新資料和OEM套裝更新資料(檔案大小約為73MB)共2筆更新資料,而第二子更新檔案可包含kernel更新資料和子系統韌體更新資料(檔案大小約為71MB)共2筆更新資料,如第3圖所示。 FIG. 3 is a schematic diagram of the relevant data of the embedded electronic device 100 after executing step 210 of the complete firmware update procedure according to the embodiment of the present invention. For the purpose of illustration, it is assumed that the complete firmware update file is divided into four update data: rootfs update data, OEM package update data, kernel update data, and subsystem firmware update data, and the total file size is about 144MB. Assuming that the available memory space provided by the first storage unit 131 and the second storage unit 132 is similar, after executing step 210, the first sub-update file may include two update data, namely, rootfs update data and OEM package update data (file size is about 73MB), and the second sub-update file may include two update data, namely, kernel update data and subsystem firmware update data (file size is about 71MB), as shown in FIG. 3.

在本發明實施例中,第一子更新檔案中每一筆更新資料相異於第二子更新檔案中每一筆更新資料,且第二子更新檔案至少包含子系統韌體更新資料。 In the embodiment of the present invention, each update data in the first sub-update file is different from each update data in the second sub-update file, and the second sub-update file at least includes subsystem firmware update data.

在步驟220中,本發明會製作相關韌體版本、驗證碼和每一子更新檔案之大小的標頭檔。在步驟230中,本發明會依序將標頭檔、第一子更新檔案和第二子更新檔案組合成一完整FOTA檔案。 In step 220, the present invention will create a header file with the firmware version, verification code, and size of each sub-update file. In step 230, the present invention will sequentially combine the header file, the first sub-update file, and the second sub-update file into a complete FOTA file.

第4圖為本發明實施例嵌入式電子裝置100在執行完整韌體更新程序時所產生完整FOTA檔案之示意圖。在一實施例中,驗證碼可為循環冗餘校驗(cyclic redundancy check,CRC),用來校驗資料傳輸或儲存後可能出現的錯誤。在其它實施例中,驗證碼可為根據網路數據封包或電腦檔案等資料而產生的固定位數驗證碼的任何雜湊函式。在一實施例中,Size 1代表第一子更新檔案之檔案大小,其值可為相關第一子更新檔案長度之位元數;Size 2代表第二子更新檔案之檔案大小,其值可為相關第二子更新檔案長度之位元數。然而,標頭檔之格式和驗證碼之類型並不侷限本發明之範疇。 FIG. 4 is a schematic diagram of a complete FOTA file generated when the embedded electronic device 100 of the present invention executes a complete firmware update procedure. In one embodiment, the verification code may be a cyclic redundancy check (CRC) to verify errors that may occur after data transmission or storage. In other embodiments, the verification code may be any hash function of a fixed-bit verification code generated based on data such as network data packets or computer files. In one embodiment, Size 1 represents the file size of the first sub-update file, and its value may be the number of bits of the length of the relevant first sub-update file; Size 2 represents the file size of the second sub-update file, and its value may be the number of bits of the length of the relevant second sub-update file. However, the format of the header file and the type of verification code do not limit the scope of the present invention.

在步驟240中,本發明可透過使用者介面140將完整FOTA檔案上傳至嵌入式電子裝置100。接著在步驟250中,嵌入式電子裝置100會判斷完整FOTA檔案是否能通過正確性驗證。在一實施例中,嵌入式電子裝置100之處理單元110可檢查完整FOTA檔案中的標頭檔內容,並確認驗證碼的正確性。當判定完整FOTA檔案無法通過正確性驗證時,代表在將完整FOTA檔案上傳至嵌入式電子裝置100的過程中可能出現資料損失或損毀,此時本發明會執行步驟320以提示韌體更新失敗,並退出韌體更新程序。 In step 240, the present invention can upload the complete FOTA file to the embedded electronic device 100 through the user interface 140. Then in step 250, the embedded electronic device 100 determines whether the complete FOTA file can pass the correctness verification. In one embodiment, the processing unit 110 of the embedded electronic device 100 can check the header file content in the complete FOTA file and confirm the correctness of the verification code. When it is determined that the complete FOTA file cannot pass the correctness verification, it means that data loss or damage may occur in the process of uploading the complete FOTA file to the embedded electronic device 100. At this time, the present invention will execute step 320 to prompt the firmware update failure and exit the firmware update program.

當在步驟250中判定完整FOTA檔案能通過正確性驗證時,接著會在步驟260和280中依據完整FOTA檔案的標頭檔來分別提取相關第一子更新檔之內容和相關第二子更新檔之內容。以第4圖所示之實施例來做說明,嵌入式電子裝置100之處理單元110可依據完整FOTA檔案 的標頭檔來取得第一子更新檔案之檔案大小Size 1和第二子更新檔案之檔案大小Size 2,再分別依據第一子更新檔案之檔案大小Size 1和第二子更新檔案之檔案大小Size 2來提取相對應資料。舉例來說,當檔案大小Size 1之值為m而檔案大小Size 2之值為n時(m和n為正整數),處理單元110可提取完整FOTA檔案中標頭檔之後的第1至第m位元的資料以作為第一子更新檔案,且提取完整FOTA檔案中標頭檔之後的第(m+1)至第(m+n)位元的資料以作為第二子更新檔案。 When it is determined in step 250 that the complete FOTA file can pass the correctness verification, the content of the relevant first sub-update file and the content of the relevant second sub-update file are extracted respectively according to the header file of the complete FOTA file in steps 260 and 280. Taking the embodiment shown in FIG. 4 as an example, the processing unit 110 of the embedded electronic device 100 can obtain the file size Size 1 of the first sub-update file and the file size Size 2 of the second sub-update file according to the header file of the complete FOTA file, and then extract the corresponding data according to the file size Size 1 of the first sub-update file and the file size Size 2 of the second sub-update file. For example, when the value of file size Size 1 is m and the value of file size Size 2 is n (m and n are positive integers), the processing unit 110 can extract the data of the 1st to mth bits after the header file in the complete FOTA file as the first sub-update file, and extract the data of the (m+1)th to (m+n)th bits after the header file in the complete FOTA file as the second sub-update file.

第5圖至第9圖為本發明實施例嵌入式電子裝置100在透過FOTA技術執行完整韌體更新程序時各階段之資料示意圖。在執行韌體更新程序前,嵌入式電子裝置100內存有現有kernel檔案、現有rootfs檔案、現有OEM檔案,以及現有子系統韌體等。 Figures 5 to 9 are schematic diagrams of data at various stages when the embedded electronic device 100 of the present invention executes a complete firmware update procedure through FOTA technology. Before executing the firmware update procedure, the embedded electronic device 100 stores existing kernel files, existing rootfs files, existing OEM files, and existing subsystem firmware, etc.

在步驟260中,本發明會將從完整FOTA檔案中提取出之第一子更新檔存放至嵌入式電子裝置100之第一儲存單元131內,如第5圖所示。 In step 260, the present invention will store the first sub-update file extracted from the complete FOTA file into the first storage unit 131 of the embedded electronic device 100, as shown in Figure 5.

在步驟270中,本發明會清除子系統模組120中第二儲存單元132內的記憶體空間。接著在步驟280中,本發明會將從完整FOTA檔案中提取出之第二子更新檔存放至子系統模組120中第二儲存單元132內,如第6圖所示。 In step 270, the present invention clears the memory space in the second storage unit 132 in the subsystem module 120. Then in step 280, the present invention stores the second sub-update file extracted from the complete FOTA file in the second storage unit 132 in the subsystem module 120, as shown in Figure 6.

在步驟290中,處理單元110依據完整FOTA檔案中的標頭檔來判斷第一子更新檔案和第二子更新檔案是否完整。當判定第一儲存 單元131內存之第一子更新檔案及/或第二儲存單元132內存之第二子更新檔案並非完整時,代表先前在提取資料及/或儲存資料的過程中可能出現資料損失或損毀,此時本發明會執行步驟320以提示韌體更新失敗,並退出韌體更新程序。 In step 290, the processing unit 110 determines whether the first sub-update file and the second sub-update file are complete based on the header file in the complete FOTA file. When it is determined that the first sub-update file in the first storage unit 131 and/or the second sub-update file in the second storage unit 132 are not complete, it means that data loss or damage may have occurred in the process of extracting data and/or storing data. At this time, the present invention will execute step 320 to prompt the firmware update failure and exit the firmware update program.

在確認第一儲存單元131內存之第一子更新檔案和第二儲存單元132內存之第二子更新檔案的完整性後,嵌入式電子裝置100會在步驟300中重啟系統,接著執行相關第一儲存單元131內存第一子更新檔案之韌體更新步驟。更詳細地說,當在步驟300中重啟系統後,接著會依據第一儲存單元131內存之第一子更新檔案中的rootfs更新資料和OEM更新資料來分別更新現有rootfs檔案和現有OEM檔案,如第7圖所示。 After confirming the integrity of the first sub-update file in the memory of the first storage unit 131 and the second sub-update file in the memory of the second storage unit 132, the embedded electronic device 100 will restart the system in step 300, and then execute the firmware update step related to the first sub-update file in the memory of the first storage unit 131. More specifically, after the system is restarted in step 300, the existing rootfs file and the existing OEM file will be updated respectively according to the rootfs update data and the OEM update data in the first sub-update file in the memory of the first storage unit 131, as shown in Figure 7.

在完成相關第一子更新檔案之更新程序後,嵌入式電子裝置100會在步驟310中再次重啟系統,重啟完成後會將第二儲存單元132內存之第二子更新檔案複製到第一儲存單元131內,如第8圖所示。 After completing the update procedure of the relevant first sub-update file, the embedded electronic device 100 will restart the system again in step 310. After the restart is completed, the second sub-update file in the memory of the second storage unit 132 will be copied to the first storage unit 131, as shown in Figure 8.

接著,嵌入式電子裝置100會執行相關第一儲存單元131內存第二子更新檔案之韌體更新步驟。更詳細地說,當在步驟310中將第二子更新檔案複製到第一儲存單元131內之後,接著會依據第一儲存單元131內存之第二子更新檔案中的kernel更新資料和子系統韌體更新資料來分別更新現有kernel檔案和子系統模組120,如第9圖所示。 Next, the embedded electronic device 100 executes the firmware update step of the second sub-update file stored in the first storage unit 131. More specifically, after the second sub-update file is copied to the first storage unit 131 in step 310, the existing kernel file and subsystem module 120 are updated respectively according to the kernel update data and subsystem firmware update data in the second sub-update file stored in the first storage unit 131, as shown in FIG. 9.

在一實施例中,當嵌入式電子裝置100在步驟300和310重新 開機後,會執行原來設備製造商二級啟動程式(Original Equipment Manufacturer Secondary Boot Loader,OEMSBL)以執行相關第一子更新檔案和第二子更新檔案之更新步驟。然而,嵌入式電子裝置100執行韌體更新步驟之方式並不限定本發明之範疇。 In one embodiment, when the embedded electronic device 100 is restarted in steps 300 and 310, the Original Equipment Manufacturer Secondary Boot Loader (OEMSBL) is executed to execute the update steps of the related first sub-update file and the second sub-update file. However, the way in which the embedded electronic device 100 executes the firmware update step does not limit the scope of the present invention.

第10圖為本發明實施例嵌入式電子裝置100執行完整韌體更新程序後之資料示意圖。在執行完整韌體更新程序後,嵌入式電子裝置100內存有更新後kernel檔案、更新後rootfs檔案、更新後OEM檔案,以及更新後子系統韌體。 FIG. 10 is a schematic diagram of data after the embedded electronic device 100 of the embodiment of the present invention executes a complete firmware update procedure. After executing the complete firmware update procedure, the embedded electronic device 100 stores an updated kernel file, an updated rootfs file, an updated OEM file, and an updated subsystem firmware.

綜上所述,針對內建記憶體空間有限的嵌入式電子裝置,本發明會以多階段FOTA技術來對嵌入式電子裝置執行完整韌體更新程序。針對子系統模組之韌體更新步驟會在最後一階段執行,如此在更新現有子系統韌體前可利用子系統模組之內建記憶體提供的額外可用記憶空間來支援執行完整韌體更新程序所需之記憶體空間。 In summary, for embedded electronic devices with limited built-in memory space, the present invention will use multi-stage FOTA technology to perform a complete firmware update procedure for embedded electronic devices. The firmware update step for the subsystem module will be performed in the last stage, so that before updating the existing subsystem firmware, the additional available memory space provided by the built-in memory of the subsystem module can be used to support the memory space required to execute the complete firmware update procedure.

以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。 The above is only the preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of the present invention.

210-320:步驟 210-320: Steps

Claims (8)

一種對一嵌入式電子裝置執行一完整韌體更新程序之方法,其包含:將一完整韌體更新檔案切割為複數筆更新資料;將該複數筆更新資料區分為一第一子更新檔案和一第二子更新檔案;製作相關每一子更新檔案之檔案大小的一標頭檔(header);依序將該標頭檔、該第一子更新檔案和該第二子更新檔案組合成一完整韌體廣播(firmware over-the-air,FOTA)檔案;將該完整FOTA檔案上傳至該嵌入式電子裝置;依據該標頭檔來從該完整FOTA檔案中提取相關該第一子更新檔之內容,並將提取出之該第一子更新檔存放至該嵌入式電子裝置之一第一儲存單元內;清除該嵌入式電子裝置之一子系統模組中一第二儲存單元內存之一子系統韌體以清除該第二儲存單元之記憶體空間,其中該子系統韌體提供該嵌入式電子裝置之應用所需的功能;依據該標頭檔來從該完整FOTA檔案中提取相關第二子更新檔之內容,並將提取出之該第二子更新檔存放至該第二儲存單元內;在一第一時間點執行相關該第一儲存單元內存該第一子更新檔案之韌體更新步驟;在該第一時間點之後的一第二時間點將該第二儲存單元內存之該第二子更新檔案複製到該第一儲存單元內;以及在該第二時間點之後的一第三時間點執行相關該第一儲存單元內 存該第二子更新檔案之韌體更新步驟,其中:在該嵌入式電子裝置運作期間,該第一儲存單元係提供一第一可用記憶體空間,而該第二儲存單元係提供一第二可用記憶體空間;且該完整韌體更新檔案之檔案大小超過該第一可用記憶空間,但不超過該第一可用記憶空間和該第二可用記憶空間之加總。 A method for executing a complete firmware update program on an embedded electronic device comprises: cutting a complete firmware update file into a plurality of update data; dividing the plurality of update data into a first sub-update file and a second sub-update file; creating a header file (header) related to the file size of each sub-update file; sequentially combining the header file, the first sub-update file and the second sub-update file into a complete firmware broadcast (firmware The method comprises the steps of: extracting a first sub-update file from the complete FOTA file according to the header file, and storing the extracted first sub-update file in a first storage unit of the embedded electronic device; clearing a subsystem firmware in a second storage unit memory of a subsystem module of the embedded electronic device to clear the memory space of the second storage unit, wherein the subsystem firmware provides the functions required by the application of the embedded electronic device; extracting the content of the second sub-update file from the complete FOTA file according to the header file, and storing the extracted second sub-update file in the second storage unit; At a first time point, a firmware update step is performed in relation to the first sub-update file stored in the first storage unit; at a second time point after the first time point, the second sub-update file stored in the second storage unit is copied to the first storage unit; and at a third time point after the second time point, a firmware update step is performed in relation to the second sub-update file stored in the first storage unit, wherein: during the operation of the embedded electronic device, the first storage unit provides a first available memory space, and the second storage unit provides a second available memory space; and the file size of the complete firmware update file exceeds the first available memory space, but does not exceed the sum of the first available memory space and the second available memory space. 如請求項1所述之方法,其中:該完整韌體更新檔案係被切割為(M+N)筆更新資料;該第一子更新檔案包含N筆更新資料;該第二子更新檔案包含M筆更新資料,且該M筆更新資料至少包含相關該子系統韌體之更新資料;N和M為正整數;且該第一子更新檔案中每一筆更新資料的內容相異於該第二子更新檔案中每一筆更新資料的內容。 The method as described in claim 1, wherein: the complete firmware update file is divided into (M+N) update data; the first sub-update file includes N update data; the second sub-update file includes M update data, and the M update data at least includes update data related to the subsystem firmware; N and M are positive integers; and the content of each update data in the first sub-update file is different from the content of each update data in the second sub-update file. 如請求項2所述之方法,其中:該N筆更新資料包含一核心(kernel)更新資料、一根文件系統(root file system,rootfs)更新資料,或一原始設備製造商(original equipment manufacturer,OEM)套裝更新資料;且該M筆更新資料另包含該核心更新資料、該根文件系統更新資料和該原始設備製造商套裝更新資料中未包含在該N筆更新資料中之更新資料。 The method as described in claim 2, wherein: the N update data include a kernel update data, a root file system (rootfs) update data, or an original equipment manufacturer (OEM) package update data; and the M update data also include the kernel update data, the root file system update data, and the update data in the OEM package update data that are not included in the N update data. 如請求項1所述之方法,其另包含:依據該第一儲存單元之記憶體空間和該第二儲存單元之記憶體空間之間的比例來決定M和N之值,其中該第二儲存單元之記憶體空間不大於該第一儲存單元之記憶體空間。 The method as described in claim 1 further comprises: determining the values of M and N according to the ratio between the memory space of the first storage unit and the memory space of the second storage unit, wherein the memory space of the second storage unit is not larger than the memory space of the first storage unit. 如請求項1所述之方法,其另包含:製作相關每一子更新檔案之檔案大小和一驗證碼的該標頭檔;在將該完整FOTA檔案上傳至該嵌入式電子裝置後,依據該標頭檔之該驗證碼來判斷該完整FOTA檔案是否能通過正確性驗證;以及在判定該完整FOTA檔案能通過正確性驗證後,依據該標頭檔來從該完整FOTA檔案中提取相關該第一子更新檔之內容和相關該第二子更新檔之內容。 The method as described in claim 1 further comprises: creating the header file of the file size and a verification code of each sub-update file; after uploading the complete FOTA file to the embedded electronic device, judging whether the complete FOTA file can pass the correctness verification according to the verification code of the header file; and after judging that the complete FOTA file can pass the correctness verification, extracting the content of the first sub-update file and the content of the second sub-update file from the complete FOTA file according to the header file. 如請求項1所述之方法,其另包含:在將提取出之該第一子更新檔存放至該第一儲存單元內之後,判斷該第一子更新檔案是否完整;及在判定該第一子更新檔案為完整之後,在該第一時間點重啟該嵌入式電子裝置以執行相關該第一儲存單元內存該第一子更新檔案之韌體更新步驟。 The method as described in claim 1 further comprises: after storing the extracted first sub-update file in the first storage unit, determining whether the first sub-update file is complete; and after determining that the first sub-update file is complete, restarting the embedded electronic device at the first time point to execute a firmware update step related to the first sub-update file stored in the first storage unit. 如請求項1所述之方法,其另包含:在該第二時間點將該第二儲存單元內存之該第二子更新檔案複製 到該第一儲存單元內之後,判斷該第二子更新檔案是否完整;及在判定該第二子更新檔案為完整之後,在該第三時間點重啟該嵌入式電子裝置以執行相關該第一儲存單元內存該第二子更新檔案之韌體更新步驟。 The method as described in claim 1 further comprises: after copying the second sub-update file in the second storage unit memory to the first storage unit at the second time point, determining whether the second sub-update file is complete; and after determining that the second sub-update file is complete, restarting the embedded electronic device at the third time point to execute the firmware update step related to the second sub-update file in the first storage unit memory. 如請求項5-7中任一項所述之方法,其另包含:當判定該完整FOTA檔案無法通過正確性驗證、當在將提取出之該第一子更新檔存放至該第一儲存單元內之後判定該第一子更新檔案並非完整,及/或當在將該第二儲存單元內存之該第二子更新檔案複製到該第一儲存單元內之後判定該第二子更新檔案並非完整時,提示韌體更新失敗,並退出該完整韌體更新程序。 The method as described in any one of claim items 5-7 further comprises: when it is determined that the complete FOTA file cannot pass the correctness verification, when it is determined that the first sub-update file is incomplete after the extracted first sub-update file is stored in the first storage unit, and/or when it is determined that the second sub-update file is incomplete after the second sub-update file stored in the second storage unit is copied to the first storage unit, prompting that the firmware update fails and exiting the complete firmware update procedure.
TW112142470A 2023-04-10 2023-11-03 Method of performing full firmware update procedure on embedded electronic device TWI854882B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US18/515,228 US12417088B2 (en) 2023-04-10 2023-11-20 Method of performing full firmware update procedure on embedded electronic device and related embedded electronic device
EP23212863.7A EP4446876A1 (en) 2023-04-10 2023-11-29 Method of performing full firmware update procedure on embedded electronic device and related embedded electronic device
JP2024000876A JP7683165B2 (en) 2023-04-10 2024-01-05 How to perform a complete firmware update procedure for embedded electronic devices

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US202363458166P 2023-04-10 2023-04-10
US63/458,166 2023-04-10

Publications (2)

Publication Number Publication Date
TWI854882B true TWI854882B (en) 2024-09-01
TW202441372A TW202441372A (en) 2024-10-16

Family

ID=92985004

Family Applications (1)

Application Number Title Priority Date Filing Date
TW112142470A TWI854882B (en) 2023-04-10 2023-11-03 Method of performing full firmware update procedure on embedded electronic device

Country Status (2)

Country Link
CN (1) CN118778986A (en)
TW (1) TWI854882B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130111455A1 (en) * 2010-08-27 2013-05-02 Huawei Device Co., Ltd. Method for processing firmware based on firmware over the air technology, apparatus, and system
TW201516869A (en) * 2013-10-30 2015-05-01 Insyde Software Corp Electronic device, updating method of firmware file for universal extensible firmware interface basic input output system (UEFI BIOS), storage medium and computer program product
WO2019020111A1 (en) * 2017-07-27 2019-01-31 中兴通讯股份有限公司 Upgrade package making method and apparatus, and method and apparatus for upgrading file
CN110704084A (en) * 2019-09-27 2020-01-17 深圳忆联信息系统有限公司 Method and device for dynamically allocating memory in firmware upgrade, computer equipment and storage medium
CN110874239A (en) * 2020-01-20 2020-03-10 翱捷科技(上海)有限公司 Air firmware differential upgrading method and device for electronic equipment
CN111240722A (en) * 2020-01-07 2020-06-05 翱捷科技(上海)有限公司 Method for upgrading firmware over the air, and terminal, server and system applied by same
CN113641382A (en) * 2021-07-27 2021-11-12 瑞芯微电子股份有限公司 Partitionable system update method and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130111455A1 (en) * 2010-08-27 2013-05-02 Huawei Device Co., Ltd. Method for processing firmware based on firmware over the air technology, apparatus, and system
TW201516869A (en) * 2013-10-30 2015-05-01 Insyde Software Corp Electronic device, updating method of firmware file for universal extensible firmware interface basic input output system (UEFI BIOS), storage medium and computer program product
WO2019020111A1 (en) * 2017-07-27 2019-01-31 中兴通讯股份有限公司 Upgrade package making method and apparatus, and method and apparatus for upgrading file
CN110704084A (en) * 2019-09-27 2020-01-17 深圳忆联信息系统有限公司 Method and device for dynamically allocating memory in firmware upgrade, computer equipment and storage medium
CN111240722A (en) * 2020-01-07 2020-06-05 翱捷科技(上海)有限公司 Method for upgrading firmware over the air, and terminal, server and system applied by same
CN110874239A (en) * 2020-01-20 2020-03-10 翱捷科技(上海)有限公司 Air firmware differential upgrading method and device for electronic equipment
CN113641382A (en) * 2021-07-27 2021-11-12 瑞芯微电子股份有限公司 Partitionable system update method and storage medium

Also Published As

Publication number Publication date
TW202441372A (en) 2024-10-16
CN118778986A (en) 2024-10-15

Similar Documents

Publication Publication Date Title
CN110083374B (en) Upgrade rollback method, system and terminal equipment
CN101436138B (en) Control device and control method for software upgrade and dynamic rolling back
US20110320794A1 (en) Flash System And Method For Updating The Flash System
TWI533216B (en) Operating system updating method
CN104679530A (en) Server system and firmware updating method
CN110474977B (en) Firmware upgrade method for smart door lock, firmware upgrade system and smart door lock
CN110162429B (en) System repair method, server and storage medium
US20170357497A1 (en) Method for updating a firmware file of an input/output module
CN113672270B (en) Upgrading method, computer system and remote upgrading device
CN106445580A (en) Method and device for BMC (Baseboard Management Controller) with external upgrading
WO2017036228A1 (en) Method and apparatus for implementing system upgrading
CN106126273A (en) A kind of method of upgrading BIOS
CN109002312A (en) Method for upgrading software, device and upgrade server and equipment
CN106886436A (en) A kind of method and apparatus of android system upgrading
WO2025156688A1 (en) Server firmware upgrading method and apparatus, non-volatile readable storage medium, and electronic device
CN112822248A (en) OTA upgrading method, OTA upgrading device, readable medium and electronic equipment
CN114265603B (en) System upgrade method, device and electronic device based on asymmetric partitioning
CN102880478B (en) Software update method
CN114840242A (en) System upgrading method and device of electronic equipment and readable storage medium
TWI854882B (en) Method of performing full firmware update procedure on embedded electronic device
JP7683165B2 (en) How to perform a complete firmware update procedure for embedded electronic devices
CN117348905A (en) BMC firmware updating method, system, terminal and storage medium
CN114116289A (en) Mirror image file repairing method and device, AP (access point) equipment and network system
EP3788473B1 (en) Recovery image downloads via data chunks
CN112994907B (en) Network configuration method, device, storage medium and equipment of virtual machine