Online program upgrading system based on domestic PSOC

By designing an online program upgrade system based on domestically produced PSOCs, online upgrades of domestically produced PSOC equipment were realized during normal working hours. This solved the problem of increased costs due to equipment disassembly and upgrades, and improved upgrade efficiency and equipment maintainability.

CN121832999APending Publication Date: 2026-04-10BEIJING RES INST OF TELEMETRY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing domestic PSOC devices require disassembly for program upgrades, increasing manpower, material resources, and time costs, and cannot be upgraded online during normal working hours.

Method used

Design an online program upgrade system based on a domestically produced PSOC. The system enables online program upgrades through the communication module between the host computer and the terminal device. It sets up independent storage areas for the factory program and the upgrade program. After receiving the upgrade command, the terminal device automatically verifies and loads the program. It supports online upgrades of single or multiple partition data.

Benefits of technology

It reduces the time constraints of online upgrades and device startup time, improves upgrade efficiency and device maintainability, and supports program upgrades at any time without disassembling the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121832999A_ABST
    Figure CN121832999A_ABST
Patent Text Reader

Abstract

The invention provides a domestic PSOC-based program online upgrading system. The domestic PSOC-based program online upgrading system comprises an upper computer and terminal equipment, the upper computer comprises an upgrade program generation module and a communication module; the terminal equipment comprises a domestic PSOC platform, a FLASH memory, a DDR buffer and a terminal equipment communication module; the terminal equipment enters an upgrading state according to the upgrading instruction, and the PL program and the PS program running in the domestic PSOC platform are upgraded through the upgrading program. After the terminal equipment completes initialization, online program upgrading can be completed at any time, a special delay waiting module does not need to be arranged in the initialization stage to wait for an upper computer instruction, and the time constraint of online upgrading and the equipment starting time are reduced. The FLASH memory is provided with an independent factory program storage area and an independent upgrading program storage area, and after program upgrading fails, the FLASH memory can still be powered on to run factory programs. According to the method and the device, only single-partition data or multi-partition data needing to be upgraded can be upgraded online, so that the upgrading efficiency and the equipment maintainability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic digital data processing technology, and specifically to an online program upgrade system based on a domestically produced PSOC. Background Technology

[0002] The FMQL series of programmable fusion chips are domestically developed, fully programmable PSOC chips manufactured by Fudan Microelectronics. A single chip integrates a processing system (PS) based on a feature-rich quad-core high-performance processor and programmable logic (PL). Combined with independently developed software, it realizes an integrated hardware and software platform, facilitating user development, shortening development cycles, and saving production costs.

[0003] The quad-core high-performance CPU is the core of the processor system PS. It works in conjunction with the on-chip memory OCM, external cache DDR, rich I / O peripherals, and PL section to form a feature-rich on-chip programmable system PSOC.

[0004] During the research and development and production phases of devices based on the domestic PSOC platform, the PSOC program is typically burned and solidified using an emulator via a JTAG interface. After the device is assembled and delivered to the user, upgrading and maintaining the software in the same way requires disassembling the device, which greatly increases the manpower, material resources, and time costs.

[0005] Therefore, an online program upgrade system based on domestically developed PSOC is needed. Summary of the Invention

[0006] This invention addresses the issue of online upgrades for domestically produced PSOCs by providing an online program upgrade system based on domestically produced PSOCs. This system enables the primary bootloader to automatically distinguish between the factory-installed program and the upgrade program, and to load and run the corresponding program. Terminal devices do not need a dedicated delay module to wait for instructions from the host computer during the initialization phase; online program upgrades can be completed at any time during normal operation, reducing time constraints for online upgrades and device startup time. The FLASH memory has separate storage areas for the factory-installed program and the upgrade program, allowing the factory-installed program to run even after a failed upgrade. This invention can perform online upgrades on only a single partition or multiple partitions of data requiring upgrades, improving upgrade efficiency and device maintainability.

