TWI768198B - Microcontroller, memory module, and method for updating firmware of the microcontroller - Google Patents
Microcontroller, memory module, and method for updating firmware of the microcontroller Download PDFInfo
- Publication number
- TWI768198B TWI768198B TW108111648A TW108111648A TWI768198B TW I768198 B TWI768198 B TW I768198B TW 108111648 A TW108111648 A TW 108111648A TW 108111648 A TW108111648 A TW 108111648A TW I768198 B TWI768198 B TW I768198B
- Authority
- TW
- Taiwan
- Prior art keywords
- mcu
- data
- checksum
- application
- check
- Prior art date
Links
Images
Landscapes
- Stored Programmes (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
本發明係關於一種微控制器、記憶體模組及用於更新微控制器之韌體的方法,尤其是關於一種可不斷電進行韌體更新的微控制器、記憶體模組及方法。 The present invention relates to a microcontroller, a memory module and a method for updating the firmware of the microcontroller, in particular to a microcontroller, a memory module and a method for updating the firmware without power failure.
記憶體模組可包括模組板及安裝於模組板上之一些揮發性記憶體組件。除記憶體組件以外的一些組件(例如光學組件、音訊組件等)亦可整合至模組板中。一或多個控制器(例如,微控制器單元Microcontroller Unit,MCU)由此引入於記憶體模組上以控制此等組件。 A memory module may include a module board and some volatile memory components mounted on the module board. Some components other than memory components (eg, optical components, audio components, etc.) can also be integrated into the module board. One or more controllers (eg, Microcontroller Unit, MCU) are thus introduced on the memory module to control these components.
由控制器運行之韌體可能需要更新以修正錯誤(其導致此等非記憶體組件之故障)或將特徵添加至此等非記憶體組件。 The firmware run by the controller may need to be updated to fix bugs that cause the failure of these non-memory components or to add features to these non-memory components.
本發明提供一種不需要關閉電腦電源以使對使用者之中斷最小化的韌體更新方案。 The present invention provides a firmware update solution that does not require shutting down the computer power to minimize interruption to users.
本發明之一些實施例提供一種微控制器單元(Microcontroller Unit,MCU)。MCU包括處理單元及記憶體單元。記憶體單元經組態以包括開機載入程式區段。開機載入程式區段經組態以儲存 電腦程式碼。該電腦程式碼在由該處理單元執行時,使得該MCU根據複數個資料塊及與該等資料塊相關聯的複數個檢查和執行第一檢查機制,以在韌體更新階段產生複數個第一檢查結果。 Some embodiments of the present invention provide a microcontroller unit (Microcontroller Unit, MCU). The MCU includes a processing unit and a memory unit. The memory unit is configured to include a boot loader section. The boot loader section is configured to store computer code. The computer code, when executed by the processing unit, causes the MCU to perform a first check mechanism according to a plurality of data blocks and a plurality of check sums associated with the data blocks to generate a plurality of first check mechanisms during the firmware update phase test result.
本發明之一些實施例提供一種記憶體模組。該記憶體模組包括模組板、複數個揮發性記憶體組件及MCU。模組板具有介面。揮發性記憶體組件安置於模組板上,且經由介面電連接至外部中央處理單元(Central Processing Unit,CPU)。MCU安置於模組板上,且經組態以:在開機載入程式模式下自外部CPU接收複數個資料塊及複數個檢查和,複數個資料塊中之每一者與來自該複數個檢查和的指定檢查和配對,其中資料塊及檢查和由外部CPU自經更新之韌體檔案擷取;以及檢查複數個資料塊中之每一者是否對應於指定檢查和。 Some embodiments of the present invention provide a memory module. The memory module includes a module board, a plurality of volatile memory components and an MCU. The module board has an interface. The volatile memory component is disposed on the module board, and is electrically connected to an external central processing unit (CPU) through an interface. The MCU is disposed on the module board and is configured to: receive a plurality of data blocks and a plurality of checksums from an external CPU in a boot loader mode, each of the plurality of data blocks and a plurality of checksums from the plurality of checksums a specified checksum pairing of the sums, wherein the data blocks and the checksums are retrieved from the updated firmware file by the external CPU; and checking whether each of the plurality of data blocks corresponds to the specified checksums.
本發明之一些實施例提供一種用於更新MCU之韌體的方法。MCU經由通道與外部CPU以通信方式耦接。該方法包括:外部CPU接收經更新之韌體檔案;外部CPU執行經更新之韌體檔案以獲取複數個資料塊及與該等資料塊相關聯的複數個檢查和;MCU接收複數個資料塊中之第一資料塊及複數個檢查和中指定給第一資料塊之第一檢查和;以及MCU根據第一資料塊及第一檢查和執行檢查機制,以產生第一檢查結果。 Some embodiments of the present invention provide a method for updating the firmware of an MCU. The MCU is communicatively coupled to an external CPU via a channel. The method includes: an external CPU receives an updated firmware file; the external CPU executes the updated firmware file to obtain a plurality of data blocks and a plurality of checksums associated with the data blocks; the MCU receives the data in the plurality of data blocks The first data block and the plurality of checksums are assigned to a first checksum of the first data block; and the MCU executes a check mechanism according to the first data block and the first checksum to generate a first check result.
本發明之一些實施例提供一種用於初始化MCU之方法。MCU經由通道與外部CPU以通信方式耦接。該方法包括:MCU根據應用程式區段中之應用程式資料及資料區段中之應用程式檢查和執行第一檢查機制,以產生第一檢查結果;當第一檢查結果正確時,MCU進入應用程式模式;當第一檢查結果不正確時,MCU進入開機載入程式模式;以及 當MCU處於開機載入程式模式下時,執行所提及之更新MCU之韌體的方法。 Some embodiments of the present invention provide a method for initializing an MCU. The MCU is communicatively coupled to an external CPU via a channel. The method includes: the MCU checks and executes a first check mechanism according to the application data in the application section and the application in the data section to generate a first check result; when the first check result is correct, the MCU enters the application program mode; when the first check result is incorrect, the MCU enters the boot loader mode; and When the MCU is in the boot loader mode, execute the mentioned method of updating the firmware of the MCU.
10:網路連接 10: Internet connection
11:更新韌體提供端 11: Update the firmware provider
13:經更新韌體接收端 13: Updated firmware receiver
21:經更新韌體提供端 21: Updated firmware provider
23:經更新韌體裝置 23: Updated firmware device
25:使用者終端 25: User terminal
27:電腦可讀媒體 27: Computer-readable media
110:經更新韌體 110:Updated firmware
130:匯流排 130: Busbar
131:通信模組 131: Communication module
132:中央處理單元 132: Central Processing Unit
133:記憶體模組 133: Memory module
135:MCU 135:MCU
139:主機板 139: Motherboard
210:經更新韌體 210: Updated firmware
230:匯流排 230: Busbar
231:介面 231: Interface
232:CPU 232:CPU
233:記憶體模組 233: Memory Module
235:MCU 235:MCU
239:主機板 239: Motherboard
310:經更新韌體檔案 310: Updated firmware file
330:系統管理匯流排或積體電路間匯流排 330: System management bus or inter-circuit bus
332:CPU 332:CPU
333:記憶體模組 333: Memory Module
334:模組板 334: Module Board
335:MCU 335:MCU
336:串列存在偵測單元 336: Serial presence detection unit
337:介面 337: Interface
339:主機板 339: Motherboard
411:資料塊 411: Data block
412:檢查和 412: Checksum
435:MCU 435:MCU
435M:記憶體單元 435M: memory unit
435P:處理單元 435P: Processing unit
901:連接器 901: Connector
903:MCU 903:MCU
4350:應用程式區段 4350: Application section
4350a:應用程式資料 4350a: Application Data
4352:資料區段 4352: Data section
4352a:應用程式資料之資訊 4352a: Information on application data
4352b:應用程式檢查和 4352b: Application Checksum
4354:開機載入程式區段 4354: Bootloader section
PG:電腦程式碼 PG: computer code
PG1:第一檢查機制 PG1: First Check Mechanism
PG2:第二檢查機制 PG2: Second Inspection Mechanism
S501:操作 S501: Operation
S502:操作 S502: Operation
S503:操作 S503: Operation
S504:操作 S504: Operation
S505:操作 S505: Operation
S701:操作 S701: Operation
S702:操作 S702: Operation
S703:操作 S703: Operation
S704:操作 S704: Operation
S705:操作 S705: Operation
S706:操作 S706: Operation
S707:操作 S707: Operation
S708:操作 S708: Operation
S709:操作 S709: Operation
S801:操作 S801: Operation
S802:操作 S802: Operation
S803:操作 S803: Operation
S804:操作 S804: Operation
S805:操作 S805: Operation
S806:操作 S806: Operation
S807:操作 S807: Operation
S808:操作 S808: Operation
S809:操作 S809: Operation
S810:操作 S810: Operation
S811:操作 S811: Operation
U1:揮發性記憶體組件 U1: Volatile Memory Components
U2:揮發性記憶體組件 U2: Volatile Memory Components
U3:揮發性記憶體組件 U3: Volatile Memory Components
U4:揮發性記憶體組件 U4: Volatile Memory Components
U5:揮發性記憶體組件 U5: Volatile Memory Components
U6:揮發性記憶體組件 U6: Volatile Memory Components
U7:揮發性記憶體組件 U7: Volatile Memory Components
U8:揮發性記憶體組件 U8: Volatile Memory Components
結合附圖閱讀以下詳細描述會最佳地理解本發明之態樣。應注意,各種特徵可能未按比例繪製。事實上,可出於論述清楚起見,而任意地增大或減小各種特徵之尺寸。 Aspects of the invention are best understood when the following detailed description is read in conjunction with the accompanying drawings. It should be noted that various features may not be drawn to scale. In fact, the dimensions of the various features may be arbitrarily increased or decreased for clarity of discussion.
圖1為根據本發明之一些實施例的包括經更新韌體提供端及經更新韌體接收器的韌體更新環境之方塊圖。 1 is a block diagram of a firmware update environment including an updated firmware provider and an updated firmware receiver, according to some embodiments of the present invention.
圖2為根據本發明之一些實施例的包括經更新韌體提供端、使用者終端及電腦可讀媒體的韌體更新環境之方塊圖。 2 is a block diagram of a firmware update environment including an updated firmware provider, a user terminal, and a computer-readable medium, according to some embodiments of the present invention.
圖3為說明根據本發明之一些實施例的記憶體模組與主機板之間的連接的連接圖。 3 is a connection diagram illustrating the connection between a memory module and a motherboard according to some embodiments of the present invention.
圖4A及圖4B為展示根據本發明之一些實施例的微控制器單元中之若干功能區塊的方塊圖。 4A and 4B are block diagrams showing several functional blocks in a microcontroller unit according to some embodiments of the invention.
圖5為展示根據本發明之一些實施例的用於韌體初始化及更新的方法的流程圖。 5 is a flowchart showing a method for firmware initialization and update according to some embodiments of the present invention.
圖6為根據本發明之一些實施例的處理經更新韌體檔案的示意圖。 6 is a schematic diagram of processing an updated firmware file according to some embodiments of the present invention.
圖7為展示根據本發明之一些實施例的用於韌體初始化及更新的方法的流程圖。 7 is a flowchart showing a method for firmware initialization and update according to some embodiments of the present invention.
圖8為展示根據本發明之一些實施例的用於韌體初始化及更新的方法的流程圖。 8 is a flowchart showing a method for firmware initialization and update according to some embodiments of the present invention.
圖9為根據本發明之一些比較實施例的記憶體模組。 9 is a memory module according to some comparative embodiments of the present invention.
以下揭示內容提供用於實施所提供之主題之不同特徵的許多不同實施例或實例。下文描述組件及配置之特定實例以簡化本發明。當然,此等組件及配置僅為實例且不意欲為限制性的。在本發明中,在以下描述中提及第一特徵形成於第二特徵上方或上可包括第一特徵與第二特徵直接接觸地形成的實施例,且亦可包括額外特徵可在第一特徵與第二特徵之間形成,使得第一特徵與第二特徵可能不直接接觸的實施例。另外,本發明可在各種實例中重複附圖標號及/或字母。此重複係出於簡化及清楚之目的,且本身並不指示所論述之各種實施例及/或組態之間的關係。 The following disclosure provides many different embodiments or examples for implementing different features of the provided subject matter. Specific examples of components and configurations are described below to simplify the present disclosure. Of course, these components and configurations are examples only and are not intended to be limiting. In the present invention, reference in the following description to the formation of the first feature over or on the second feature may include embodiments in which the first feature is formed in direct contact with the second feature, and may also include additional features that may be formed on the first feature and the second feature so that the first feature may not be in direct contact with the second feature. Additionally, the present disclosure may repeat reference numerals and/or letters in various instances. This repetition is for the purpose of simplicity and clarity, and does not in itself indicate a relationship between the various embodiments and/or configurations discussed.
在下文更詳細地論述本發明之實施例。然而,應瞭解,本發明提供可在廣泛多種特定情境中體現之許多適用的概念。所論述特定實施例僅為說明性的且並不限制本發明之範疇。 Embodiments of the invention are discussed in greater detail below. It should be appreciated, however, that the present disclosure provides many applicable concepts that can be embodied in a wide variety of specific contexts. The specific embodiments discussed are illustrative only and do not limit the scope of the invention.
此外,為了易於描述,諸如「在......之下」、「在......下方」、「在......上方」、「上部」、「下部」、「左側」、「右側」及其類似術語之空間相對術語可在本文中用於描述一個元件或特徵與另一(或多個)元件或特徵之如圖式中所說明的關係。除圖式中所描繪之定向以外,空間相對術語意欲涵蓋裝置在使用或操作中之不同定向。設備可以其他方式定向(旋轉90度或處於其他定向),且本文中所使用之空間相對描述詞可同樣相應地進行解譯。應理解,當元件被稱為「連接至」或「耦接至」另一元件時,該元件可直接連接至或耦接至另一元件,或可存在介入元件。 Also, for ease of description, such as "under", "below", "above", "upper", "lower", " The spatially relative terms "left", "right", and similar terms, may be used herein to describe the relationship of one element or feature to another element or feature as illustrated in the figures. In addition to the orientation depicted in the figures, spatially relative terms are intended to encompass different orientations of the device in use or operation. The device may be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein interpreted accordingly. It will be understood that when an element is referred to as being "connected" or "coupled to" another element, it can be directly connected or coupled to the other element or intervening elements may be present.
闡述本發明之廣泛範疇的數值範圍及參數為近似值,且可儘可能精確地報告特定實例中闡述之數值。然而,一些數值可含有由各別測試量測值中發現之標準差必然引起的某些誤差。此外,如本文中所使 用,術語「約」通常意謂在給定值或範圍之±10%、±5%、±1%或±0.5%內。替代地,一般熟習此項技術者認為,術語「約」意謂在平均值之可接受標準誤差內。除在操作/工作實例中以外,或除非以其他方式明確指定,否則數值範圍、量、值及百分比(諸如,本文中所揭示之材料數量、持續時間、溫度、操作條件、量之比率及其類似者之彼等者)中之所有應理解為在所有情況下由術語「約」修飾。因此,除非有相反指示,否則本發明及所附申請專利範圍中所闡述之數值參數為可變化之近似值。至少,應根據所報導之有效數位之數字且藉由應用一般捨位技術理解各數值參數。範圍可在本文中表現為自一個端點至另一端點或在兩個端點之間。除非另外指定,否則本文中所揭示之所有範圍包括端點。術語「大體上共面」可指沿著同一平面處於數微米(μm)內(諸如,沿著同一平面處於10μm內、5μm內、1μm內或0.5μm內)之兩個表面。在稱數值或特性「大體上」相同時,該術語可指該等值處於該等值之平均值的±10%、±5%、±1%或±0.5%內。 The numerical ranges and parameters setting forth the broad scope of the invention are approximations, and the numerical values set forth in the specific examples are reported as precisely as possible. Some numerical values, however, may contain certain errors necessarily resulting from the standard deviation found in their respective testing measurements. In addition, as used herein In use, the term "about" generally means within ±10%, ±5%, ±1%, or ±0.5% of a given value or range. Alternatively, as is generally understood by those skilled in the art, the term "about" means within an acceptable standard error of the mean. Except in operating/working examples, or unless expressly specified otherwise, numerical ranges, amounts, values, and percentages (such as amounts of materials, durations, temperatures, operating conditions, ratios of amounts, and the like disclosed herein) All of the like) should be understood to be modified in all instances by the term "about". Accordingly, unless indicated to the contrary, the numerical parameters set forth in this disclosure and the appended claims are approximations that may vary. At a minimum, each numerical parameter should be understood in light of the number of reported significant digits and by applying ordinary rounding techniques. A range can be expressed herein as from one endpoint to the other or between the two endpoints. All ranges disclosed herein are inclusive of the endpoints unless otherwise specified. The term "substantially coplanar" can refer to two surfaces that lie within a few micrometers (μm) along the same plane, such as within 10 μm, 5 μm, 1 μm, or 0.5 μm along the same plane. When values or properties are said to be "substantially" the same, the term can mean that the values are within ±10%, ±5%, ±1%, or ±0.5% of the mean of the values.
一些組件可整合至動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)模組中以提供額外功能(例如,視覺效果、音訊效果、功率管理等)。微控制器單元(Microcontroller Unit,MCU)亦併入至DRAM模組中以控制此等組件。 Some components can be integrated into Dynamic Random Access Memory (DRAM) modules to provide additional functions (eg, visual effects, audio effects, power management, etc.). A Microcontroller Unit (MCU) is also incorporated into the DRAM module to control these components.
參看圖1,其為根據本發明之一些實施例的包括經更新韌體提供端11及經更新韌體接收端13的韌體更新環境之方塊圖。經更新韌體接收端13包括通信模組131、中央處理單元(Central Processing Unit,CPU)132及包括MCU 135之記憶體模組133。通信模組131、CPU 133及記憶體模組133安置於主機板139上,且由匯流排130電性耦接。在此韌體
更新環境中,在經更新韌體提供端11與經更新韌體接收端13之間建立網路連接10以用於傳輸相關資料。將在下文中進一步描述該等元件之間的交互作用。
Referring to FIG. 1 , which is a block diagram of a firmware update environment including an updated
在一些實施例中,當經更新韌體110經開發且分配就緒時,經更新韌體提供端11可將經更新韌體110經由網路連接10傳輸至經更新韌體接收端13。另一方面,經更新韌體接收端13之通信模組131接收經更新韌體110。接著,在經更新韌體接收端13接收經更新韌體110之後,經更新韌體接收端13之CPU 132可預處理更新韌體110,且將更新韌體110轉送至記憶體模組133之MCU 135。因此,MCU 135可藉由經更新韌體110更新MCU 135之韌體。
In some embodiments, when the updated
應特別瞭解,在一些實施例中,通信模組可為網路資料傳輸器及網路資料接收器之組合,或用於傳輸網路資料及接收網路資料之電路之組合。然而,此類描述不意欲限制本發明之硬體實現實施例。 It should be particularly understood that, in some embodiments, the communication module may be a combination of a network data transmitter and a network data receiver, or a combination of circuits for transmitting network data and receiving network data. However, such descriptions are not intended to limit hardware-implemented embodiments of the present invention.
參看圖2,其為根據本發明之一些實施例的包括經更新韌體提供端21、經更新韌體裝置23、使用者終端25及電腦可讀媒體27的韌體更新環境之方塊圖。經更新韌體裝置23包括介面231、CPU 232及包括MCU 235之記憶體模組233。介面231、CPU 233及記憶體模組233安置於主機板239上,且由匯流排230電性耦接。將在下文中進一步描述該等元件之間的交互作用。
2, which is a block diagram of a firmware update environment including an updated
在一些實施例中,當經更新韌體210經開發且分配就緒時,經更新韌體210可首先記錄於電腦可讀媒體27中。隨後,經更新韌體提供端21將具有經更新韌體210之電腦可讀媒體27提供至使用者終端25。在使用者終端25獲得具有經更新韌體210之電腦可讀媒體27之後,經更新
韌體裝置23之介面231可用於自電腦可讀媒體27擷取經更新韌體210。接著,在經更新韌體裝置23擷取經更新韌體210之後,經更新韌體裝置23之CPU 232可預處理更新韌體210,並將更新韌體210轉送至記憶體模組233之MCU 235。因此,MCU 235可藉由經更新韌體210更新MCU 235之韌體。
In some embodiments, the updated
應特別瞭解,在一些實施例中,電腦可讀媒體可實施為非暫時性電子產品,例如唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體、軟碟、硬碟、光碟(Compact Disc,CD)、數位光學光碟(Digital Versatile Disc,DVD)、藍光光碟(Blueray Disc,BD)或任何其他具有相同功能之儲存媒體。介面可為I/O埠或用於接收電腦可讀媒體之資料讀取設備。然而,此類描述不意欲限制本發明之硬體實現實施例。 It should be particularly understood that, in some embodiments, the computer-readable medium may be implemented as a non-transitory electronic product, such as read-only memory (ROM), flash memory, floppy disk, hard disk, optical disk ( Compact Disc, CD), Digital Versatile Disc (DVD), Blu-ray Disc (Blueray Disc, BD) or any other storage media with the same function. The interface can be an I/O port or a data reading device for receiving computer-readable media. However, such descriptions are not intended to limit hardware-implemented embodiments of the present invention.
參看圖3,其為說明根據本發明之一些實施例的主機板339上之記憶體模組333與CPU 332之間的連接之連接圖。記憶體模組333包括具有介面337之模組板334、安置於模組板334上之MCU 335及安置於模組板334上之複數個揮發性記憶體組件U1至U8。記憶體模組333經由介面337附接至主機板339,且MCU 335經由介面337與主機板339上之CPU 332交換資料。將在下文中進一步描述該等元件之間的交互作用。
3, which is a connection diagram illustrating the connection between the
在一些實施例中,當MCU 335進入開機載入程式模式時,MCU 335可進入更新過程。因此,MCU 335自CPU 332接收經更新韌體檔案310之複數個資料塊及複數個檢查和。複數個資料塊中之每一者與複數個檢查和之指定檢查和配對。接著,MCU 335檢查每一資料塊是否對應於指定檢查和。當每一資料塊對應於指定檢查和時,資料塊經驗證且作為資料塊之集合的經更新韌體檔案310因此經驗證。因此,MCU 335可藉
由經更新韌體檔案310更新並進入應用程式模式。另一方面,當有一個資料塊未對應於指定檢查和時,資料塊之傳輸可能不完整或資料塊在傳輸期間偶然更改或損壞。因此,MCU 335可保持在開機載入程式模式中且重新檢查每一資料塊是否對應於指定的資料塊。
In some embodiments, when the
在一些實施例中,MCU 335可經由介面337及系統管理匯流排(System Management Bus,SMBus)或積體電路間(Inter-Integrated Circuit,IIC)匯流排330與主機板339上之CPU 332通信。在一些實施例中,記憶體模組333包括串列存在偵測(Serial Presence Detect,SPD)單元336,且SMBus或IIC匯流排330可用於SPD單元336與CPU 332通信。在一些實施例中,MCU 335共用通信通道,例如SPD單元336與CPU 332之間的SMBus或IIC匯流排330。由於SMBus或CII匯流排330將多個裝置或模組連接至主機板339,因此前述多個裝置或模組可經由SMBus或CII匯流排330同時發送或接收資料。然而,SMBus或CII匯流排330一次僅可允許一個裝置或模組將資料發送或接收至主機板339/自主機板339發送或接收資料,因此,故障或不完整資料傳輸可必然在SMBus或CII匯流排330與主機板339上之CPU 332之間發生。為了減少此傳輸困難,尤其在使用SMBus或CII匯流排330作為通信通道時,資料傳輸之精確性可藉由一次傳輸一對資料塊及指定檢查和來提高,如將於本發明之圖5至圖8中所論述。
In some embodiments, the
應特別瞭解,在一些實施例中,揮發性記憶體組件U1至U8可包括DRAM之記憶體單元。介面337可為與周邊組件互連(Peripheral Component Interconnect,PCI)或周邊組件高速互連(Peripheral Component Interconnect Express,PCI-E、PCIe)相容之介面。然而,此
類描述不意欲限制本發明之硬體實現實施例。
It should be particularly appreciated that, in some embodiments, the volatile memory elements U1-U8 may comprise memory cells of DRAM. The
參看圖4A,其為展示根據本發明之一些實施例的MCU 435中的功能區塊之方塊圖。MCU 435包括處理單元435P及記憶體單元435M。記憶體單元435M可包括開機載入程式區段4354。開機載入程式區段4354儲存電腦程式碼PG。將在下文中進一步描述該等元件之間的交互作用。
4A, which is a block diagram showing functional blocks in
在一些實施例中,當電腦程式碼PG由處理單元435P執行時,使得MCU 435根據複數個資料塊411及與該等資料塊相關聯的複數個檢查和412執行第一檢查機制PG1,以在韌體更新期間產生複數個第一檢查結果。換言之,當MCU 435處於開機載入程式模式下時,MCU 435根據資料塊411及檢查和412執行第一檢查機制PG1以產生第一檢查結果,且檢查第一檢查結果對於更新韌體而言是否全部正確。
In some embodiments, the computer code PG, when executed by the
參看圖4B,其為展示根據本發明之一些實施例的MCU 435中的詳細功能區塊之方塊圖。記憶體單元435P可進一步包括應用程式區段4350及資料區段4352。應用程式區段4350儲存應用程式資料4350a。資料區段4352儲存應用程式資料4350a之資訊4352a及應用程式檢查和4352b。將在下文中進一步描述該等元件之間的交互作用。
4B, which is a block diagram showing detailed functional blocks in
在一些實施例中,應用程式資料4350a可包括MCU 435之應用程式韌體。應用程式資料4350a之資訊4352a可包括應用程式韌體之版本、應用程式韌體之大小及應用程式韌體之記憶體位址。應用程式檢查和4352b可為基於應用程式資料4350a而產生的檢查和資料。
In some embodiments, the application data 4350a may include the application firmware of the
應注意,在一些實施例中,應用程式檢查和4352b之產生可藉由將應用程式資料4350a輸入檢查和函數來實施。詳言之,檢查和函
數可與散列函數、指紋、隨機化函數或密碼散列函數有關。因此,在將應用程式資料4350a輸入檢查和函數中時,對應於應用程式資料4350a之應用程式檢查和4352b導出為檢查和函數之輸出。因此,歸因於應用程式資料4350a與應用程式檢查和4352b之間的相關性,應用程式檢查和4352b可用於驗證應用程式資料4350a是否尚未偶然更改或損壞。
It should be noted that, in some embodiments, the generation of
開機載入程式區段4354儲存用於MCU 435之電腦程式碼PG以在不同階段執行不同檢查機制。在一些實施例中,當MCU 435經激活時MCU 435處於初始化階段,且電腦程式碼PG由處理單元435P執行以用於根據應用程式資料4350a及應用程式檢查和4352執行第二檢查機制PG2,以產生第二檢查結果。特定言之,由於應用程式檢查和4352b為應用程式資料4350a之檢查和資料,因此處理單元435可檢查應用程式檢查和4352b是否對應於應用程式資料4350a,並產生第二檢查結果。
The
在一些實施例中,當第二檢查結果正確時,亦即,當應用程式檢查和4352b對應於應用程式資料4350a時,處理單元435P控制MCU 435進入應用程式模式。因此,對應於應用程式資料4350a之應用程式檢查和4352b可指示應用程式資料4350a可能尚未偶然更改或損壞。因此,MCU 435可進入應用程式模式。在一些實施例中,當第二檢查結果不正確時,亦即,當應用程式檢查和4352b未對應於應用程式資料4350a時,處理單元435P控制MCU 435進入開機載入程式模式。因此,未能對應於應用程式資料4350a之應用程式檢查和4352b可指示應用程式資料4350a可能已偶然更改或損壞。因此,MCU 435可進入開機載入程式模式以更新應用程式資料4350a。
In some embodiments, when the second check result is correct, that is, when the
在一些實施例中,當正經更新時,MCU 435處於更新階
段,且電腦程式碼PG由處理單元435P執行以根據資料塊411及指定給該等資料塊411之檢查和412執行第一檢查機制PG1,以產生第一檢查結果。特定言之,當MCU 435處於更新階段時,處理單元435P首先接收資料塊411及檢查和412。由於一個檢查和412指定給一個資料塊411,因此處理單元435P可檢查檢查和412是否分別對應於資料塊411,並產生第一檢查結果。
In some embodiments, the
在一些實施例中,當資料塊411及檢查和412之第一檢查結果正確時,亦即,當檢查和412分別對應於資料塊411時,處理單元435P控制MCU 435自開機載入程式模式進入應用程式模式。因此,對應於資料塊411之檢查和412可指示,用於更新MCU 435之資料塊411之傳輸已完成且所接收之資料塊411經驗證。因此,MCU 435可經更新且接著進入應用程式模式。
In some embodiments, when the first check result of the data block 411 and the
在一些實施例中,當第一檢查結果中之一者不正確時,亦即,當資料塊411之一個資料塊411a未對應於檢查和412中指定給資料塊411a的一個檢查和412a時,處理單元435P控制MCU 435保持在開機載入程式模式。因此,未能對應於指定檢查和412a之一個資料塊411a可指示,用於更新MCU 435之資料塊411a的傳輸中之一者不完整或資料塊411a可在傳輸期間偶然更改或損壞。因此,MCU 435可保持在開機載入程式模式。此外,MCU 435可重新擷取資料塊411a及檢查和412a以用於重新產生對應檢查結果,且基於前述操作再次檢查對應檢查結果之正確性。
In some embodiments, when one of the first check results is incorrect, that is, when a
本發明之一些實施例包括一種用於韌體初始化及更新之方法,且其流程圖展示於圖5中。一些實施例之方法用於MCU(例如,前述 實施例之MCU)中,且MCU經由通道(例如,前述實施例之SMBus或IIC匯流排)與外部CPU(例如,前述實施例之主機板之CPU)通信。方法之詳細操作如下。 Some embodiments of the present invention include a method for firmware initialization and update, and a flowchart of which is shown in FIG. 5 . The methods of some embodiments are used in MCUs (eg, the aforementioned The MCU of the embodiment), and the MCU communicates with an external CPU (eg, the CPU of the motherboard of the foregoing embodiment) through a channel (eg, the SMBus or the IIC bus of the foregoing embodiment). The detailed operation of the method is as follows.
MCU執行操作S501以根據儲存於MCU之應用程式區段中之應用程式資料及儲存於MCU之資料區段中之應用程式檢查和執行檢查機制以產生檢查結果。在此實施例中,應用程式檢查和應對應於應用程式資料。MCU執行操作S502以檢查該檢查結果是否正確。換言之,在操作S502中,MCU檢查應用程式檢查和是否對應於應用程式資料。 The MCU performs operation S501 to check and execute a check mechanism according to the application data stored in the application section of the MCU and the application program stored in the data section of the MCU to generate a check result. In this embodiment, the application checksum should correspond to the application data. The MCU performs operation S502 to check whether the check result is correct. In other words, in operation S502, the MCU checks whether the application checksum corresponds to the application data.
在一些實施例中,當檢查結果正確時(亦即,當該對應用程式檢查和及應用程式資料對應時),MCU執行操作S503以進入應用程式模式。在一些實施例中,當檢查結果不正確時(亦即,當該對應用程式檢查和及應用程式資料不對應時),MCU執行操作S504以進入開機載入程式模式。MCU執行操作S505以基於前述實施例執行韌體更新。 In some embodiments, when the check result is correct (ie, when the pair of application checksums correspond to application data), the MCU performs operation S503 to enter the application mode. In some embodiments, when the check result is incorrect (ie, when the pair of application checksums and application data do not correspond), the MCU performs operation S504 to enter the boot loader mode. The MCU performs operation S505 to perform firmware update based on the foregoing embodiment.
本發明之一些實施例包括一種用於韌體初始化及更新之方法,且其流程圖展示於圖7中。一些實施例之方法用於MCU(例如,前述實施例之MCU)中,且MCU經由通道(例如,前述實施例之SMBus及IIC匯流排)與外部CPU(例如,前述實施例之主機板之CPU)通信。方法之詳細操作如下。 Some embodiments of the present invention include a method for firmware initialization and update, and a flowchart of which is shown in FIG. 7 . The methods of some embodiments are used in an MCU (eg, the MCU of the aforementioned embodiments), and the MCU communicates with an external CPU (eg, the CPU of the motherboard of the aforementioned embodiments) via channels (eg, the SMBus and IIC bus of the aforementioned embodiments) ) communication. The detailed operation of the method is as follows.
在藉由經更新韌體檔案更新MCU之前,更新韌體檔案可由外部CPU處理以導出資料塊及檢查和對,如圖6中所示。隨後,MCU執行操作S701以進入開機載入程式模式。MCU執行操作S702以經由通道接收經更新韌體檔案之一對資料塊i及檢查和i。在一些實施例中,經更新韌體檔案包括N個數目之資料塊及與N個數目之資料塊相關聯的N個數目之檢 查和,且檢查和i指定給資料塊i,其中i等於1至N。MCU執行操作S703以對該對資料塊i及檢查和i執行檢查機制,以產生檢查結果i。MCU執行操作S704以判定檢查結果i是否正確。換言之,在操作S704中,MCU檢查檢查和i是否對應於資料塊i。 Before updating the MCU with the updated firmware file, the updated firmware file can be processed by the external CPU to derive data blocks and checksum pairs, as shown in FIG. 6 . Subsequently, the MCU performs operation S701 to enter the boot loader mode. The MCU performs operation S702 to receive a pair of data block i and a checksum i of one of the updated firmware files through the channel. In some embodiments, the updated firmware file includes N number of data blocks and N number of checks associated with the N number of data blocks Checksum, and checksum i is assigned to block i, where i equals 1 to N. The MCU performs operation S703 to perform a check mechanism on the pair of data blocks i and checksum i to generate a check result i. The MCU performs operation S704 to determine whether the check result i is correct. In other words, in operation S704, the MCU checks whether the checksum i corresponds to the data block i.
在一些實施例中,當檢查結果i正確時(亦即,當該對資料塊i及檢查和i對應時),MCU執行操作S705以判定資料塊i是否為最末資料塊。若資料塊i不為最末資料塊,則MCU執行操作S706以將值1添加至i,且對MCU執行操作S702以接收下一對資料塊及指定檢查和並執行後續操作。若資料塊i經判定為最末資料塊,則MCU執行操作S707以藉由經更新韌體檔案更新MCU之韌體,該經更新韌體檔案可為該等對資料塊及指定檢查和之集合。MCU執行操作S708以在MCU之韌體更新之後進入應用程式模式。 In some embodiments, when the check result i is correct (ie, when the pair of data block i and the check sum i correspond), the MCU performs operation S705 to determine whether the data block i is the last data block. If the data block i is not the last data block, the MCU performs operation S706 to add a value of 1 to i, and performs operation S702 on the MCU to receive the next pair of data blocks and the specified checksum and perform subsequent operations. If the data block i is determined to be the last data block, the MCU performs operation S707 to update the firmware of the MCU with the updated firmware file, which may be a set of the paired data blocks and the specified checksum . The MCU performs operation S708 to enter the application mode after the firmware of the MCU is updated.
在一些實施例中,當檢查結果i在操作S704中經判定為不正確時(亦即,當該對資料塊i及檢查和i不對應時),直接對MCU執行操作S702以再次接收該對資料塊i及檢查和i並執行後續操作。 In some embodiments, when the check result i is determined to be incorrect in operation S704 (that is, when the pair of data block i and checksum i do not correspond), operation S702 is directly performed on the MCU to receive the pair again Block i and check sum i and perform subsequent operations.
在一些實施例中,可指示MCU在更新韌體之前進入開機載入程式模式。詳言之,當外部CPU經由主機板之通信模組自經更新韌體提供端擷取經更新韌體檔案時,外部CPU可指示MCU進入開機載入程式模式並準備更新韌體。 In some embodiments, the MCU may be instructed to enter boot loader mode before updating the firmware. Specifically, when the external CPU retrieves the updated firmware file from the updated firmware provider via the communication module of the motherboard, the external CPU can instruct the MCU to enter the boot loader mode and prepare to update the firmware.
在一些實施例中,當檢查結果i在操作S704中經判定為不正確時,視情況MCU執行操作S709(由虛線表示)以通知外部CPU重新發送經更新韌體檔案之資料塊i及檢查和i。 In some embodiments, when the check result i is determined to be incorrect in operation S704, the MCU optionally performs operation S709 (represented by a dotted line) to notify the external CPU to resend the data block i of the updated firmware file and the checksum i.
本發明之一些實施例包括一種用於韌體初始化及更新之方 法,且其流程圖展示於圖8中。一些實施例之方法用於MCU(例如,前述實施例之MCU)中,且MCU經由通道(例如,前述實施例之SMBus及IIC匯流排)與外部CPU(例如,前述實施例之主機板之CPU)通信。方法之詳細操作如下。 Some embodiments of the present invention include a method for firmware initialization and update method, and its flowchart is shown in FIG. 8 . The methods of some embodiments are used in an MCU (eg, the MCU of the aforementioned embodiments), and the MCU communicates with an external CPU (eg, the CPU of the motherboard of the aforementioned embodiments) via channels (eg, the SMBus and IIC bus of the aforementioned embodiments) ) communication. The detailed operation of the method is as follows.
類似地,在藉由經更新韌體檔案更新MCU之前,更新韌體檔案可由外部CPU處理以導出資料塊及檢查和對,如圖8中所示。隨後,MCU執行操作S801以進入開機載入程式模式。MCU執行操作S802以經由通道接收經更新韌體檔案之一對資料塊i及檢查和i。在一些實施例中,經更新韌體檔案包括N個數目之資料塊及與N個數目之資料塊相關聯的N個數目之檢查和,且檢查和i指定給資料塊i,其中i等於1至N。MCU執行操作S803以對該對資料塊i及檢查和i執行檢查機制,以產生檢查結果i。MCU執行操作S804以判定檢查結果i是否正確。換言之,在操作S804中,MCU檢查檢查和i是否對應於資料塊i。 Similarly, before updating the MCU with the updated firmware file, the updated firmware file can be processed by the external CPU to derive data blocks and checksum pairs, as shown in FIG. 8 . Subsequently, the MCU performs operation S801 to enter the boot loader mode. The MCU performs operation S802 to receive a pair of data block i and a checksum i of one of the updated firmware files through the channel. In some embodiments, the updated firmware file includes N number of data blocks and N number of checksums associated with the N number of data blocks, and the checksum i is assigned to data block i, where i equals 1 to N. The MCU performs operation S803 to perform a check mechanism on the pair of data blocks i and checksum i to generate a check result i. The MCU performs operation S804 to determine whether the check result i is correct. In other words, in operation S804, the MCU checks whether the checksum i corresponds to the data block i.
在一些實施例中,當檢查結果i正確時(亦即,當該對資料塊i及檢查和i對應時),MCU執行操作S805以判定資料塊i是否為最末資料塊。若資料塊i不為最末資料塊,則MCU執行操作S806以將值1添加至i,且對MCU執行操作S802以接收下一對資料塊及指定檢查和並執行後續操作。 In some embodiments, when the check result i is correct (ie, when the pair of data block i and the check sum i correspond), the MCU performs operation S805 to determine whether the data block i is the last data block. If the data block i is not the last data block, the MCU performs operation S806 to add a value of 1 to i, and performs operation S802 for the MCU to receive the next pair of data blocks and the specified checksum and perform subsequent operations.
在一些實施例中,若資料塊i為最末資料塊,MCU執行操作S807以對經更新韌體檔案執行總檢查機制,以產生總檢查結果。MCU執行S808以判定總檢查結果是否正確。換言之,在操作S808中,MCU檢查總檢查和是否對應於經更新韌體檔案。 In some embodiments, if the data block i is the last data block, the MCU performs operation S807 to perform a general check mechanism on the updated firmware file to generate a general check result. The MCU executes S808 to determine whether the total check result is correct. In other words, in operation S808, the MCU checks whether the total checksum corresponds to the updated firmware file.
在一些實施例中,當總檢查結果正確時(亦即,當該對經更 新韌體檔案及總檢查和對應時),MCU執行操作S809以藉由經更新韌體檔案更新MCU之韌體,該經更新韌體檔案為該等對資料塊及指定檢查和之集合。MCU執行操作S810以在MCU之韌體更新之後進入應用程式模式。 In some embodiments, when the total check result is correct (that is, when the pair is updated When the new firmware file and the total checksum are corresponding), the MCU executes operation S809 to update the firmware of the MCU by the updated firmware file, which is a set of the paired data blocks and the specified checksum. The MCU performs operation S810 to enter the application mode after the firmware of the MCU is updated.
在一些實施例中,當總檢查結果不正確時(亦即,當經更新韌體檔案及總檢查和不對應時),MCU執行操作S811以將i值重設為1,且對MCU執行操作S802以接收第一對資料塊及指定檢查和並執行後續操作。 In some embodiments, when the total check result is incorrect (that is, when the updated firmware file and the total checksum do not correspond), the MCU performs operation S811 to reset the i value to 1, and performs operations on the MCU S802 to receive the first pair of data blocks and the specified checksum and perform subsequent operations.
在一些實施例中,當檢查結果i在操作S804中經判定為不正確時(亦即,當該對資料塊i及檢查和i不對應時),直接對MCU執行操作S802以再次接收該對資料塊i及指定檢查和i並執行後續操作。 In some embodiments, when the check result i is determined to be incorrect in operation S804 (that is, when the pair of data block i and checksum i do not correspond), operation S802 is directly performed on the MCU to receive the pair again Block i and specify checksum i and perform subsequent operations.
參看圖9,其為展示記憶體模組之比較實施例。記憶體模組包括MCU 903、插座、跳線器或用於外部連接之連接器901,以及一些記憶體U1、U2、U3、U4、U5、U6、U7及U8。
Referring to FIG. 9, a comparative example of a memory module is shown. The memory modules include
大體而言,若記憶體模組歸因於MCU 903中發現之任何物理或硬體損害而出故障,則將舊MCU替換為另一MCU(例如,圖9中未展示之新的或良好MCU)可為解決此問題的解決方案中之一者。
In general, if a memory module fails due to any physical or hardware damage found in
即使記憶體模組歸因於軟體或韌體問題而出故障,具有經更新或相對較新版本之軟體或韌體的另一MCU亦可用於替換MCU 903。然而,插座、跳線器或連接器901可為解決前述問題提供一種選項。舉例而言,連接器901可接收信號或命令以更新實施於MCU 903中之軟體或韌體。在更新之前,記憶體模組駐存之電子裝置(例如,個人電腦、膝上型電腦、行動電話或其類似者)必須關閉或斷電以取出或拔出記憶體模組。隨後,記憶體模組必須發送至服務提供端以現場更新。關閉電子裝置及運
送記憶體模組可對使用者造成不便。此外,記憶體模組(例如,連接器901與MCU 903之間的電連接之電路佈局)上佔據相對較大空間或面積的連接器901可能會不利地影響記憶體模組之小型化。
Another MCU with an updated or relatively new version of software or firmware can be used to replace
10:網路連接 10: Internet connection
11:更新韌體提供端 11: Update the firmware provider
110:經更新韌體 110:Updated firmware
130:匯流排 130: Busbar
131:通信模組 131: Communication module
132:中央處理單元 132: Central Processing Unit
133:記憶體模組 133: Memory module
135:MCU 135:MCU
139:主機板 139: Motherboard
Claims (16)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW108111648A TWI768198B (en) | 2019-04-02 | 2019-04-02 | Microcontroller, memory module, and method for updating firmware of the microcontroller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW108111648A TWI768198B (en) | 2019-04-02 | 2019-04-02 | Microcontroller, memory module, and method for updating firmware of the microcontroller |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202038091A TW202038091A (en) | 2020-10-16 |
TWI768198B true TWI768198B (en) | 2022-06-21 |
Family
ID=74091292
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW108111648A TWI768198B (en) | 2019-04-02 | 2019-04-02 | Microcontroller, memory module, and method for updating firmware of the microcontroller |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI768198B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050138267A1 (en) * | 2003-12-23 | 2005-06-23 | Bains Kuljit S. | Integral memory buffer and serial presence detect capability for fully-buffered memory modules |
TWI251170B (en) * | 2001-10-12 | 2006-03-11 | Phoenix Tech Ltd | Apparatus and method for updating firmware |
US20080086652A1 (en) * | 2006-10-10 | 2008-04-10 | Ken Krieger | Updating a power supply microcontroller |
US20120117365A1 (en) * | 2010-11-08 | 2012-05-10 | Delta Electronics (Thailand) Public Co., Ltd. | Firmware update method and system for micro-controller unit in power supply unit |
-
2019
- 2019-04-02 TW TW108111648A patent/TWI768198B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI251170B (en) * | 2001-10-12 | 2006-03-11 | Phoenix Tech Ltd | Apparatus and method for updating firmware |
US20050138267A1 (en) * | 2003-12-23 | 2005-06-23 | Bains Kuljit S. | Integral memory buffer and serial presence detect capability for fully-buffered memory modules |
US20080086652A1 (en) * | 2006-10-10 | 2008-04-10 | Ken Krieger | Updating a power supply microcontroller |
TW200838084A (en) * | 2006-10-10 | 2008-09-16 | Exaflop Llc | Updating a power supply microcontroller |
US20120117365A1 (en) * | 2010-11-08 | 2012-05-10 | Delta Electronics (Thailand) Public Co., Ltd. | Firmware update method and system for micro-controller unit in power supply unit |
Also Published As
Publication number | Publication date |
---|---|
TW202038091A (en) | 2020-10-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6244042B2 (en) | Method, apparatus, and computer program product for transitioning to USB Type-C accessory device docking mode | |
US8943302B2 (en) | Method of flashing bios using service processor and computer system using the same | |
KR20130043662A (en) | Detection of cable connections for electronic devices | |
US20100035461A1 (en) | System and Method for Detecting Module Presence in an Information Handling System | |
TWI608357B (en) | Sharing bus port by multiple bus hosts and a sharing method | |
US20170286097A1 (en) | Method to prevent operating system digital product key activation failures | |
DE102017121465A1 (en) | DATA PROTOCOL FOR MANAGING PERIPHERAL DEVICES | |
TW201621657A (en) | Electronic device | |
US10860512B2 (en) | Processor interconnect link training system | |
US8438374B2 (en) | Computer system and control method of the same | |
JP2019175424A (en) | Method and system for checking error of cable | |
TW202002684A (en) | Network system and authenticating method | |
CN113656339A (en) | NVME hot plug processing method, BMC, device, equipment and medium | |
TWI768198B (en) | Microcontroller, memory module, and method for updating firmware of the microcontroller | |
US7597592B2 (en) | Automatic configuration of an interface to a host or client | |
US20210011806A1 (en) | Memory device failure recovery system | |
US11036665B2 (en) | Electronic system capable of detecting number of hot plug insertion and extraction cycles | |
CN116539992A (en) | Storage device in-place stable state detection device, method, logic module and medium | |
KR20230161375A (en) | Systems and methods for expandable memory error handling | |
US20080019357A1 (en) | Apparatus and Method for Determining Device Presence and Type | |
CN111766797A (en) | Microcontroller, memory module and method for updating firmware of microcontroller | |
US9940289B2 (en) | Preventing access to misplugged devices by a service processor | |
TWI735869B (en) | Storage control device and control method thereof | |
US10489334B2 (en) | Server system and method for detecting transmission mode of server system | |
US20170270021A1 (en) | Repair of failed firmware through an unmodified dual-role communication port |