Electronic system, electronic device and electronic device initialization method

By combining different versions of firmware functions in electronic devices and updating function pointers, the memory space constraints caused by firmware version differences is solved, and the compatibility of firmware versions and the continuity of system initialization is achieved.

CN119621155AActive Publication Date: 2025-03-14REALTEK SEMICON CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311170639.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-12
Publication Date
2025-03-14
Estimated Expiration
2043-09-12

AI Technical Summary

Technical Problem

In the prior art, the difference in firmware versions between electronic devices and host devices leads to the need to store multiple complete firmware versions, resulting in limited internal storage memory space.

Method used

By configuring a read-only storage circuit and an errible storage circuit in the electronic device, the first version of the firmware is loaded and stored in the errible storage circuit, the functions of the second version of the firmware provided by the driver storage end are received and merged, replacing the function pointer in the first version of the firmware to generate the updated shared data segment and firmware.

Benefits of technology

The compatibility of the firmware version is achieved, reducing the need for internal storage memory space, and allowing electronic devices to make function calls based on mixed pointers during system initialization, and continue system initialization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621155A_ABST
    Figure CN119621155A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic system, an electronic device with a firmware version compatibility mechanism and an electronic device initialization method. The electronic device comprises a read-only storage circuit for storing a first version of firmware. The processing circuit is configured to: store a first version of firmware from the read-only storage circuit to the erasable storage circuit to start system initialization; judging that the version of the second version firmware contained in the drive program and received from the drive program storage end is earlier than that of the first version firmware; combining a variable function of the first version content in the first version firmware and a variable function of the second version content in the second version firmware, and replacing a first version function pointer in the first version firmware with a second version function pointer in the second version firmware to generate updated firmware with an updated shared data segment; and performing function calling according to the updated shared data section of the updated firmware so as to continue system initialization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to firmware technology, and more particularly to an electronic system and an electronic device having a firmware version compatibility mechanism and an electronic device initialization method. Background Art

[0002] When the peripheral electronic device is connected to the host device, its own firmware is loaded first, and then the host device operates according to the driver program to initialize the peripheral electronic device.

[0003] However, there may be differences in the versions of the hardware of the electronic device and the driver of the host device. In order to make the firmware versions compatible, the electronic device and the host device need to store multiple versions of firmware in advance to achieve the purpose. If there is no more efficient host device, the memory storage space of the electronic device and the host device will be very limited due to the need to store multiple complete firmware versions. Summary of the invention

[0004] In view of the problems of the prior art, one object of the present invention is to provide an electronic device with a firmware version compatibility mechanism, comprising: a read-only storage circuit, an erasable storage circuit and a processing circuit. The read-only storage circuit is configured to store a first version of firmware, the first version of firmware includes at least one variable function corresponding to the first version content and a first shared data segment, the first shared data segment includes a first version function pointer of the variable function. The processing circuit is configured to: store the first version of firmware from the read-only storage circuit to the erasable storage circuit to start system initialization; determine that the second version of firmware received from the driver storage end and included in the driver is earlier than the first version of firmware, wherein the second version of firmware includes a variable function corresponding to the second version content and a second shared data segment, the second shared data segment includes a second version function pointer of the variable function, and the second shared data segment has the same address configuration mode and segment length as the first shared data segment; merge the variable function of the first version content and the variable function of the second version content, and replace the first version function pointer with the second version function pointer to generate an updated firmware with an updated shared data segment; and perform a function call according to the updated shared data segment of the updated firmware to continue system initialization.

[0005] The present invention includes an electronic system, including: a driver storage end and an electronic device. The electronic device includes: a read-only storage circuit, an erasable storage circuit and a processing circuit. The read-only storage circuit is configured to store a first version of firmware, the first version of firmware includes at least one variable function corresponding to the first version content and a first shared data segment, the first shared data segment includes a first version function pointer of the variable function. The processing circuit is configured to: store the first version of firmware from the read-only storage circuit to the erasable storage circuit to start system initialization; determine that the second version of firmware received from the driver storage end and included in the driver is earlier than the first version of firmware, wherein the second version of firmware includes a variable function corresponding to the second version content and a second shared data segment, the second shared data segment includes a second version function pointer of the variable function, and the second shared data segment has the same segment structure as the first shared data segment; merge the variable function of the first version content and the variable function of the second version content, and replace the first version function pointer with the second version function pointer to generate an updated firmware with an updated shared data segment; and perform a function call according to the updated shared data segment of the updated firmware to continue system initialization.