[0007] This invention provides an online program upgrade system based on a domestically produced PSOC, comprising an interconnected host computer and terminal devices; The host computer includes an interconnected upgrade program generation module and a communication module; The terminal equipment includes a domestic PSOC platform and FLASH memory, DDR cache, and terminal equipment communication module connected to the domestic PSOC platform. The domestic PSOC platform includes a PS end and a PL end. The communication module is electrically connected to the communication module of the terminal device; The FLASH memory stores the software running on the domestic PSOC platform, including the factory program storage area, the upgrade program storage area and the loading status storage area. The factory program includes the first-level boot program, the PL factory program and the PS factory program, and the upgrade program includes the PL upgrade program and / or the PS upgrade program. The DDR cache includes a program execution area and an upgrade data cache. During operation, the PS program of the terminal device enters the upgrade state after receiving the upgrade command sent by the communication module, and waits for the host computer to send the upgrade program. The PS program caches the received upgrade program in the upgrade data buffer area. After the upgrade program is received, it is verified. If the verification fails, the verification status is sent to the host computer, and the host computer is waited for the upgrade program to be resent until the verification is correct. If the verification result is correct, the PS program first sets the loading flag to load the factory program, and then writes the upgrade program to the upgrade program storage area. When the writing is correct, the loading flag is set to load the upgrade program. Then the terminal device automatically resets, loads the upgrade program, and starts the upgraded PS program and / or the upgraded PL program.

[0008] The present invention discloses an online program upgrade system based on a domestically produced PSOC. In a preferred embodiment, after the terminal device is powered on / reset, the domestic PSOC platform determines the boot mode by sampling the bootmode hardware pin status, loads the primary boot program from the factory program storage area of ​​the FLASH memory to the on-chip storage area AXI SRAM, and starts the primary boot program execution. The primary boot program addresses a valid factory boot header within the effective addressing range of the FLASH memory and loads the factory image header and partition header sequentially. When the loading identifier is an upgrade program loading identifier, the upgrade partition header and partition data in the upgrade program storage area are verified. If the verification passes, the upgrade partition header is loaded from the upgrade program storage area to overwrite the corresponding factory partition header. After the partition header loading is completed, the partition data is loaded into the designated running space according to the partition header, completing the loading and execution of the upgrade program.

[0009] In the online program upgrade system based on domestic PSOC described in this invention, as a preferred embodiment, the specified running space of partition data is specified by the partition header. The partition header includes the loading address of the partition data, the destination address, the destination space running address, the data length, the partition data type, and the offset address of the next partition header.

[0010] The present invention discloses an online program upgrade system based on a domestically produced PSOC. In a preferred embodiment, the primary boot program loads the PL-side running program and the PS-side running program according to the loading identifier. The loading identifier is stored in the loading status storage area and includes the loading factory program identifier and the loading upgrade program identifier.

[0011] The present invention discloses an online program upgrade system based on a domestically produced PSOC. As a preferred embodiment, the method for generating the upgrade program by the upgrade program generation module includes: generating a binary file boot.bin using the Create Boot Image tool of the Proceed software. The binary file includes a boot header, an image header, a partition header, and partition data; extracting the partition header and partition data of the program to be upgraded from the binary file; changing the data offset address in the partition header to the actual offset address of the upgrade data in the FLASH memory; verifying the partition data and placing it in the reserved area of ​​the partition header; re-verifying the partition header and placing the verification value in the verification area of ​​the partition header; and combining the partition header and partition data of the upgrade data to obtain the upgrade program.

[0012] The present invention discloses an online program upgrade system based on a domestically produced PSOC. As a preferred embodiment, the online program upgrade system can upgrade the PL program and the PS program separately, or upgrade the PL program and the PS program simultaneously.

[0013] The online program upgrade system based on domestic PSOC described in this invention, as a preferred embodiment, when only the PL program is upgraded, the partition data consists of the binary code of the primary boot program, the binary code of the PL upgrade program, and the binary code of the PS factory program or the PS program after the last upgrade. When only the PS program is upgraded, the partition data consists of the binary code of the primary boot program, the binary code of the PS upgrade program, and the binary code of the PL factory program or the PL program after the last upgrade. When the PL program and PS program are upgraded simultaneously, the partition data consists of the binary code of the first-level boot program, the binary code of the PL upgrade program, and the binary code of the PS upgrade program.

[0014] In the online program upgrade system based on domestic PSOC described in this invention, as a preferred embodiment, the communication module and the terminal device communication module can communicate using CAN, serial port, or Ethernet. The domestic PSOC platform is Fudan Microelectronics' PSOC series, and the online program upgrade system is suitable for online upgrades of bare-metal programs; FLASH memory is a non-volatile memory that can be read and written online when power is lost. It can be QSPI FLASH, NOR FLASH, or NAND FLASH, with corresponding effective addressing ranges of 16MB, 32MB, and 128MB, respectively. The DDR cache is a large-capacity synchronous dynamic random access memory with a maximum usable space of 1023MB.

[0015] The online program upgrade system based on a domestically produced PSOC described in this invention, as a preferred embodiment, involves the PS program running in the program execution area of ​​the DDR cache; the PS program cannot perform initialization operations on the DDR cache.

