An architecture definition and online upgrade method for optical module firmware

CN117251191BActive Publication Date: 2026-09-01ATOP CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311232681.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2026-09-01
Estimated Expiration
2043-09-22

AI Technical Summary

Technical Problem

[0006]方案二,自己设计Bootloader,Bootloader一般和Application分离,需要单独烧写下载,程序有Application1和Application2,通过KEY1和KEY2决定运行哪个程序,此方法,Bootloader程序实现相对复杂,后期维护相对难度更大

Benefits of technology

[0017] The present invention has at least the following beneficial effects: The present invention is a simple method for realizing online firmware upgrade of optical modules, which does not require an MCU with dual-bank function, can simplify the firmware programming difficulty, and facilitates later maintenance work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117251191B_ABST
    Figure CN117251191B_ABST
Patent Text Reader

Abstract

This invention discloses an architecture definition for optical module firmware and an online upgrade method, including an upgrade storage area and a current running area set in Flash, and a Congg area set between the upgrade storage area and the current running area; wherein, the upgrade storage area and the current running area each include a corresponding Bootloader and Application. This invention is a simple method for implementing online firmware upgrades for optical modules, which does not require an MCU with dual-bank functionality, simplifies firmware programming, and facilitates later maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of online firmware upgrades for optical modules. More specifically, this invention relates to an architecture definition for optical module firmware and an online upgrade method. Background Technology

[0002] An optical module for photoelectric conversion consists of optoelectronic devices (including transceiver parts), a driver circuit, and a core control unit. Its function is to convert electrical signals into optical signals at the transmitting end in a communication network, transmit them through optical fiber, and then convert the optical signals back into electrical signals at the receiving end, thereby achieving the goals of reducing costs and increasing communication speed.

[0003] Currently, almost all optical modules are designed with a microprocessor. In practical applications, the presence of the MCU necessitates firmware updates.

[0004] Currently, the following two methods are mainly used to update the firmware of MCUs:

[0005] Option 1 requires the MCU to have dual-bank functionality, enabling upgrades and switching through bank switching.

[0006] Option 2 involves designing your own Bootloader. The Bootloader is usually separate from the Application and needs to be burned and downloaded separately. The program has Application1 and Application2, and KEY1 and KEY2 determine which program to run. With this method, the Bootloader program is relatively complex to implement and more difficult to maintain later.

[0007] Specifically, taking a traditional partition-based online firmware rollback upgrade method for optical modules with patent number CN112230967A as an example, its firmware design architecture uses one bootloader (occupying only one Flash address), two apps (i.e., app1 and app2), and two keys. During application, the bootloader is compiled separately (optional), meaning either app1 or app2 is compiled separately. Furthermore, the upgrade method involves downloading app1 first, then app2, and then alternating between downloading app1 and app2. Additionally, during runtime, the size of key1 and key2 is compared to determine whether to run app1 or app2 (one of two options). Both app1 and app2 will verify (trial run) the firmware and indicate whether to run app1 or app2 later by changing the values ​​of key1 and key2. This scheme has relatively complex program implementation and is more difficult to maintain later. Summary of the Invention

[0008] One object of the present invention is to solve at least the above-mentioned problems and / or defects, and to provide at least the advantages described below.

[0009] To achieve these objectives and other advantages of the present invention, a method for defining the architecture of optical module firmware is provided, including an upgrade storage area and a current running area set in Flash, and a Congg area set between the upgrade storage area and the current running area;

[0010] The upgrade storage area and the current running area both include the corresponding Bootloader and Application.

[0011] An online firmware upgrade method for an optical module includes:

[0012] S1. Read the firmware information of Application1 in the current running area to determine whether it supports upgrade. If it does, download the upgrade information to it.

[0013] S2. After the upgrade information is downloaded, the information in Bootloader2 in the upgrade storage area is compiled, and after compilation, Application2 and Bootloader2 in the upgrade storage area are merged to obtain the corresponding executable file;

[0014] S3. Verify the information in Application2, and after successful verification, set the CopyFlag flag in the Congg area;

[0015] S4. Reset and / or run the current running area Bootloader1, check the CopyFlag flag, and copy Application2 to Application1 after the check passes, and clear the CopyFlag flag.

[0016] S5. Jump to the Application1 area of ​​the current firmware to run the new firmware.

[0017] The present invention has at least the following beneficial effects: The present invention is a simple method for realizing online firmware upgrade of optical modules, which does not require an MCU with dual-bank function, can simplify the firmware programming difficulty, and facilitates later maintenance work.

[0018] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the design architecture of the optical module firmware of the present invention;

[0020] Figure 2 This is a schematic diagram of the firmware upgrade process for the optical module of the present invention;

[0021] Figure 3 This is a schematic diagram of the workflow of the Bootloader of this invention. Detailed Implementation