[0006] The present invention further includes an electronic device initialization method, which is applied to an electronic device, including: storing a first version of firmware from a read-only storage circuit to an erasable storage circuit to start system initialization, wherein the first version of firmware includes at least one variable function corresponding to the first version content and a first shared data segment, and the first shared data segment includes a first version function pointer of the variable function; determining that the second version of firmware received from the driver storage end and included in the driver is earlier than the first version of firmware, wherein the second version of firmware includes a variable function corresponding to the second version content and a second shared data segment, and the second shared data segment includes a second version function pointer of the variable function, and the second shared data segment has the same segment structure as the first shared data segment; merging the variable function of the first version content and the variable function of the second version content, and replacing the first version function pointer with the second version function pointer to generate an updated firmware with an updated shared data segment; and performing a function call according to the updated shared data segment of the updated firmware to continue system initialization.

[0007] The features, implementation and efficacy of the present invention are described in detail below with reference to the accompanying drawings as preferred embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 A block diagram showing an electronic system according to an embodiment of the present invention; Figure 2A A schematic diagram showing the structure of a first version of firmware in an embodiment of the present invention; Figure 2BA schematic diagram showing the structure of the second version of firmware in one embodiment of the present invention; Figure 3 In one embodiment of the present invention, according to Figure 2A The first version of the firmware and Figure 2B A schematic diagram of the structure of the updated firmware generated by the second version of the firmware; Figure 4 A schematic diagram showing a first version of firmware in another embodiment of the present invention; Figure 5 In another embodiment of the present invention, according to Figure 4 The first version of the firmware and Figure 2B A schematic diagram of the structure of the updated firmware generated by the second version of the firmware; Figure 6 A simplified schematic diagram showing the updating firmware actually involved in the system initialization in one embodiment of the present invention; Figure 7 A block diagram showing an electronic system in another embodiment of the present invention; and Figure 8 A flowchart of an electronic device initialization method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0009] One of the purposes of the present invention is to provide an electronic system and an electronic device and an electronic device initialization method having a firmware version compatibility mechanism, by loading a first version firmware of a read-only storage circuit to an erasable storage circuit and receiving a second version firmware provided by a driver storage end, after merging the functions of the driver storage end and the second version firmware, and then replacing the pointer of some functions in the second version firmware that have version differences with the pointer of the function in the first version firmware, so that the electronic device can perform function calls according to the mixed pointers to initialize the system, thereby achieving the purpose of firmware version compatibility.

[0010] Please refer to Figure 1 . Figure 1 The block diagram of an electronic system 100 according to an embodiment of the present invention is shown. The electronic system 100 includes a driver storage 110 and an electronic device 150 .

[0011] In this embodiment, the driver storage end 110 is a host device independent of the electronic device 150 , and includes a host processing circuit 115 , a host memory 120 , a host storage circuit 125 , and a communication interface 130 .

[0012] The host memory 120 may be, for example, but not limited to, a dynamic random access memory (RAM). The host storage circuit 125 may be, for example, but not limited to, a hard disk or a flash memory, and is configured to store the driver DP of the electronic device 150. The communication interface 130 may be, for example, but not limited to, a peripheral component interconnect express (PCIe), a secure digital input / output (SDIO), a universal serial bus (USB), or other interfaces. The above components may be connected and communicated via a bus 135 inside the driver storage end 110 under the control of the host processing circuit 115.

[0013] The electronic device 150 is, for example, but not limited to, a network card or other peripheral devices, and includes a read-only storage circuit 155 , an erasable storage circuit 160 , a processing circuit 165 , and a communication interface 170 .

[0014] The read-only storage circuit 155 may be, for example but not limited to, a read-only memory (ROM), configured to store the first version firmware FM1. The rewritable storage circuit 160 may be, for example but not limited to, a dynamic random access memory. The communication interface 170 is an interface that can communicate with the communication interface 130, such as but not limited to a peripheral component express interconnect, a secure digital input output, a universal serial bus, or other interfaces. The above components can be connected and communicated via a bus 175 inside the electronic device 150 under the control of the processing circuit 165.

