DSP28335 application software upgrading and backup repairing method

By adopting dual sector dual backup and data repair methods in the DSP28335 embedded system, the resource waste and potential risks caused by application software data failure and sector damage are solved, and the application software self-detection and self-repair are realized, improving the efficiency and security of the system.

CN119883335APending Publication Date: 2025-04-25SUZHOU CHANGFENG AVIATION ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411801988.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the existing DSP28335 embedded system, when the application software data fails or sectors are damaged, manual repair is required, resulting in waste of resources and potential serious consequences.

Method used

The application software storage method and sector data repair method are adopted for dual sector dual backup. By adding data verification function to the IAP sector, self-detection and self-repair of application software data is realized, and the dual-subsidiary driving method is used to ensure that both sectors can be driven by program.

Benefits of technology

It realizes self-detection and self-repair of application software data, avoids the hassle of manual repair, ensures that the program automatically switches to the alternate sector to execute when the sector is damaged, and improves the efficiency and security of application software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883335A_ABST
    Figure CN119883335A_ABST
Patent Text Reader

Abstract

The invention provides a DSP28335 application software upgrading and backup repairing method, which belongs to the technical field of embedded systems, and specifically comprises the following steps: partitioning a chip into an IAP sector, an APP1 sector and an APP2 sector, executing application software in the IAP sector, and respectively storing application software data in the APP1 sector and the APP2 sector; writing to-be-upgraded application software data into the APP1 sector to complete APP1 upgrading, and copying the data in the APP1 sector to the APP2 sector to complete data backup; when APP1 upgrading fails, if upgrading is carried out for the first time, application software data to be upgraded are directly written into an APP2 sector, and APP2 upgrading is completed; if the upgrade is not for the first time, repairing the data of the APP1 sector through the APP2 sector; and when the upgrading operation is completed, entering a standby state. According to the scheme, software self-repairing and self-detection are achieved, and the efficiency and safety of application software execution are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of embedded systems, and in particular to a DSP28335 application software upgrade and backup and repair method. Background Art

[0002] DSP28335 is a 32-bit CPU and FPU processing chip, which contains 256K*16-bit FLASH resources (FLASHA~FLASHH) on the chip. The chip has the advantages of high precision, low power consumption, and large data and program storage capacity. It is widely used in motor control, distribution feeder protection, power quality detection and other fields. At present, the target programs of embedded product application software developed based on DSP28335 are mostly stored in the on-chip FLASH through official program burning software. After the burning is completed, the correctness of the program cannot be verified in time. When the burned program data fails, the program will not be executed and needs to be re-burned manually. If the data storage is abnormal due to sector damage, it is necessary to manually replace the program data storage sector for re-burning, which is a waste of manpower and material resources. At the same time, the program abnormality caused by data failure after the product is powered on may lead to many unpredictable serious consequences. Summary of the invention

[0003] In view of this, the embodiment of the present application provides a DSP28335 application software upgrade and backup repair method, which realizes self-detection and self-repair of application software data through a dual-sector dual-backup application software storage method and a sector data repair method. At the same time, through a dual-redundancy drive method, both sectors can be program-driven, solving the problems of data failure requiring manual repair and product failure caused by sector damage, and improving the efficiency and safety of application software execution.

[0004] The present application embodiment provides a DSP28335 application software upgrade and backup repair method, the method comprising:

[0005] The storage area of ​​the DSP28335 chip is divided into an IAP sector, an APP1 sector and an APP2 sector. The application software is executed in the IAP sector, and the application software data is stored in the APP1 sector and the APP2 sector respectively.

[0006] Writing the application software data to be upgraded into the APP1 sector to complete the APP1 upgrade;

[0007] After APP1 is successfully upgraded, the data in the APP1 sector is copied to the APP2 sector to complete the data backup;

[0008] When APP1 fails to be upgraded, if it is the first upgrade, the application software data to be upgraded is directly written into the APP2 sector to complete the upgrade of APP2; if it is not the first upgrade, the data of the APP1 sector is repaired through the APP2 sector;