[0016] The present invention discloses an online program upgrade system based on a domestically produced PSOC. As a preferred method, after the online program upgrade is completed, the system switches between the factory program and the upgrade program by sending a program switching command through the host computer to change the status of the loading flag. The status of the loading flag can only be changed through the host computer command and is in a power-off protection state.

[0017] This invention relates to an online program upgrade system based on a domestically produced PSOC, comprising a host computer and a terminal device. The host computer includes an upgrade program generation module and a communication module, while the terminal device includes a domestically produced PSOC platform, a FLASH memory, a DDR cache, and a terminal device communication module. The host computer and the terminal device are electrically connected via the communication module. The host computer sends upgrade commands and upgrade programs to the terminal device through the communication module. The terminal device enters an upgrade state according to the upgrade commands and upgrades the PL and PS programs running on the domestically produced PSOC platform using the upgrade program. After initialization, the terminal device can complete the online program upgrade at any time without needing a dedicated delay waiting module to wait for host computer commands during the initialization phase, reducing the time constraints of online upgrades and device startup time. The FLASH memory has separate storage areas for the factory-installed program and the upgrade program, allowing the factory-installed program to run even after a program upgrade failure. This invention can perform online upgrades on only a single partition or multiple partitions of data requiring upgrades, improving upgrade efficiency and device maintainability.

[0018] The present invention has the following advantages: (1) After the terminal device completes initialization, it can complete the online program upgrade at any time without setting a special delay waiting module to wait for the host computer instruction during the initialization stage, thus reducing the time constraints of online upgrade and device startup time.

[0019] (2) Set up independent factory program storage area and upgrade program storage area. The factory program and upgrade program can be freely switched through the host computer command, which improves the system flexibility.

[0020] (3) The system can perform online upgrades on only the single partition data or multiple partition data that need to be upgraded, thereby improving upgrade efficiency and equipment maintainability. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of an online program upgrade system based on a domestically developed PSOC. Figure 2 This is a factory program space mapping diagram for an online program upgrade system based on a domestically produced PSOC; Figure 3 This is a schematic diagram of the upgrade process of an online program upgrade system based on a domestically developed PSOC.

[0022] Figure label: 1. Host computer; 11. Upgrade program generation module; 12. Communication module; 2. Terminal equipment; 21. Domestic PSOC platform; 22. FLASH memory; 23. DDR cache; 24. Terminal equipment communication module. Detailed Implementation

[0023] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Example 1

[0024] like Figure 1 As shown, an online program upgrade system based on a domestic PSOC includes a host computer 1 and a terminal device 2; the host computer 1 includes an upgrade program generation module 11 and a communication module 12, and the terminal device 2 includes a domestic PSOC platform 21, a FLASH memory 22, a DDR cache 23 and a terminal device communication module 24. In this embodiment, the domestic PSOC platform 21 adopts the Fudan Microelectronics PSOC series chip FMQL45T900, the FLASH memory 22 adopts QSPI FLASH with a maximum usable space of 16MB, and the DDR cache 23 is a large-capacity synchronous dynamic random access memory with a maximum usable space of 1023MB. The host computer 1 and the terminal device 2 are electrically connected through the communication module 12 and the terminal device communication module 24. The communication module 12 uses the CAN bus for communication. The host computer 1 sends upgrade instructions and upgrade programs to the terminal device 2 through the communication module 12. The terminal device 2 enters the upgrade state according to the upgrade instructions and upgrades the PL program and PS program running in the domestic PSOC platform 21 through the upgrade program.

[0025] The DDR cache 23 includes a program execution area (512MB-32MB) and an upgrade data cache area (32MB), which are used to cache the PS running program and the upgrade program, respectively. The FLASH memory 22 is used to store the software running in the domestic PSOC platform 21. It is divided into three areas, including the factory program storage area, the upgrade program storage area, and the loading status storage area, which are used to store the factory program, the upgrade program, and the loading identifier of the domestic PSOC platform 21, respectively.

[0026] like Figure 2 As shown, the factory program includes the first-stage boot loader (FSBL), the PL factory program, and the PS factory program; the upgrade program includes the PL upgrade program and the PS upgrade program; the first-stage boot loader loads the PL and PS running programs according to the loading flag; the PS running program is used to receive the upgrade command and upgrade program sent by the host computer 1 and perform online upgrades on the PL and PS programs; the loading flag has two states: loading the factory program and loading the upgrade program.