[0015] When the electronic device 150 and the driver storage end 110 are connected and the system is initialized through the communication interface 130 and the communication interface 170, the electronic device 150 stores the first version firmware FM1 from the read-only storage circuit 155 to the erasable storage circuit 160 by the processing circuit 165 to start the system initialization. At this time, the processing circuit 165 can execute some functions in the first version firmware FM1 to start some functional circuits and buses.

[0016] The driver storage end 110 can retrieve the driver DP from the host storage circuit 125 and store it in the host memory 120 under the control of the host processing circuit 115 , and transmit the second version firmware FM2 included in the driver DP through the communication interface 130 so that the electronic device 150 receives the second version firmware FM2 .

[0017] In one embodiment, the driver DP may actually include multiple different versions of firmware. The electronic device 150 may be configured to perform a handshake procedure with the driver storage 110 so that the driver storage 110 extracts one of the firmware that best matches the electronic device 150 as the second version firmware FM2.

[0018] In one embodiment, when the electronic device 150 is newer hardware and the version of the firmware included in the driver DP is older than that of the electronic device 150 , the processing circuit 165 of the electronic device 150 will determine that the second version firmware FM2 is earlier than the first version firmware FM1 .

[0019] Please refer to Figure 2A as well as Figure 2B . Figure 2A A schematic diagram showing the structure of the first version firmware FM1 according to an embodiment of the present invention. Figure 2B A schematic diagram showing the structure of the second version firmware FM2 according to an embodiment of the present invention is shown.

[0020] In one embodiment, the first version firmware FM1 includes at least one variable function corresponding to the first version content, a first shared data section, and a first global variable section, and the second version firmware FM2 includes a variable function corresponding to the second version content, a second shared data section, and a second global variable section. In addition, the first version firmware FM1 also includes a non-variable function applicable to the second version firmware FM2.

[0021] by Figure 2A For the embodiment of the present invention, the first version firmware FM1 includes functions FA-FD and a first shared data segment DS1.

[0022] The functions FB and FC included in the first version firmware FM1 are variable functions corresponding to the first version content. Figure 2A In the example, the address corresponding to the function FB is 0x2000B000, and the address corresponding to the function FC is 0x2000C000. The functions FA and FD included in the first version firmware FM1 are non-variable functions applicable to the second version firmware FM2. Figure 2A In the example, the address corresponding to function FA is 0x2000A000, and the address corresponding to function FD is 0x2000D000.

[0023] The first shared data segment DS1 includes a first version function pointer of a volatile function and a second pointer of a non-volatile function. Figure 2AIn the example, the first shared data segment DS1 stores pointers PA-PD. Pointers PB and PC are the first version pointers of the variable function, recorded at addresses 0x20020004 and 0x2002000C respectively. The content of pointer PB is the address 0x2000B000 corresponding to function FB, and the content of pointer PC is the address 0x2000C000 corresponding to function FC.

[0024] Pointers PA and PD are the second pointers of non-volatile functions, respectively, and are recorded at addresses 0x20020000 and 0x20020008. The content of pointer PA is the address 0x2000A000 corresponding to function FA, and the content of pointer PD is the address 0x2000D000 corresponding to function FD.

[0025] The first shared data section DS1 also includes a first global variable section GV1. The first global variable section GV1 records the global variables used by each function included in the first version firmware FM1. Figure 2A In the example, the first global variable segment GV1 corresponds to the address 0x200201000.

[0026] by Figure 2B In the embodiment of the present invention, the second version firmware FM2 includes functions FB', FC' and a second shared data segment DS2.

[0027] The functions FB' and FC' included in the second version firmware FM2 are variable functions corresponding to the second version content. Functions FB' and FC' correspond to different addresses than functions FB and FC. Figure 2B In the example, the address corresponding to the function FB' is 0x2001B000, and the address corresponding to the function FC' is 0x2001C000.