[0009] When the upgrade operation is completed, the application software is not executed and the system enters the standby state.

[0010] According to a specific implementation of the embodiment of the present application, the method further includes:

[0011] When the application software does not perform an upgrade operation and starts normally, the program data in the dual sectors is verified after power-on;

[0012] If the APP1 sector verification passes, directly jump to the APP1 sector entry to execute the application;

[0013] If the APP1 sector fails the verification and the APP2 sector passes the verification, the program data of the APP2 sector is copied to the APP1 sector to repair the program, and then the program is jumped to the APP2 sector entry to execute the application program;

[0014] If both the APP1 sector and the APP2 sector fail to pass the verification, the application software will not be executed and the system will enter the standby state.

[0015] According to a specific implementation of the embodiment of the present application, the checking of program data in the dual sectors after power-on includes:

[0016] Adding a data verification function in the execution program of the IAP sector to store the application software checksum after the upgrade in the checksum storage area;

[0017] Calculate whether the data checksum of the APP1 sector and the APP2 sector is consistent with the checksum of the checksum storage area. If they are consistent, it is considered that the sector has passed the check; if they are inconsistent, it is considered that the sector has failed the check.

[0018] According to a specific implementation method of an embodiment of the present application, the IAP sector is located in the FLASHA area of ​​the DSP28335 chip, the checksum storage area is located in the FLASHB area of ​​the DSP28335 chip, the APP1 sector is located in the FLASHC, FLASHD and FLASHE areas of the DSP28335 chip, and the APP2 sector is located in the FLASHF, FLASHG and FLASHH areas of the DSP28335 chip.

[0019] According to a specific implementation of the embodiment of the present application, the step of writing the application software data to be upgraded into the APP1 sector to complete the APP1 upgrade includes:

[0020] The APP1 sector corresponding to APP1 is erased, and the target code data of the application software to be upgraded in the receiving buffer is written into the sector, thereby completing the upgrade of APP1.

[0021] Beneficial effects:

[0022] The DSP28335 application software upgrade and backup repair method in the embodiment of the present application realizes self-detection and self-repair of application software data through a dual-sector dual-backup application software storage method and a sector data repair method. It can ensure that when the application data is wrong, the program can be repaired by itself without manual repair; when the hardware of the APP1 sector storing the application is damaged, it can ensure that the program continues to execute the program in the APP2 sector to avoid serious consequences caused by accidental failure of the program; when the data of both sectors is damaged, it enters the standby state to ensure that the chip state is controllable, thereby improving the efficiency and safety of application software execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A working principle diagram of a DSP28335 application software upgrade and backup and repair method according to an embodiment of the present invention;

[0025] Figure 2 The figure is a flow chart of a method for upgrading and backing up the DSP28335 application software according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0027] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.

[0028] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present application, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0029] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The illustrations only show the components related to the present application rather than being drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0030] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0031] The present application embodiment provides a DSP28335 application software upgrade and backup repair method, as shown below Figure 1 and Figure 2 Describe in detail.

[0032] In one embodiment, a DSP28335 application software upgrade and backup repair method is provided, the method comprising:

[0033] The storage area of ​​the DSP28335 chip is divided into an IAP sector, an APP1 sector and an APP2 sector. The application software is executed in the IAP sector, and the application software data is stored in the APP1 sector and the APP2 sector respectively.

[0034] Writing the application software data to be upgraded into the APP1 sector to complete the APP1 upgrade;

[0035] After APP1 is successfully upgraded, the data in the APP1 sector is copied to the APP2 sector to complete the data backup;

[0036] When APP1 fails to be upgraded, if it is the first upgrade, the application software data to be upgraded is directly written into the APP2 sector to complete the upgrade of APP2; if it is not the first upgrade, the data of the APP1 sector is repaired through the APP2 sector;

[0037] When the upgrade operation is completed, the application software is not executed and the system enters the standby state.

[0038] Furthermore, the method further comprises:

