[go: up one dir, main page]

TWI855881B - Method of mutually updating bootloader and main programs - Google Patents

Method of mutually updating bootloader and main programs Download PDF

Info

Publication number
TWI855881B
TWI855881B TW112136962A TW112136962A TWI855881B TW I855881 B TWI855881 B TW I855881B TW 112136962 A TW112136962 A TW 112136962A TW 112136962 A TW112136962 A TW 112136962A TW I855881 B TWI855881 B TW I855881B
Authority
TW
Taiwan
Prior art keywords
program
main program
boot program
communication interface
updating
Prior art date
Application number
TW112136962A
Other languages
Chinese (zh)
Other versions
TW202514354A (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 TW112136962A priority Critical patent/TWI855881B/en
Application granted granted Critical
Publication of TWI855881B publication Critical patent/TWI855881B/en
Publication of TW202514354A publication Critical patent/TW202514354A/en

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

A method of mutually updating bootloader and main programs is provided. The method includes steps of: receiving an updating signal that is generated by an external device from an external communication interface, through a communication interface; determining, by a processor, whether or not to update one or both of the bootloader and main programs according to the updating signal, in response to determining not to update one or both of the bootloader and main programs according to the updating signal, continually performing this original process and waiting for receiving a next updating signal, and in response to determining to update one or both of the bootloader and main programs according to the updating signal, performing one of the bootloader and main programs for updating the other of the bootloader and main programs.

Description

開機程式與主程式的相互更新方法How to update the boot program and main program

本發明涉及一種程式的更新方法,特別是涉及一種開機程式與主程式的相互更新方法。The present invention relates to a program updating method, and in particular to a method for mutually updating a boot program and a main program.

很多電子產品在不變更硬體的前提下,透過產品既有的對外通訊介面更新產品的程式(韌體),以達到功能升級或修正程式問題的目的。想要達到這個目的,產品的程式需要有兩個可獨立運作的程式,開機程式與主程式。開機程式負責透過產品既有的對外通訊介面接收指示與程式碼來更新主程式。主程式負責電子產品功能的完成。通常開機程式是嵌入式系統在加電後執行的第一段代碼,它判斷是否留在開機程式等待指示更新主程式,或跳到主程式所在的位址啟動運行。業界設計的開機程式通常設計完成即不再變動,萬一不得已需要更新,通常需要拆除產品外殼連接燒錄器才能達到更新開機程式的目的。Many electronic products can update the program (firmware) of the product through the existing external communication interface of the product without changing the hardware to achieve the purpose of functional upgrade or correction of program problems. To achieve this goal, the product program needs to have two independently operating programs, the boot program and the main program. The boot program is responsible for receiving instructions and program codes through the existing external communication interface of the product to update the main program. The main program is responsible for completing the functions of the electronic product. Usually, the boot program is the first code executed by the embedded system after power-on. It determines whether to stay in the boot program and wait for instructions to update the main program, or jump to the address where the main program is located to start running. Boot programs designed by the industry are usually designed and will not be changed once they are completed. If they need to be updated, it is usually necessary to remove the product casing and connect a burner to achieve the purpose of updating the boot program.

本發明針對現有技術的不足提供一種開機程式與主程式的相互更新方法,包含以下步驟:通過通訊介面,從外部通訊介面接收外部裝置輸出的更新訊號;由處理器,依據所述更新訊號以判斷是否更新一開機程式、一主程式或兩者,若否,則繼續進行原本行程並通過所述通訊介面從外部裝置等待接收下一所述更新訊號,若是,執行下一步驟;以及由所述處理器,依據所述更新訊號,執行所述開機程式以及所述主程式中的任一者,更新所述開機程式以及所述主程式中的另一者。The present invention aims at the inadequacies of the prior art and provides a mutual updating method of a boot program and a main program, comprising the following steps: receiving an update signal outputted by an external device from an external communication interface through a communication interface; a processor, according to the update signal, determining whether to update a boot program, a main program or both, if not, continuing the original process and waiting to receive the next update signal from the external device through the communication interface, if yes, executing the next step; and the processor, according to the update signal, executing either the boot program or the main program to update the other of the boot program and the main program.

如上所述,本發明提供一種開機程式與主程式的相互更新方法。在本發明的開機程式與主程式的相互更新方法中,透過既有的通訊介面接收更新指令,在不需使用到燒錄器的條件下,依據接收到的更新指令,以實現開機程式與主程式相互更新,或是開機程式與主程式中的任一者的更新。As described above, the present invention provides a method for updating a boot program and a main program mutually. In the method for updating a boot program and a main program mutually, an update command is received through an existing communication interface, and the boot program and the main program are updated mutually, or either of the boot program and the main program is updated according to the received update command without using a burner.

為使能更進一步瞭解本發明的特徵及技術內容,請參閱以下有關本發明的詳細說明與圖式,然而所提供的圖式僅用於提供參考與說明,並非用來對本發明加以限制。To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only used for reference and description and are not used to limit the present invention.

以下是通過特定的具體實施例來說明本發明的實施方式,本領域技術人員可由本說明書所公開的內容瞭解本發明的優點與效果。本發明可通過其他不同的具體實施例加以施行或應用,本說明書中的各項細節也可基於不同觀點與應用,在不背離本發明的構思下進行各種修改與變更。另外,本發明的附圖僅為簡單示意說明,並非依實際尺寸的描繪,事先聲明。以下的實施方式將進一步詳細說明本發明的相關技術內容,但所公開的內容並非用以限制本發明的保護範圍。另外,本文中所使用的術語“或”,應視實際情況可能包含相關聯的列出項目中的任一個或者多個的組合。The following is an explanation of the implementation of the present invention through specific concrete embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the contents disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments. The details in this specification can also be modified and changed in various ways based on different viewpoints and applications without departing from the concept of the present invention. In addition, the drawings of the present invention are only for simple schematic illustrations and are not depicted according to actual sizes. Please note in advance. The following implementation will further explain the relevant technical contents of the present invention in detail, but the disclosed contents are not intended to limit the scope of protection of the present invention. In addition, the term "or" used in this article may include any one or more combinations of the related listed items depending on the actual situation.

請參閱圖1至圖5,其中圖1至圖4為本發明實施例的開機程式與主程式的相互更新方法的步驟的流程圖,圖5為本發明實施例的開機程式與主程式的更新系統的方塊圖。Please refer to Figures 1 to 5, wherein Figures 1 to 4 are flow charts of the steps of the mutual updating method of the boot program and the main program of the embodiment of the present invention, and Figure 5 is a block diagram of the updating system of the boot program and the main program of the embodiment of the present invention.

本發明的開機程式與主程式的相互更新方法可由如圖5所示的開機程式與主程式的相互更新系統100(包含處理器10以及與處理器10相連接的通訊介面20)執行。The boot program and main program mutual updating method of the present invention can be executed by a boot program and main program mutual updating system 100 (including a processor 10 and a communication interface 20 connected to the processor 10) as shown in FIG. 5 .

處理器10通過通訊介面20從一外部通訊介面91接收外部裝置92輸出的更新訊號,依據接收到的此更新訊號以判斷是否更新開機程式、主程式或兩者,執行開機程式以及主程式中的任一者,更新開機程式以及主程式中的另一者。The processor 10 receives an update signal output by an external device 92 from an external communication interface 91 through a communication interface 20, and determines whether to update the boot program, the main program, or both based on the received update signal, and executes either the boot program or the main program to update the other of the boot program and the main program.

詳言之,本發明的開機程式與主程式的相互更新方法可包含如圖1所示的步驟S101~S109、如圖2所示的S201~S207、如圖3所示的S301~S305及/或如圖4所示的S401~S403,詳細說明如下。In detail, the mutual updating method of the boot program and the main program of the present invention may include steps S101-S109 as shown in FIG. 1, S201-S207 as shown in FIG. 2, S301-S305 as shown in FIG. 3 and/or S401-S403 as shown in FIG. 4, as described in detail below.

請參閱圖1和圖5,其中圖1為本發明實施例的開機程式與主程式的相互更新方法所包含的先更新主程式後更新開機程式的步驟的流程圖。Please refer to FIG. 1 and FIG. 5 , wherein FIG. 1 is a flow chart of the steps of first updating the main program and then updating the boot program included in the mutual updating method of the boot program and the main program of the embodiment of the present invention.

若先更新主程式,而後更新開機程式,可執行如圖1所示的步驟S101~S109。If the main program is updated first and then the boot program is updated, steps S101 to S109 as shown in FIG. 1 may be executed.

首先,處理器10依據通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一主程式更新指令,從主程式運行的位址跳至開機程式儲存的位址(在如圖1所示的步驟S101)。First, the processor 10 jumps from the address where the main program is executed to the address where the boot program is stored according to a main program update command output by the external device 92 received from the external communication interface 91 through the communication interface 20 (in step S101 as shown in FIG. 1 ).

接著,處理器10依據從外部裝置92接收到的一主程式更新指令,執行開機程式,使用通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一主程式更新資料,來更新主程式(在如圖1所示的步驟S103)。Next, the processor 10 executes the boot program according to a main program update command received from the external device 92, and updates the main program using a main program update data output by the external device 92 received from the external communication interface 91 through the communication interface 20 (in step S103 as shown in FIG. 1).

接著,從開機程式運行的位址跳至主程式儲存的位址(在如圖1所示的步驟S105)。Next, jump from the address where the boot program is running to the address where the main program is stored (in step S105 as shown in FIG. 1 ).

接著,執行主程式,處理器10可依據通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一開機程式更新指令,使用通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一開機程式更新資料,來更新開機程式(在如圖1所示的步驟S107)。Next, the main program is executed, and the processor 10 can update the boot program according to a boot program update command output by the external device 92 received from the external communication interface 91 through the communication interface 20, using a boot program update data output by the external device 92 received from the external communication interface 91 through the communication interface 20 (in step S107 as shown in Figure 1).

最後,處理器10執行更新後的主程式以及開機程式(在如圖1所示的步驟S109)。Finally, the processor 10 executes the updated main program and the boot program (in step S109 as shown in FIG. 1 ).

請參閱圖2和圖5,其中圖2為本發明實施例的開機程式與主程式的相互更新方法所包含的先更新開機程式後更新主程式的步驟的流程圖。Please refer to FIG. 2 and FIG. 5 , wherein FIG. 2 is a flow chart of the steps of first updating the boot program and then updating the main program included in the mutual updating method of the boot program and the main program of the embodiment of the present invention.

若先更新開機式,而後更新主程式,可執行如圖2所示的步驟S201~S207。If the boot program is updated first and then the main program is updated, steps S201 to S207 as shown in FIG. 2 may be executed.

處理器10依據通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一開機程式更新指令,執行主程式,使用通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一開機程式更新資料,來更新開機程式(在如圖2所示的步驟S201)。The processor 10 executes the main program according to a boot program update command output by the external device 92 received from the external communication interface 91 through the communication interface 20, and uses a boot program update data output by the external device 92 received from the external communication interface 91 through the communication interface 20 to update the boot program (in step S201 as shown in Figure 2).

接著,處理器10依據通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一主程式更新指令,從主程式儲存的位址跳回開機程式儲存的位址(在如圖2所示的步驟S203)。Next, the processor 10 jumps back from the address where the main program is stored to the address where the boot program is stored according to a main program update command outputted by the external device 92 and received from the external communication interface 91 via the communication interface 20 (in step S203 as shown in FIG. 2 ).

接著,執行開機程式,使用通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一主程式更新資料,來更新主程式(在如圖2所示的步驟S205)。Next, the boot program is executed to update the main program using a main program update data outputted from the external device 92 received from the external communication interface 91 via the communication interface 20 (in step S205 as shown in FIG. 2 ).

接著,處理器10執行更新後的主程式以及開機程式(在如圖2所示的步驟S207)。Next, the processor 10 executes the updated main program and the boot program (in step S207 as shown in FIG. 2 ).

請參閱圖3和圖5,其中圖3為本發明實施例的開機程式與主程式的相互更新方法所包含的僅更新主程式的步驟的流程圖。Please refer to FIG. 3 and FIG. 5 , wherein FIG. 3 is a flow chart of the steps of updating only the main program included in the mutual updating method of the boot program and the main program of the embodiment of the present invention.

若僅更新主程式,可執行如圖3所示的S301~S305。If only the main program is updated, S301 to S305 as shown in FIG. 3 may be executed.

處理器10依據通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一主程式更新指令,從主程式運行的位址跳至開機程式儲存的位址(在如圖3所示的步驟S301)。The processor 10 jumps from the address where the main program is executed to the address where the boot program is stored according to a main program update command outputted by the external device 92 and received from the external communication interface 91 via the communication interface 20 (in step S301 as shown in FIG. 3 ).

接著,處理器10依據主程式更新指令,執行開機程式,使用通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一主程式更新資料,來更新主程式(在如圖3所示的步驟S303)。Next, the processor 10 executes the boot program according to the main program update instruction, and updates the main program using a main program update data output by the external device 92 received from the external communication interface 91 through the communication interface 20 (in step S303 as shown in FIG. 3 ).

接著,處理器10執行更新後的主程式(在如圖3所示的步驟S305)。Next, the processor 10 executes the updated main program (in step S305 as shown in FIG. 3 ).

請參閱圖4和圖5,其中圖4為本發明實施例的開機程式與主程式的相互更新方法所包含僅更新開機程式的步驟的流程圖。Please refer to FIG. 4 and FIG. 5 , wherein FIG. 4 is a flow chart of the step of updating only the boot program in the method for mutually updating the boot program and the main program according to the embodiment of the present invention.

若僅更新開機程式,可執行如圖4所示的S401~S403。If you only want to update the boot program, you can execute S401~S403 as shown in Figure 4.

執行主程式,處理器10依據通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一開機程式更新指令,使用通過通訊介面20從外部通訊介面91接收到的外部裝置92所輸出的一開機程式更新資料,來更新開機程式(在如圖4所示的步驟S401)。To execute the main program, the processor 10 updates the boot program according to a boot program update command output by the external device 92 received from the external communication interface 91 through the communication interface 20, using a boot program update data output by the external device 92 received from the external communication interface 91 through the communication interface 20 (in step S401 as shown in FIG. 4 ).

接著,處理器10執行更新後的開機程式(在如圖4所示的步驟S403)。Next, the processor 10 executes the updated boot program (in step S403 as shown in FIG. 4 ).

綜上所述,本發明提供一種開機程式與主程式的相互更新方法。在本發明的開機程式與主程式的相互更新方法中,透過既有的通訊介面接收更新指令,在不需使用到燒錄器的條件下,依據接收到的更新指令,以實現開機程式與主程式相互更新,或是開機程式與主程式中的任一者的更新。In summary, the present invention provides a method for updating a boot program and a main program mutually. In the method for updating a boot program and a main program mutually, an update command is received through an existing communication interface, and the boot program and the main program are updated mutually, or either of the boot program and the main program is updated according to the received update command without using a burner.

以上所公開的內容僅為本發明的優選可行實施例,並非因此侷限本發明的申請專利範圍,所以凡是運用本發明說明書及圖式內容所做的等效技術變化,均包含於本發明的申請專利範圍內。The contents disclosed above are only preferred feasible embodiments of the present invention and are not intended to limit the scope of the patent application of the present invention. Therefore, all equivalent technical changes made using the contents of the specification and drawings of the present invention are included in the scope of the patent application of the present invention.

S101~S109、S201~S207、S301~S305、S401~S403:步驟S101~S109, S201~S207, S301~S305, S401~S403: Steps

100:相互更新系統100: Mutual update system

10:處理器10: Processor

20:通訊介面20: Communication interface

91:外部通訊介面91: External communication interface

92:外部裝置92: External device

圖1為本發明實施例的開機程式與主程式的相互更新方法所包含的先更新主程式後更新開機程式的步驟的流程圖。FIG. 1 is a flow chart of the steps of first updating the main program and then updating the boot program included in the mutual updating method of the boot program and the main program according to the embodiment of the present invention.

圖2為本發明實施例的開機程式與主程式的相互更新方法所包含的先更新開機程式後更新主程式的步驟的流程圖。FIG. 2 is a flow chart of the steps of first updating the boot program and then updating the main program included in the method for mutually updating the boot program and the main program of the embodiment of the present invention.

圖3為本發明實施例的開機程式與主程式的相互更新方法所包含的僅更新主程式的步驟的流程圖。FIG. 3 is a flow chart of the steps of updating only the main program included in the mutual updating method of the boot program and the main program of the embodiment of the present invention.

圖4為本發明實施例的開機程式與主程式的相互更新方法所包含僅更新開機程式的步驟的流程圖。FIG. 4 is a flow chart of the method for mutually updating the boot program and the main program according to the embodiment of the present invention, including the step of updating only the boot program.

圖5為本發明實施例的開機程式與主程式的更新系統的方塊圖。FIG5 is a block diagram of the boot program and the main program update system of an embodiment of the present invention.

S101~S109:步驟 S101~S109: Steps

Claims (2)

一種開機程式與主程式的相互更新方法,包含以下步驟:由一處理器,執行一主程式,依據通過一通訊介面從一外部通訊介面接收到的一外部裝置輸出的一開機程式更新指令,使用通過所述通訊介面從所述外部通訊介面接收到的所述外部裝置輸出的一開機程式更新資料,來更新一開機程式;由所述處理器,依據通過所述通訊介面從所述外部通訊介面接收到的所述外部裝置輸出的一主程式更新指令,從所述主程式儲存的位址跳回所述開機程式儲存的位址;由所述處理器,依據所述主程式更新指令,執行所述開機程式,使用通過所述通訊介面從所述外部通訊介面接收到的所述外部裝置輸出的一主程式更新資料,來更新所述主程式;以及由所述處理器,執行更新後的所述主程式以及所述開機程式。 A method for updating a boot program and a main program mutually comprises the following steps: a processor executes a main program, and according to a boot program update instruction outputted by an external device received from an external communication interface through a communication interface, updates a boot program using a boot program update data outputted by the external device received from the external communication interface through the communication interface; the processor executes a main program according to a boot program update instruction outputted by an external device received from the external communication interface through the communication interface; A main program update command outputted by the external device is received, and the address where the main program is stored is jumped back to the address where the boot program is stored; the processor executes the boot program according to the main program update command, and updates the main program using a main program update data outputted by the external device received from the external communication interface through the communication interface; and the processor executes the updated main program and the boot program. 如請求項1所述的開機程式與主程式的相互更新方法,更包含以下步驟:在由所述處理器更新所述主程式之後,從所述開機程式運行的位址跳至所述主程式儲存的位址,由所述處理器依據所述開機程式更新指令執行所述主程式,使用所述開機程式更新資料,來更新所述開機程式。 The mutual updating method of the boot program and the main program as described in claim 1 further comprises the following steps: after the processor updates the main program, the address where the boot program is running is jumped to the address where the main program is stored, and the processor executes the main program according to the boot program update instruction, and uses the boot program update data to update the boot program.
TW112136962A 2023-09-27 2023-09-27 Method of mutually updating bootloader and main programs TWI855881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW112136962A TWI855881B (en) 2023-09-27 2023-09-27 Method of mutually updating bootloader and main programs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW112136962A TWI855881B (en) 2023-09-27 2023-09-27 Method of mutually updating bootloader and main programs

Publications (2)

Publication Number Publication Date
TWI855881B true TWI855881B (en) 2024-09-11
TW202514354A TW202514354A (en) 2025-04-01

Family

ID=93649237

Family Applications (1)

Application Number Title Priority Date Filing Date
TW112136962A TWI855881B (en) 2023-09-27 2023-09-27 Method of mutually updating bootloader and main programs

Country Status (1)

Country Link
TW (1) TWI855881B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200941344A (en) * 2008-03-21 2009-10-01 Asustek Comp Inc Computer system with dual boot-program area and method of booting the same
TW201419152A (en) * 2012-11-14 2014-05-16 Taiwan Secom Co Ltd Electornic device with segmented updating program function
CN113220319A (en) * 2021-03-17 2021-08-06 广州橙行智动汽车科技有限公司 Data updating method and device and vehicle

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200941344A (en) * 2008-03-21 2009-10-01 Asustek Comp Inc Computer system with dual boot-program area and method of booting the same
TW201419152A (en) * 2012-11-14 2014-05-16 Taiwan Secom Co Ltd Electornic device with segmented updating program function
CN113220319A (en) * 2021-03-17 2021-08-06 广州橙行智动汽车科技有限公司 Data updating method and device and vehicle

Also Published As

Publication number Publication date
TW202514354A (en) 2025-04-01

Similar Documents

Publication Publication Date Title
CN100445952C (en) Method and device for upgrading software version in communication equipment
US10437580B2 (en) Software updating methods and systems
JP2010541105A (en) Firmware image update and management
CN109416632B (en) Apparatus and method for processing data
CN105138382A (en) Method and terminal for upgrading Android system
US9411605B2 (en) Device-less and system agnostic unified extensible firmware interface (UEFI) driver
TWI855881B (en) Method of mutually updating bootloader and main programs
US7962736B1 (en) Interactive pre-OS firmware update with repeated disabling of interrupts
CN107943544B (en) Kernel patch loading method and device
JP2002196936A (en) Starting method of system with invalidated system bios
CN102169446B (en) BIOS (basic input/output system) system and method based on basic input/output system of open source system
CN112612498A (en) Embedded equipment upgrading method and embedded equipment
JP7102524B2 (en) Firmware release of multiple binary images
JP5328410B2 (en) Booted operating system (OS) operation computer, computer OS boot method, and OS boot program
CN113064647A (en) Method, device, terminal and storage medium for configuring project port in BIOS
CN101990662B (en) Program execution device and method for controlling the same
CN101101559A (en) Engineering application method and device for starting and guiding CPU by using dual Bootrom
JP6635195B2 (en) Information processing apparatus and application management method
TWI726524B (en) Electronic processing devices and memory control methods thereof
JP6248682B2 (en) Information processing apparatus, BIOS update method, and BIOS update program
US10725791B2 (en) Operating system boot up optimizations
CN119781787A (en) Mutual updating method between boot program and main program
CN103123586A (en) Upgrading device and method based on Linux embedded operating system
TWI733284B (en) Hardware setting device and hardware setting method thereof
WO2012104950A1 (en) Activation control device, information apparatus, and activation control method