[0028] The second shared data segment DS2 has the same segment structure as the first shared data segment DS1. In one embodiment, the segment structure includes an address configuration method and a segment length. The address configuration method further includes a base address and the address of each information included in the segment.

[0029] The second shared data segment DS2 includes a second version function pointer of a volatile function and an invalid pointer of a corresponding non-volatile function. The addresses of the second version function pointer and the invalid pointer correspond to the addresses of the first version function pointer and the second pointer, respectively. Figure 2BIn the example, the second shared data segment DS2 stores pointers PA'-PD'. Pointer PB' is a second version pointer of a variable function, corresponding to the address 0x20020004 and corresponding to the pointer PB included in the first shared data segment DS1, and the content of pointer PB' is the address 0x2001B000 corresponding to the function FB'. Pointer PC' is also a second version pointer of a variable function, corresponding to the address 0x2002000C and corresponding to the pointer PC included in the first shared data segment DS1, and the content of pointer PC' is the address 0x2001C000 corresponding to the function FC'.

[0030] Pointer PA' is an invalid pointer corresponding to a non-volatile function, recorded at address 0x20020000 and corresponding to pointer PA included in the first shared data segment DS1, and the content of pointer PA' is null. Pointer PD' is an invalid pointer corresponding to a non-volatile function, recorded at address 0x20020008 and corresponding to pointer PD included in the first shared data segment DS1, and the content of pointer PD' is null.

[0031] The second shared data section DS2 also includes a second global variable section GV2. The second global variable section GV2 records the global variables used by each function included in the second version firmware FM2. Figure 2B In the example of , the second global variable segment GV2 also corresponds to the address 0x200201000. The first global variable segment GV1 and the second global variable segment GV2 include a common data structure to record the same global variable.

[0032] When the first version firmware FM1 uses new global variables due to having newer functions, the first global variable section GV1 will include a non-common data structure arranged after the common data structure, while the second global variable section GV2 does not include the non-common data structure.

[0033] For example, the first global variable section GV1 and the second global variable section GV2 may include a common data structure composed of variables a, b, c, and d, and the first global variable section GV1 may further include a non-common data structure composed of variable e. In one embodiment, the global variables included in the first global variable section GV1 and the second global variable section GV2 each have a variable attribute for version identification.

[0034] It should be noted that, in practice, the first version firmware FM1 and the second version firmware FM2 can retain the same segment size for the segment for storing functions and the segment for storing global variables respectively, so as to maintain the consistency and scalability of the function segment and the global variable segment.

[0035] The processing circuit 165 merges the variable function of the first version content and the variable function of the second version content, and uses the second version function pointer to replace the first version function pointer contained in the first shared data segment DS1 of the first version firmware FM1 stored in the erasable storage circuit 160, so as to generate the updated firmware FMU with the updated shared data segment. The processing circuit 165 retains the non-volatile function pointer in the updated shared data segment according to the invalid pointer.

[0036] Please refer to Figure 3 . Figure 3 In one embodiment of the present invention, according to Figure 2A The first version of the firmware FM1 and Figure 2B Schematic diagram of the structure of the updated firmware FMU generated by the second version firmware FM2.

[0037] In this embodiment, the update firmware FMU includes functions FA-FD and functions FB'-FC'. After merging, the addresses of functions FA-FD and functions FB'-FC' still correspond to 0x2000A000, 0x2000B000, 0x2000C000, 0x2000D000, 0x2001B000 and 0x2001C000 in sequence.

[0038] Updating the firmware FMU further includes updating the shared data segment DSU, and the updated shared data segment DSU includes pointers PA, PB', PC' and PD.

[0039] Since the pointer PA' of the second shared data segment DS2 is an invalid pointer corresponding to a non-volatile function, the processing circuit 165 reserves the pointer PA corresponding to the address 0x20020000 when updating the shared data segment DSU, and the content is still the address 0x2000A000 corresponding to the function FA. Since the pointer PB' of the second shared data segment DS2 is not invalid, the processing circuit 165 replaces the pointer PB with the pointer PB' corresponding to the address 0x20020004 and the content is the address 0x2001B000 corresponding to the function FB' when updating the shared data segment DSU.