[0039] When the application software does not perform an upgrade operation and starts normally, the program data in the dual sectors is verified after power-on;

[0040] If the APP1 sector verification passes, directly jump to the APP1 sector entry to execute the application;

[0041] If the APP1 sector fails the verification and the APP2 sector passes the verification, the program data of the APP2 sector is copied to the APP1 sector to repair the program, and then the program is jumped to the APP2 sector entry to execute the application program;

[0042] If both the APP1 sector and the APP2 sector fail to pass the verification, the application software will not be executed and the system will enter the standby state.

[0043] Furthermore, the checking of the program data in the dual sectors after power-on includes:

[0044] Adding a data verification function in the execution program of the IAP sector to store the application software checksum after the upgrade in the checksum storage area;

[0045] Calculate whether the data checksum of the APP1 sector and the APP2 sector is consistent with the checksum of the checksum storage area. If they are consistent, it is considered that the sector has passed the check; if they are inconsistent, it is considered that the sector has failed the check.

[0046] In one embodiment, the IAP sector is located in the FLASHA area of ​​the DSP28335 chip, the checksum storage area is located in the FLASHB area of ​​the DSP28335 chip, the APP1 sector is located in the FLASHC, FLASHD and FLASHE areas of the DSP28335 chip, and the APP2 sector is located in the FLASHF, FLASHG and FLASHH areas of the DSP28335 chip.

[0047] In one embodiment, the step of writing the application software data to be upgraded into the APP1 sector to complete the APP1 upgrade includes:

[0048] The APP1 sector corresponding to APP1 is erased, and the target code data of the application software to be upgraded in the receiving buffer is written into the sector, thereby completing the upgrade of APP1.

[0049] The DSP28335 application software upgrade and backup repair method of the present application can automatically perform program repair work when the program data fails, avoiding the trouble of manual repair, and when the sector where the application software is stored is damaged, the program automatically jumps to the spare sector for execution, preventing program drive failure caused by sector damage and avoiding possible serious consequences. At the same time, the method is a universal application software upgrade and backup repair framework, which can be applied to application software developed based on DSP28335 and has high versatility.

[0050] Refer to the following Figure 2 The method of this application is described in detail, including the following contents:

[0051] The elements involved in this method that need to be planned in advance, including application software target code, IAP program and application software checksum, partition the DSP28335 chip, one internal FLASH sector for storing IAP program, two internal FLASH sectors for storing application software program, and one internal FLASH sector for storing checksum. The basic flow of elements is shown by the arrows, the application software target code flows from the IAP program to the APP1 sector (sector 1) where APP1 is located, and then from the APP1 sector to the APP2 sector (sector 2) where APP2 is located.

[0052] Combination Figure 2 , the method of using the present application comprises the following steps:

[0053] Step 201: The chip is powered on or reset, and the program starts running;

[0054] Step 202: Determine the startup mode. If it is a normal startup, execute step 211; if it is an upgrade mode, execute step 203;

[0055] Step 203: Erase the FLASH sector 1 corresponding to APP1, write the application software target code data in the receiving buffer into the sector, and complete the upgrade of APP1;

[0056] Step 204: Read the FLASH sector 2 data corresponding to APP2 to determine whether it is the first upgrade. If it is the first upgrade, execute step 205; if it is not the first upgrade, execute step 207;

[0057] Step 205: It is determined that it is the first upgrade and after the upgrade is completed, data verification is performed to determine whether the upgrade is successful. If the upgrade fails, step 206 is executed; if the upgrade is successful, step 209 is executed;

[0058] It should be noted that the checksum of this step is sent externally to the IAP software. In addition, the checksum during the upgrade process is sent externally, and the checksum used during the normal startup process is stored in FLASHB;

[0059] Step 206: erase sector 2, and then write the application software object code data in the receiving buffer into the sector, completing the upgrade of APP2;

[0060] Step 207: It is determined that this is not the first upgrade and after the upgrade is completed, data verification is performed to determine whether the upgrade is successful. If the upgrade fails, step 208 is executed; if the upgrade is successful, step 209 is executed;