[0027] The upgrade program generation module 11 is used to generate the upgrade program, including: using the Create BootImage tool of the process software to combine the primary boot program, PL upgrade program, and PS upgrade program to generate a binary file boot.bin (in this embodiment, it is a combination of the PL upgrade program and the PS upgrade program). The binary file includes a boot header, an image header, a partition header, and partition data, where the partition data are the binary codes of the primary boot program, PL upgrade program, and PS upgrade program, respectively; extracting the partition header and partition data of the program to be upgraded from the binary file, changing the data offset address in the partition header to the actual offset address of the upgrade data in the FLASH memory 22, placing the checksum of the partition data into the reserved area of ​​the partition header, re-verifying the partition header, and placing the checksum into the check area of ​​the partition header; and combining the partition header and partition data of the upgrade data to generate the upgrade program.

[0028] like Figure 3As shown, terminal device 2 enters the upgrade state according to the upgrade command and upgrades the PL program and PS program running in the domestic PSOC platform 21 through the upgrade program. This includes: during the operation of the PS program, it receives the upgrade command sent by the host computer 1 and enters the upgrade state, waiting for the host computer 1 to send the upgrade program. During the upgrade process, the PS program puts the received upgrade program into the upgrade data buffer area of ​​the DDR cache 23 for caching. After the upgrade program is received, it verifies the upgrade program. If the verification fails, it sends the verification status to the host computer 1 and waits for the host computer 1 to resend the upgrade program until the verification is correct. If the verification result is correct, it first sets the loading flag to load the factory program, and then writes the upgrade program into the upgrade program storage area of ​​the FLASH memory 22. If the writing is correct, it sets the loading flag to load the upgrade program. After the above operations are completed, terminal device 2 automatically resets, loads the upgrade program, and starts running.

[0029] The primary bootloader loads the PL and PS end programs based on the loading flags. This includes: after the terminal device 2 is powered on / reset, the domestic PSOC platform 21 determines the boot mode by sampling the bootmode hardware pin status (hardware pin status includes: JTAG boot mode, NOR FLASH boot mode, NAND FLASH boot mode, QSPI boot mode, and SD card boot mode), and loads the primary bootloader from the FLASH memory 22 to the on-chip storage area AXI. The system loads the bootloader into SRAM and initiates the first-level bootloader. Within the 2216MB effective address range of the FLASH memory, the first-level bootloader addresses the valid factory boot header and loads the factory image header and partition header sequentially. If the loading flag indicates that the upgrade program is being loaded, the upgrade partition header and partition data in the upgrade program storage area are verified. If the verification passes, the upgrade partition header is loaded from the upgrade program storage area to overwrite the corresponding factory partition header. After the partition header is loaded, the partition data is loaded into the specified runtime space according to the partition header, thus completing the loading and running of the upgrade program. The specified runtime space is specified by the partition header. As shown in Table 1, the partition header includes the partition data loading address, destination address, destination space runtime address, data length, partition data type, and the offset address of the next partition header.

[0030] Table 1. Partition Header Composition Table

[0031] The PS program runs in the program execution area of ​​DDR cache 23; the PS program cannot perform initialization operations on DDR cache 23.

[0032] After completing the online program upgrade, the status of the loading flag is changed by sending a program switching command through the host computer 1 to switch between the factory program and the upgrade program; the status of the loading flag can only be changed by the host computer 1 command, and its status is protected by power failure.

[0033] This embodiment targets single-module program updates, and online upgrade time can be reduced by up to 66%. Compared with JTAG mode, this invention can reduce the time for large-scale device synchronous upgrades from "days" to "hours".

[0034] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An online program upgrade system based on a domestically developed PSOC, characterized in that: Including an interconnected host computer (1) and terminal equipment (2); The host computer (1) includes an interconnected upgrade program generation module (11) and a communication module (12). The terminal device (2) includes a domestic PSOC platform (21) and a FLASH memory (22), a DDR cache (23), and a terminal device communication module (24) all connected to the domestic PSOC platform (21). The domestic PSOC platform (21) includes a PS end and a PL end. The communication module (12) is electrically connected to the terminal device communication module (24); The FLASH memory (22) stores the software running in the domestic PSOC platform (21), including a factory program storage area, an upgrade program storage area and a loading status storage area. The factory program includes a first-level boot program, a PL factory program and a PS factory program. The upgrade program includes a PL upgrade program and / or a PS upgrade program. The DDR cache (23) includes a program execution area and an upgrade data cache area; After receiving the upgrade instruction sent by the communication module (12) during operation, the PS program of the terminal device (2) enters the upgrade state and waits for the host computer (1) to send the upgrade program; the PS program puts the received upgrade program into the upgrade data cache area for caching; After the upgrade program is received, the upgrade program is verified. If the verification fails, the verification status is sent to the host computer (1), and the host computer (1) is asked to resend the upgrade program until the verification is correct. If the verification result is correct, the PS program first sets the loading flag to load the factory program, and then writes the upgrade program into the upgrade program storage area. When the writing is correct, the loading flag is set to load the upgrade program. Then the terminal device (2) is automatically reset, loads the upgrade program, and starts the upgraded PS program and / or upgraded PL program.