[0040] Since the pointer PC' of the second shared data segment DS2 is not invalid, the processing circuit 165 replaces the pointer PC with the pointer PC' corresponding to the address 0x20020008 and the content of which is the address 0x2001C000 corresponding to the function FC' when updating the shared data segment DSU. Since the pointer PD' of the second shared data segment DS2 is an invalid pointer corresponding to a non-volatile function, the processing circuit 165 retains the pointer PD corresponding to the address 0x2002000C and the content of which is still the address 0x2000D000 corresponding to the function FD when updating the shared data segment DSU.

[0041] The update shared data segment DSU of the update firmware FMU further reserves the first global variable segment GV1 , and still corresponds to the address 0x20020100.

[0042] The processing circuit 165 can perform a function call according to the update shared data segment DSU of the update firmware FMU to continue the system initialization. More specifically, after the update firmware FMU is generated, when the processing circuit 165 needs to execute a variable function during the system initialization process, it can call the second version of the variable function according to the second version function pointer (i.e., call function FB' according to pointer PB' or call function FC' according to pointer PC'), and call the non-volatile function according to the non-volatile function pointer when it needs to execute a non-volatile function (i.e., call function FA according to pointer PA or call function FD according to pointer PD).

[0043] Therefore, when the electronic device 150 is a newer version of hardware and can provide a newer version of firmware, and the driver storage end 110 stores a relatively older version of the driver DP and can only provide an older version of firmware, the electronic device 150 can still allow the newer version of hardware to execute the older version of firmware according to the above method.

[0044] Please refer to Figure 4 . Figure 4 A schematic diagram showing a first version firmware FMV1 according to another embodiment of the present invention.

[0045] Similar to Figure 2A The embodiment shown, Figure 4 The first version firmware FMV1 includes functions FB and FC which are volatile functions, functions FA and FD which are non-volatile functions, and a first shared data segment DS1 including a first global variable segment GV1.

[0046] In this embodiment, the first version firmware FMV1 has a larger change than the second version firmware FM2. Functions FB and FC, which are variable functions, have content that occupies a larger storage space, so that function FC corresponds to address 0x2000C100, and function FD corresponds to address 0x2000D200.

[0047] Furthermore, the first version firmware FMV1 further includes a function FE, and the function FE is a third function that does not exist in the second version firmware FM2. Figure 4 In the example, the address corresponding to function FE is 0x2000E000.

[0048] Furthermore, the first version firmware FMV1 has an additional shared data segment DSA, and the additional shared data segment DSA includes a pointer PE. The pointer PE is a third function pointer of the third function, correspondingly recorded at address 0x20021000. The content of the pointer PE is the address 0x2000E000 corresponding to the function FE.

[0049] Please refer to Figure 5 . Figure 5 In one embodiment of the present invention, according to Figure 4 The first version of the firmware FMV1 and Figure 2B Schematic diagram of the structure of the update firmware FMUV generated by the second version firmware FM2.

[0050] In this embodiment, the update firmware FMUV includes functions FA-FE and functions FB'-FC'. After merging, the addresses of functions FA-FE and functions FB'-FC' still correspond to 0x2000A000, 0x2000B000, 0x2000C100, 0x2000D200, 0x2000E000, 0x2001B000 and 0x2001C000 in sequence.

[0051] The update firmware FMUV further includes an update shared data segment DSU and an additional shared data segment DSA. The update shared data segment DSU includes pointers PA, PB', PC' and PD. Pointer PA corresponds to address 0x20020000 and the content is address 0x2000A000 corresponding to function FA. Pointer PB' corresponds to address 0x20020004 and the content is address 0x2001B000 corresponding to function FB'. Pointer PC' corresponds to address 0x20020008 and the content is address 0x2001C000 corresponding to function FC'. Pointer PD corresponds to address 0x2002000C and the content is address 0x2000D200 corresponding to function FA. The pointer PE included in the additional shared data segment DSA corresponds to address 0x20021000 and the content is address 0x2000E000 corresponding to function FE.

[0052] The update shared data segment DSU of the update firmware FMUV further reserves the first global variable segment GV1 , and still corresponds to the address 0x20020100.

[0053] Therefore, even if the new and old versions of the firmware differ in function content or have newly added functions, the processing circuit 165 can still execute the old version of the firmware on the new version of the hardware.