[0061] Step 208: Erasing sector 1, and then copying the data in sector 2 to sector 1, thereby completing the repair process of APP2 for APP1 application software data;

[0062] Step 209: Erasing sector 2, and then copying the data in sector 1 to sector 2, thereby backing up APP1 to APP2;

[0063] Step 210: The DSP enters a standby state and waits for restart;

[0064] Step 211: When the system determines that the mode is normal startup, the program in sector 1 is verified;

[0065] Step 212: Determine the verification result. If the verification is correct, execute step 213; if the verification is wrong, execute step 214;

[0066] Step 213: Jump the program to the APP1 entry and execute the APP1 program;

[0067] Step 214: When APP1 verification fails, verify the APP2 program in sector 2;

[0068] Step 215: Determine the verification result. If the verification is correct, execute step 216; if the verification is wrong, execute step 210;

[0069] Step 216: Erasing sector 1, and then copying the data in sector 2 to sector 1, thereby completing the process of APP2 repairing the application software data of APP1;

[0070] Step 217: Jump the program to the APP2 entry and execute the APP2 program;

[0071] The solution proposed in this application can be widely used in embedded systems. Due to the portability and operability of the adopted method, it can be used as a general framework for application software upgrade and backup and repair of DSP28335.

[0072] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A DSP28335 application software upgrade and backup repair method, characterized in that: The method comprises: The storage area of ​​the DSP28335 chip is divided into an IAP sector, an APP1 sector and an APP2 sector. The application software is executed in the IAP sector, and the application software data is stored in the APP1 sector and the APP2 sector respectively. Writing the application software data to be upgraded into the APP1 sector to complete the APP1 upgrade; After APP1 is successfully upgraded, the data in the APP1 sector is copied to the APP2 sector to complete the data backup; When APP1 fails to be upgraded, if it is the first upgrade, the application software data to be upgraded is directly written into the APP2 sector to complete the upgrade of APP2; if it is not the first upgrade, the data of the APP1 sector is repaired through the APP2 sector; When the upgrade operation is completed, the application software is not executed and the system enters the standby state.

2. The DSP28335 application software upgrade and backup repair method according to claim 1, characterized in that: The method further comprises: When the application software does not perform an upgrade operation and starts normally, the program data in the dual sectors is verified after power-on; If the APP1 sector verification passes, directly jump to the APP1 sector entry to execute the application; If the APP1 sector fails the verification and the APP2 sector passes the verification, the program data of the APP2 sector is copied to the APP1 sector to repair the program, and then the program is jumped to the APP2 sector entry to execute the application program; If both the APP1 sector and the APP2 sector fail to pass the verification, the application software will not be executed and the system will enter the standby state.

3. The DSP28335 application software upgrade and backup repair method according to claim 2, characterized in that: The checking of the program data in the dual sectors after power-on includes: Adding a data verification function in the execution program of the IAP sector to store the application software checksum after the upgrade in the checksum storage area; Calculate whether the data checksum of the APP1 sector and the APP2 sector is consistent with the checksum of the checksum storage area. If they are consistent, it is considered that the sector has passed the check; if they are inconsistent, it is considered that the sector has failed the check.

4. The DSP28335 application software upgrade and backup repair method according to claim 3 is characterized in that: The IAP sector is located in the FLASHA area of ​​the DSP28335 chip, the checksum storage area is located in the FLASHB area of ​​the DSP28335 chip, the APP1 sector is located in the FLASHC, FLASHD and FLASHE areas of the DSP28335 chip, and the APP2 sector is located in the FLASHF, FLASHG and FLASHH areas of the DSP28335 chip.

5. The DSP28335 application software upgrade and backup repair method according to claim 1, characterized in that: The step of writing the application software data to be upgraded into the APP1 sector to complete the APP1 upgrade includes: The APP1 sector corresponding to APP1 is erased, and the target code data of the application software to be upgraded in the receiving buffer is written into the sector, thereby completing the upgrade of APP1.