2. The online program upgrade system based on a domestically produced PSOC according to claim 1, characterized in that: After the terminal device (2) is powered on / reset, the domestic PSOC platform (21) determines the boot mode by sampling the bootmode hardware pin status, loads the first-level boot program from the factory program storage area of ​​the FLASH memory (22) to the on-chip storage area AXI SRAM and starts the first-level boot program to run; the first-level boot program addresses the valid factory boot header within the effective address range of the FLASH memory (22), and loads the factory image header and partition header in sequence; when the loading identifier is the upgrade program identifier, the upgrade partition header and partition data in the upgrade program storage area are verified, and after the verification is passed, the upgrade partition header is loaded from the upgrade program storage area to overwrite the corresponding factory partition header; after the partition header is loaded, the partition data is loaded into the specified running space according to the partition header to run, and the loading and running of the upgrade program is completed.

3. The online program upgrade system based on a domestically produced PSOC according to claim 2, characterized in that: The specified operating space for partitioned data is specified by the partition header, which includes the load address of the partitioned data, the destination address, the destination space operating address, the data length, the partition data type, and the offset address of the next partition header.

4. The online program upgrade system based on a domestically produced PSOC according to claim 1, characterized in that: The first-level bootloader loads the PL-side running program and the PS-side running program according to the loading identifier. The loading identifier is stored in the loading status storage area. The loading identifier includes the factory program loading identifier and the upgrade program loading identifier.

5. The online program upgrade system based on a domestically produced PSOC according to claim 1, characterized in that: The upgrade program generation module (11) generates the upgrade program by: generating a binary file boot.bin using the Create BootImage tool of the process software. The binary file includes a boot header, an image header, a partition header, and partition data. The partition header and partition data of the program to be upgraded are extracted from the binary file. The data offset address in the partition header is changed to the actual offset address of the upgrade data in the FLASH memory (22). The partition data is verified and placed in the reserved area of ​​the partition header. The partition header is re-verified and the verification value is placed in the verification area of ​​the partition header. The partition header and partition data of the upgrade data are combined to obtain the upgrade program.

6. A program online upgrade system based on a domestically produced PSOC according to claim 5, characterized in that: The online program upgrade system can upgrade the PL program and the PS program separately, or upgrade both the PL program and the PS program simultaneously.

7. A program online upgrade system based on a domestically produced PSOC according to claim 6, characterized in that: When only the PL program is upgraded, the partition data consists of the binary code of the primary boot program, the binary code of the PL upgrade program, and the binary code of the PS factory program or the PS program after the last upgrade. When only the PS program is upgraded, the partition data consists of the binary code of the primary boot program, the binary code of the PS upgrade program, and the binary code of the PL factory program or the PL program after the last upgrade. When the PL program and the PS program are upgraded simultaneously, the partition data consists of the binary code of the first-level boot program, the binary code of the PL upgrade program, and the binary code of the PS upgrade program.

8. The online program upgrade system based on a domestically produced PSOC according to claim 1, characterized in that: The communication module (12) and the terminal device communication module (24) can communicate using CAN, serial port, or Ethernet; The domestic PSOC platform (21) is Fudan Micro's PSOC series, and the online program upgrade system is suitable for online upgrades of bare-metal programs; The FLASH memory (22) is a non-volatile memory that is read and written online when power is off. It can be QSPI FLASH, NORFLASH, or NAND FLASH, with corresponding effective addressing ranges of 16MB, 32MB, and 128MB, respectively. The DDR cache (23) is a large-capacity synchronous dynamic random access memory with a maximum usable space of 1023MB.

9. A program online upgrade system based on a domestically produced PSOC according to claim 1, characterized in that: The PS program runs in the program execution area of ​​the DDR cache (23); the PS program cannot perform initialization operations on the DDR cache (23).

10. A program online upgrade system based on a domestically produced PSOC according to claim 1, characterized in that: After completing the online program upgrade, the status of the loading identifier is changed by sending a program switching instruction through the host computer (1) to switch between the factory program and the upgrade program; the status of the loading identifier can only be changed by the instruction of the host computer (1) and is in a power-off protection state.