[0054] Please refer to Figure 6 . Figure 6 A simplified schematic diagram showing the update firmware FMUV that actually participates in system initialization in one embodiment of the present invention.

[0055] The updated firmware FMUV that actually participates in the system initialization includes a new version of the firmware function FROM (including Figure 5 Functions FA, FD, FE) in the driver storage end 110 and the old version firmware function FRAM (including Figure 5 Functions FB'~FC' in it), update the shared data segment DSU and the additional shared data segment DSA.

[0056] When the new version firmware function FROM is executed, it can follow the path LA to the updated shared data segment DSU or the path LB to the additional shared data segment DSA to refer to and call other function pointers. The updated shared data segment DSU determines whether to follow the path LC to the new version firmware function FROM or the path LD to the old version firmware function FRAM to call and execute the function. In contrast, the additional shared data segment DSA can only follow the path LE to the new version firmware function FROM to call and execute the function.

[0057] The above embodiments are all described by the technology of executing the old version of firmware on the new version of hardware. In one embodiment, the electronic device 150 can achieve the purpose of operating the hardware on the old version with the new version of the driver DP through the configuration of the driver DP of the driver storage end 110.

[0058] In more detail, the driver storage end 110 can store multiple versions of firmware from old to new. When the electronic device 150 is an older version of hardware, and the driver storage end 110 stores a relatively newer version of the driver DP and can provide an older version of firmware, the driver storage end 110 can capture the firmware that best matches the electronic device 150 through the aforementioned handshake procedure and transmit it to the electronic device 150 for operation.

[0059] In some technologies, in order to achieve the purpose of compatibility between different versions of driver programs of the electronic device and the driver storage end, the read-only storage circuit of the electronic device needs to store different versions of firmware, and the host memory of the driver storage end also needs to store different versions of firmware. Not only because different versions of firmware may have a large amount of duplicated program code, but also because the storage space is limited, the number of versions that can be supported has an upper limit.

[0060] The electronic device of the present invention can load the first version firmware of the read-only storage circuit to the erasable storage circuit and receive the second version firmware provided by the driver storage end. After merging the functions of the driver storage end and the second version firmware, the pointer of some functions with version differences in the second version firmware is replaced with the pointer of the function in the first version firmware, so that the electronic device can perform function calls according to the mixed pointers to initialize the system, thereby achieving the purpose of firmware version compatibility.

[0061] exist Figure 1 In the embodiment of FIG. 1 , the driver storage end 110 is taken as an example to be a host device independent of the electronic device 150. However, in another embodiment, the driver storage end 110 may be a host device located in the same system single chip as the electronic device 150. More specifically, the electronic system 100 is a system single chip, and the driver storage end 110 and the electronic device 150 are respectively a circuit block of the system single chip.

[0062] Therefore, the communication interface 130 can be the bus master in the system on a chip, and the communication interface 170 can be the bus slave in the system on a chip, and the driver storage end 110 can communicate with the electronic device 150 via, for example but not limited to, the Advanced Microcontroller Bus Architecture (AMBA). The electronic device 150 can achieve compatibility with the firmware version of the driver storage end 110 in the same manner as described above.

[0063] Please refer to Figure 7 . Figure 7 A block diagram of an electronic system 700 is shown in another embodiment of the present invention.

[0064] Similar to Figure 1 , Figure 7 The electronic system 700 also includes a driver storage end 110 and an electronic device 150. However, in this embodiment, the driver storage end 110 is a flash memory also included in the electronic device 150 itself, and directly stores the driver DP. The driver storage end 110 can directly transmit the second version firmware FM2 in the driver DP to the erasable storage circuit 160 of the electronic device 150 through the bus 175 inside the electronic device 150. The electronic device 150 can achieve the purpose of compatibility with the firmware version of the driver storage end 110 in the same manner as described above.

[0065] In such a configuration, the electronic device 150 can still be electrically connected to a host device 710, and the host device 710 can include similar Figure 1The driver storage end 110 can provide the driver DP to the host device through the communication path between the electronic device 150 and the host device 700 to drive the electronic device 150.