[0022] The present invention will now be described in further detail with reference to the accompanying drawings, so that those skilled in the art can implement it based on the description.

[0023] A method for defining the architecture of optical module firmware, such as Figure 1 As shown, it includes the upgrade save area and the current running area set in Flash, as well as the Congg area set between the upgrade save area and the current running area;

[0024] The upgrade storage area and the current running area both include corresponding Bootloaders and Applications. Compared with existing technologies, the design architecture of this solution uses two identical bootloaders, two apps, and one flag, which makes it both simple in design and reliable in operation.

[0025] An online firmware upgrade method for optical modules is disclosed, primarily implementing the online firmware upgrade function defined by CMIS 5.0 (CMIS 4.0) (Common Management Interface Specification, or CMIS for short, a general management interface specification). Specifically, the 400GSR8 optical module based on CMIS 5.0 has completed design verification and can implement the online firmware upgrade function. Its implementation process is shown in Table 1 and appendix. Figure 2 :

[0026] Table 1

[0027]

[0028]

[0029] In this solution, the bootloader (required) is written and compiled first. Then, the software automatically merges bootloader1 + app1 into one executable file, and bootloader2 + app2 into another executable file. bootloader1 and bootloader2 contain the same content but occupy different Flash addresses.

[0030] First download bootloader1+app1, then download bootloader2+app2; finally, continue downloading the firmware to be upgraded to the bootloader2+app2 area;

[0031] In actual program execution, this solution will always run only the firmware of app1, while app2 will only be used as a temporary firmware storage area.

[0032] In actual testing, this solution only uses app1 to verify the firmware. After verification, a flag is set. After resetting, bootloader1 checks the flag and only copies app2 to app1. In subsequent runs, only app1 will run, and app2 will never run.

[0033] The Bootloader's operation flow in this invention is as follows: Figure 3 As shown, the system primarily determines whether to perform a copy action by checking the CopyFlag. If so, the CopyFlag is checked after copying, and the user is redirected to App1. If copying is not required, the user is redirected directly to App1.

[0034] The main code in the Bootloader is briefly described below:

[0035] 1) int main(void): The entry point of the program.

[0036] 2)DRV_INT_GlobalDisableInterrupt(): Disables global interrupts.

[0037] 3)DRV_WATCHDOG_Disable(): Disables the watchdog timer.

[0038] 4)DRV_CPU_Init(): Initializes the CPU clock.

[0039] 5) if(Get_Copy_Flag()==CDB_FW_COPY_FLAG_VAL): This is a conditional statement that checks whether the value returned by the Get_Copy_Flag function is equal to the defined value (CDB_FW_COPY_FLAG_VAL).

[0040] 6) CopyFirmware(): If the condition is true, copy the firmware from the app2 area to the app1 area.

[0041] 7) Clear_Copy_Flag(): Clears the flag after copying.

[0042] 8) Jump2App(): Jumps to the application.

[0043] During code copying, data from the APP2 address space is copied to the APP1 address space by pressing the MCU's Block button.

[0044] The above solution is merely an illustration of a preferred example and is not limited thereto. When implementing this invention, appropriate substitutions and / or modifications can be made according to user needs.

[0045] The number of devices and processing scale described herein are for the purpose of simplifying the description of the invention. Applications, modifications, and variations of the invention will be readily apparent to those skilled in the art.

[0046] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. It can be applied to various fields suitable for the present invention. Other modifications can be readily made by those skilled in the art. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and examples shown and described herein.

Claims

1. An online firmware upgrade method for an optical module, characterized in that, The architecture definition of the optical module firmware includes: an upgrade storage area and a current running area set in Flash, and a Config area set between the upgrade storage area and the current running area; The current running area includes the corresponding Bootloader1 and Application1; The upgrade storage area includes the corresponding Bootloader2 and Application2; The online upgrade method for the optical module firmware includes: S1. Read the firmware information of Application1 in the current running area to determine whether it supports upgrade. If it does, download the upgrade information. S2. After the upgrade information is downloaded, the information in Bootloader2 in the upgrade storage area is compiled, and after compilation, Application2 and Bootloader2 in the upgrade storage area are merged to obtain the corresponding executable file; S3. Verify the information in Application2, and after successful verification, set the CopyFlag flag in the Config area; S4. Reset and / or run the current running area Bootloader1 directly, check the CopyFlag flag, and copy Application2 to Application1 after the check is passed, and clear the CopyFlag flag; S5. Jump to the Application1 area of ​​the current firmware to run the new firmware.

Citation Information

Patent Citations

  • Optical module firmware rollback online upgrading method based on traditional partition

    CN112230967A

  • Multistage boot load method of embedded equipment

    CN102902556A

  • Bootloader based XFP optical module upgrading method

    CN104461638A