[0066] Therefore, the electronic device of the present invention can be applied to electronic systems of different types. Figure 1 as well as Figure 7 The electronic system shown is only an example and the present invention is not limited thereto.

[0067] Please refer to Figure 8 . Figure 8 A flowchart of an electronic device initialization method 800 is shown in one embodiment of the present invention.

[0068] In addition to the aforementioned devices, the present invention further discloses an electronic device initialization method 800, which is applied to, for example, but not limited to Figure 1 The electronic device 150 may be, for example but not limited to, executed by the processing circuit 165 of the electronic device 150 executing a stored application program. One embodiment of the electronic device initialization method 800 is as follows: Figure 8 As shown, the following steps are included.

[0069] In step S810 , the first version firmware FM1 is stored from the read-only storage circuit 155 to the erasable storage circuit 160 to start system initialization.

[0070] In step S820 , it is determined whether the second version firmware FM2 included in the driver program DP and received from the driver program storage 110 is earlier than the first version firmware FM1 .

[0071] In step S830 , the variable functions of the first version content and the variable functions of the second version content are merged, and the second version function pointer replaces the first version function pointer, so as to generate an updated firmware FMU with an updated shared data segment DSU.

[0072] In step S840 , a function call is performed according to the update shared data segment DSU of the update firmware FUM to continue the system initialization.

[0073] It should be noted that the above implementation is only an example. In other embodiments, those skilled in the art may make changes without violating the spirit of the present invention. For example, the number of variable functions, non-variable functions, and third functions in the first version firmware and the second version firmware may vary depending on the needs. In addition, the first version firmware and the second version firmware may also include other data or program codes required for executing system initialization. The present invention does not limit the first version firmware and the second version firmware to include a specific number of functions or structures.

[0074] In summary, the electronic system and the electronic device and the electronic device initialization method with a firmware version compatibility mechanism in the present invention can load the first version firmware of the read-only storage circuit to the erasable storage circuit and receive the second version firmware provided by the driver storage end. After merging the functions of the driver storage end and the second version firmware, the pointers of some functions with version differences in the second version firmware are replaced with the pointers of the functions in the first version firmware, so that the electronic device can perform function calls according to the mixed pointers to perform system initialization, thereby achieving the purpose of firmware version compatibility.

[0075] Although the embodiments of the present case are described above, these embodiments are not intended to limit the present case. A person with ordinary knowledge in the technical field may make changes to the technical features of the present case based on the explicit or implicit content of the present case. All these changes may fall within the scope of patent protection sought in the present case. In other words, the scope of patent protection in the present case shall be based on what is defined in the claims of this specification.

Explanation of symbols

[0076] 100: Electronic Systems 110: Driver storage 115: Host processing circuit 120:Host memory 125: Host storage circuit 130: Communication interface 135: Bus 150: Electronic devices 155: read-only storage circuit 160: Erasable storage circuit 165: Processing circuit 170: Communication interface 175: Bus 700: Electronic Systems 710: Host device 800: Electronic device initialization method S810~S840: Steps DP: Driver DS1: First shared data segment DS2: Second shared data segment DSA: Additional Shared Data Area DSU: Update shared data segment FA~FE、FB'、FC': Function FM1, FMV1: First version firmware FM2: Second version firmware FMU, FMUV: Update firmware FRAM: Legacy firmware functions FROM: New firmware function GV1: First global variable section GV2: Second global variable section LA~LE:Path PA~PE、PA'~PD': pointer

Claims

1. An electronic device having a firmware version compatibility mechanism, characterized in that: Include: A read-only storage circuit is configured to store a first version of firmware, the first version of firmware including at least one variable function corresponding to a first version of content and a first shared data segment, the first shared data segment including a first version function pointer of the variable function; a rewritable storage circuit; and A processing circuit configured to: The first version of the firmware is stored from the read-only storage circuit to the erasable storage circuit to start system initialization; Determine that a second version of firmware received from a driver storage end and included in a driver is earlier than the first version of firmware, wherein the second version of firmware includes the variable function corresponding to a second version of content and a second shared data segment, the second shared data segment includes a second version of function pointer of the variable function, and the second shared data segment has the same segment structure as the first shared data segment; Merging the variable function of the first version content and the variable function of the second version content, and replacing the first version function pointer with the second version function pointer, so as to generate an update firmware with an update shared data section; as well as A function call is made according to the update shared data section of the update firmware to continue system initialization.

2. The electronic device according to claim 1, wherein: The first version firmware also includes at least one non-volatile function applicable to the second version firmware, the first shared data segment includes a non-volatile function pointer for the non-volatile function, the second shared data segment includes an invalid pointer corresponding to the non-volatile function, and the processing circuit is also configured to retain the non-volatile function pointer in the updated shared data segment according to the invalid pointer to generate the updated firmware.

3. The electronic device according to claim 2, wherein: The first version firmware also includes at least one third function that does not exist in the second version firmware, and has an additional shared data segment having a third function pointer including the third function. The processing circuit is also configured to merge the variable function of the first version content, the variable function of the second version content, and the third function, and retain the additional shared data segment in the updated shared data segment to generate the updated firmware.

4. The electronic device according to claim 1, wherein: The segment structure includes an address configuration method and a segment length.

5. The electronic device according to claim 1, wherein: The driver contains multiple firmwares, and the processing circuit is configured to: Performing a handshake procedure with the driver storage end so that the driver storage end retrieves one of the firmwares that best matches the electronic device as the second version firmware; as well as The second version firmware is received from the driver storage end.

6. The electronic device as claimed in claim 1, wherein: The first shared data segment of the first version firmware also includes a first global variable segment, and the second shared data segment of the second version firmware also includes a second global variable segment. The first global variable segment and the second global variable segment each include a common data structure. The first global variable segment also selectively includes a non-common data structure arranged after the common data structure. The updated firmware retains the first global variable segment.

7. The electronic device according to claim 6, wherein: The multiple global variables included in the first global variable section and the second global variable section each have a variable attribute for version identification.

8. The electronic device as claimed in claim 1, wherein: The driver program storage end is a host device independent of the electronic device, a host device located in the same system single chip as the electronic device, or a flash memory further included in the electronic device.

9. An electronic system, characterized in that: Include: a driver storage terminal; and An electronic device comprising: A read-only storage circuit is configured to store a first version of firmware, the first version of firmware including at least one variable function corresponding to a first version of content and a first shared data segment, the first shared data segment including a first version function pointer of the variable function; a rewritable storage circuit; and A processing circuit configured to: The first version of the firmware is stored from the read-only storage circuit to the erasable storage circuit to start system initialization; determining that a second version of firmware received from a driver storage end and included in a driver is earlier than the first version of firmware, wherein the second version of firmware includes the variable function corresponding to a second version content and a second shared data segment, The second shared data segment includes a second version function pointer of the variable function, and the second shared data segment and the first shared data segment have the same segment structure; Merging the variable function of the first version content and the variable function of the second version content, and replacing the first version function pointer with the second version function pointer, to generate an update firmware having an update shared data section; as well as A function call is made according to the update shared data section of the update firmware to continue system initialization.

10. An electronic device initialization method, applied to an electronic device, characterized in that: Include: Storing a first version of firmware from a read-only storage circuit to an erasable storage circuit to start system initialization, wherein the first version of firmware includes at least one variable function corresponding to a first version content and a first shared data segment, and the first shared data segment includes a first version function pointer of the variable function; Determine that a second version of firmware received from a driver storage end and included in a driver is earlier than the first version of firmware, wherein the second version of firmware includes the variable function corresponding to a second version of content and a second shared data segment, the second shared data segment includes a second version of function pointer of the variable function, and the second shared data segment has the same segment structure as the first shared data segment; Merging the variable function of the first version content and the variable function of the second version content, and replacing the first version function pointer with the second version function pointer, so as to generate an update firmware with an update shared data section; as well as A function call is made according to the update shared data section of the update firmware to continue system initialization.

Citation Information

Patent Citations

  • Method for improving software driver compatibility

    CN102841798A

  • TP firmware switching method and device

    CN106897222A

  • Software compatibility method and device and equipment

    CN112445534A

  • Integrated system and firmware update method

    US20150169313A1

  • Methods and apparatus for communicatively coupling internal components within appliances, and appliances with external components and accessories

    US20160218884A1