Mass production on-chip microcontroller, method and system based on serial flash memory

Through the mass production of on-chip microcontrollers based on serial flash memory, the problems of low mass production efficiency, opaque monitoring and poor scalability are solved, and an efficient and secure mass production process and interactive capabilities in complex environments are achieved.

CN119166564BActive Publication Date: 2025-09-30上海先楫半导体科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411325932.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-09-30
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The mass production process in existing technologies is inefficient, lacks a monitoring mechanism, cannot obtain status and results in a timely manner, and has poor scalability, and cannot meet the interaction needs in complex environments.

Method used

A mass-produced on-chip microcontroller based on serial flash memory is designed, which includes a serial flash memory controller, a command container detection unit, a security algorithm verification unit and a command container processing unit. By building a data transmission management channel, it detects and verifies the mass-produced burning container in a preset format, and executes the burning operation after passing the security verification.

Benefits of technology

It realizes erasure according to the optimal block size of flash memory, improves mass production efficiency, enhances the transparency and security of the mass production process, supports user-defined instructions, and meets the interaction needs in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166564B_ABST
    Figure CN119166564B_ABST
Patent Text Reader

Abstract

This application provides a serial flash-based mass-production on-chip microcontroller, method, and system. Through the on-chip microcontroller and its on-chip boot code, efficient and secure product mass production is achieved. It supports erasing based on optimal memory blocks to optimize programming time and improve programming efficiency. Configuration options are also provided to facilitate user monitoring of production status. User-defined instructions are also supported to meet more complex production requirements. A built-in secure boot and encryption mechanism ensures the security of the programming process and data confidentiality. This effectively improves production efficiency, ensures product safety, and meets the needs of more complex mass production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of integrated circuits, and in particular to a mass-produced on-chip microcontroller, method, and system based on serial flash memory. Background Art

[0002] As the complexity of embedded systems continues to increase, the demand for external flash memory chips in various embedded products has increased significantly. These products often require specific programs to be burned during the mass production process to ensure that the device has specific functions when it leaves the factory. Compared with traditional embedded systems, the mass production process of modern systems faces many challenges, which makes the process more complicated. For example, the mass production process needs to consider interface selection, such as the use of multiple methods such as serial ports, USB, SPI, SWD and JTAG. In order to ensure the confidentiality of mass production programs, measures such as secure boot and encrypted burning are usually required, which undoubtedly increases the difficulty of designing mass production solutions. At the same time, improving mass production efficiency usually relies on dedicated fixtures and the use of parallel burning of multiple devices, which not only increases economic costs but also places higher requirements on hardware design.

[0003] To address these complexities, some manufacturers have proposed an improved solution, which involves solidifying the boot code on the chip and combining it with the off-chip flash mass production firmware to improve mass production efficiency. Specifically, an offline burner is first used to pre-burn the encrypted mass production firmware into the off-chip serial flash memory. The mass production firmware contains a command sequence that can perform basic erase and burn operations. Secondly, the public key for secure boot and the seed for generating the symmetric key for the mass production firmware are preset at the factory. Finally, when the system first boots up, the on-chip boot code parses the mass production firmware from the 4KB offset of the off-chip serial flash memory and, after completing signature verification, performs erase and burn operations while decrypting.

[0004] Although existing technical solutions have improved the convenience of the mass production process to a certain extent, they still have significant drawbacks. First, because the above solution requires operations to be performed from a fixed 4KB offset, the erasure of off-chip flash memory can only be performed at a granularity of less than or equal to 4KB. This limits the application of erasure with larger granularity (such as 32KB or 64KB), which in turn affects the actual mass production efficiency. Second, the lack of a command sequence to indicate the status and results of mass production makes the mass production process opaque, and users cannot intuitively monitor the mass production progress or obtain mass production results in a timely manner, resulting in information asymmetry. Finally, because the system mainly relies on a few basic erase and write operations and lacks flexibility, it cannot meet the needs of customers to interact with mass production programs in complex environments, such as burning product serial numbers or performing write protection on flash memory, and its scalability is therefore limited. Summary of the Invention

[0005] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a mass-produced on-chip microcontroller, method and system based on serial flash memory, which is used to solve the problems of low mass production efficiency in the prior art, resulting in increased processing time, lack of monitoring mechanism in the mass production process, which makes it impossible for users to know the mass production status and results in a timely manner, and poor scalability, which cannot meet the interaction needs in complex environments, such as burning serial numbers and data protection.

[0006] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a method for a mass-produced on-chip microcontroller based on serial flash memory, the on-chip microcontroller comprising: a serial flash memory controller: the serial flash memory controller is communicatively connected to an off-chip serial flash memory; the serial flash memory controller is used to establish a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory; a command container detection unit: the command container detection unit is communicatively connected to the off-chip serial flash memory and the security algorithm verification unit respectively; the command container detection unit is used to detect whether a mass-produced burning container with preset characteristics is contained in the off-chip serial flash memory, and when a mass-produced burning container containing the preset characteristics is detected, the mass-produced burning container is read, and the mass-produced burning container is sent to the memory. Sent to the security algorithm verification unit; security algorithm verification unit: the security algorithm verification unit is respectively connected to the command container detection unit and the command container processing unit, the security algorithm verification unit is used to receive the mass production burning container sent by the command container detection unit, perform a data security verification operation on the mass production burning container, and after passing the data security verification operation, send the mass production burning container to the command container processing unit; command container processing unit: the command container processing unit is respectively connected to the security algorithm verification unit and the on-chip module, the command container processing unit is used to receive the mass production burning container sent by the security algorithm verification unit, and perform a burning operation on the on-chip module based on the mass production burning container.

[0007] In some embodiments of the first aspect of the present application, the preset format mass production burning container includes: a firmware container, which is used to indicate the command container metadata of the mass production burning container; a command container, which contains one or more command blocks, each command block contains command content and a command tail; each command content includes one or more firmware management functions; the tail of each command block contains authentication information of the next command content, and in response to the authentication information of the next command content meeting a condition, a parsing and processing operation is performed on the next command content.

[0008] In some embodiments of the first aspect of the present application, the process of the command container detection unit detecting whether the off-chip serial flash memory contains a mass production burning container in a preset format includes: based on the erase granularity of the off-chip serial flash memory, detecting the offset position corresponding to the erase granularity in the off-chip serial flash memory to determine whether the current offset position contains a mass production burning container in a preset format.

[0009] In some embodiments of the first aspect of the present application, based on the erase granularity of the off-chip serial flash memory, a process of detecting an offset position corresponding to the erase granularity in the off-chip serial flash memory to determine whether the current offset position contains a mass production burning container in a preset format includes: starting from the start address of the off-chip serial flash memory and using the erase granularity of the off-chip serial flash memory as a step size, traversing the off-chip serial flash memory; comparing the data memory of a data block read during each traversal with the mass production burning container in the preset format; in response to the data memory of the read data block being consistent with the characteristics of the mass production burning container in the preset format, reading the mass production burning container header information and performing a data security verification operation; in response to the data memory of the read data block being inconsistent with the characteristics of the mass production burning container in the preset format, determining whether a current access offset is less than the memory size of the off-chip serial flash memory; if the current access offset is less than the memory size of the off-chip serial flash memory, increasing the access offset by the size of the erase granularity of the off-chip serial flash memory, and continuing to traverse the off-chip serial flash memory; otherwise, exiting the current mass production process.

[0010] In some embodiments of the first aspect of the present application, the security algorithm verification unit includes: one or more of: a digital signature verification module, a symmetric encryption and decryption module, and a secure hash algorithm module.

[0011] In some embodiments of the first aspect of the present application, the command container processing unit includes: a command container parsing engine, a timer trigger engine, a configuration saving and triggering module, a memory read and write module, a custom command interactive execution module, and a general off-chip read and write application program interface. One or more.

[0012] In some embodiments of the first aspect of the present application, the process of the command container processing unit performing a burning operation on the on-chip module based on the mass production burning container includes: sequentially loading and verifying each command block in the command container of the mass production burning container; in response to the current command block in the command container of the mass production burning container passing the verification, parsing the command content of the current command block, executing the corresponding firmware management function on the on-chip module according to the parsing result, and after the corresponding firmware management function is executed, determining whether the mass production tail of the mass production burning container has been reached; if the mass production tail of the mass production burning container has been reached, completing the mass production task; if the mass production tail of the mass production burning container has not been reached, loading and verifying the next command block in the command container of the mass production burning container, and repeating the command content parsing and firmware management functions.

[0013] In some embodiments of the first aspect of the present application, the process of the serial flash memory controller constructing a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory includes: obtaining parameter information of the off-chip serial flash memory; configuring the access sequence and access parameters of the serial flash memory controller based on the parameter information of the off-chip serial flash memory; and using a general off-chip flash memory read and write application to configure the interface of the off-chip serial flash memory based on the access sequence and access parameters of the serial flash memory controller to enable access to the off-chip serial flash memory.

[0014] To achieve the above-mentioned objectives and other related objectives, the second aspect of the present application provides a mass production method based on serial flash memory, which is applied to an on-chip microcontroller. The method includes: establishing a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory; detecting whether a mass production burning container with preset characteristics is included in the off-chip serial flash memory, and reading the mass production burning container when a mass production burning container with preset characteristics is detected; performing a data security verification operation on the mass production burning container, and after passing the data security verification operation, performing a burning operation on the on-chip module based on the mass production burning container.

[0015] To achieve the above-mentioned objectives and other related objectives, a third aspect of the present application provides a mass production system based on serial flash memory, the system comprising an off-chip serial flash memory, an on-chip microcontroller, and an on-chip module. The interaction process of the system comprises: establishing a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory; the on-chip microcontroller detecting whether a mass production burning container with preset characteristics is contained in the off-chip serial flash memory, and reading the mass production burning container when a mass production burning container with preset characteristics is detected; the on-chip microcontroller performing a data security verification operation on the mass production burning container, and after passing the data security verification operation, performing a burning operation on the on-chip module based on the mass production burning container.

[0016] As described above, the serial flash memory-based mass-produced on-chip microcontroller, method and system of the present application have the following beneficial effects: supporting erasure according to the optimal block size of the flash memory, significantly saving the overall mass production time and improving efficiency; supporting the configuration of mass production status indicators, so that the transparency of the mass production process is improved; supporting the loading and execution of user-defined instructions, realizing more complex mass production interaction logic, and meeting the diverse needs of customers; in addition, all operations are performed under the dual protection of secure boot and encrypted boot, which maximizes the security and confidentiality of the mass production implementation process. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A structural diagram of an embodiment of a mass-produced on-chip microcontroller based on serial flash memory of the present application is shown.

[0018] Figure 2 A structural diagram of an embodiment of a mass production system based on serial flash memory of the present application is shown.

[0019] Figure 3 The diagram shows the structure of a mass-produced burning container of a preset format in an embodiment of a mass-produced on-chip microcontroller based on serial flash memory of the present application.

[0020] Figure 4 The figure shows a flow chart of detection and verification performed by a mass-produced burning container detection module in an embodiment of a mass-produced on-chip microcontroller based on serial flash memory of the present application.

[0021] Figure 5 A flowchart of a command container processing process in an embodiment of a mass-produced on-chip microcontroller based on serial flash memory of the present application is shown.

[0022] Figure 6 A flow chart of an embodiment of a mass production method based on serial flash memory of the present application is shown.

[0023] Figure 7 A flow chart of the interaction process in an embodiment of a mass production system based on serial flash memory of the present application is shown. DETAILED DESCRIPTION

[0024] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.

[0025] Before further explaining the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations:

[0026] <1> On-chip microcontroller: An on-chip microcontroller is a microcomputer integrated on a chip, which contains a central processing unit (CPU), memory (RAM) and peripherals, and is responsible for controlling the operation of the chip.

[0027] <2> Off-chip serial flash memory: Off-chip serial flash memory is a flash memory chip independent of the chip. It communicates with the chip through a serial interface (SPI, I2C, etc.) and is used to store data.

[0028] <3> On-chip modules: On-chip modules refer to modules inside the chip that are specifically used to perform specific functions. For example, the analog-to-digital converter (ADC) converts analog signals into digital signals, the digital-to-analog converter (DAC) converts digital signals into analog signals, the timer is used for precise timing, and the serial port is used for serial communication with other devices.

[0029] <4> Command container detection: Command container detection is a step in the data processing flow used to identify and locate data blocks containing command information, usually by analyzing specific identifiers or data structures in the data stream.

[0030] <5> Command container processing: Command container processing is the process of parsing, validating, and executing a command container. First, the command and parameters in the command container are parsed, then the command is validated to ensure it is legal and valid, and finally, the corresponding action is executed based on the command.

[0031] <6> Firmware container: A firmware container is a file or data structure that contains the program code and configuration information required for chip operation, and is used to update or upgrade the chip's functions.

[0032] <7> Command container: A command container is a data structure that contains commands and related parameters used to control chip behavior. For example, a command container that controls the brightness of a chip's LED light may contain the "LED_ON" command and the brightness value.

[0033] <8> Erase granularity: Erase granularity refers to the smallest unit of data that can be erased during a flash memory chip erase operation. Flash memory chips cannot erase individual bytes, but rather must erase a sector or a block.

[0034] <9> Memory block: A memory block is a continuous area of ​​memory used to store data. Each memory block has a unique address, which allows programs to access data in the block.

[0035] <10> Byte-by-byte comparison method: The byte-by-byte comparison method is used to compare whether two data streams are identical. It compares the two data streams byte by byte. If all bytes are the same, the two data streams are considered identical.

[0036] <11> Signature comparison method: The signature comparison method determines whether data streams are identical by comparing specific signatures within the data streams. A signature is a piece of data at a specific location in the data stream that is used to identify the type or version of the data stream.

[0037] <12> Erase operation: The erase operation clears all data in the flash memory chip and restores it to its initial state at the factory.

[0038] <13> Digital signature verification: Digital signature verification is a security mechanism used to verify the integrity and origin of data. It uses a digital signature algorithm to encrypt the data, generate a digital signature, and append it to the data. The recipient can verify the digital signature to ensure the integrity and authenticity of the data.

[0039] <14> Symmetric encryption and decryption: Symmetric encryption and decryption is an encryption method that uses the same key for encryption and decryption. The encrypting and decrypting parties need to share the same key, and only those who possess the key can decrypt the data.

[0040] <15> Secure Hash Algorithm: A secure hash algorithm converts data of arbitrary length into a fixed-length hash value. The hash value is the fingerprint of the data and can be used to verify the integrity and immutability of the data.

[0041] <16> JESD216 standard: The JESD216 standard is an interface standard for serial flash memory chips. It defines the communication protocol between serial flash memory chips and other chips, including data transmission format, timing, etc.

[0042] <17> ESDSA-P256 algorithm: The ESDSA-P256 algorithm is an elliptic curve digital signature algorithm that uses elliptic curve cryptography to generate and verify digital signatures, ensuring data integrity and reliable source.

[0043] <18> AES-CBC encryption algorithm: AES-CBC encryption algorithm is a commonly used symmetric encryption algorithm that divides data into several blocks and encrypts each block using the same key.

[0044] <19> On-chip one-time programmer: An on-chip one-time programmer is a device specifically used to program a chip once. It can only be programmed once and cannot be changed afterwards.

[0045] <20> On-chip SRAM: On-chip SRAM is a very fast memory, but it is volatile and the stored data will be lost if the power is turned off. It is usually used to store program code, working data, and other data that needs to be accessed quickly.

[0046] To facilitate understanding of the embodiments of this application, first Figure 1 Detailed description. Figure 1 The following is a schematic diagram showing the structure of a mass-produced on-chip microcontroller based on serial flash memory according to an embodiment of the present invention. The mass-produced on-chip microcontroller based on serial flash memory according to this embodiment mainly includes the following units:

[0047] Serial flash memory controller 101: the serial flash memory controller is in communication with an off-chip serial flash memory; the serial flash memory controller is used to establish a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory.

[0048] In one embodiment of the present invention, the process of the serial flash memory controller constructing a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory includes: obtaining parameter information of the off-chip serial flash memory; configuring the access sequence and access parameters of the serial flash memory controller based on the parameter information of the off-chip serial flash memory; and using a general off-chip flash memory read and write application to configure the interface of the off-chip serial flash memory based on the access sequence and access parameters of the serial flash memory controller to achieve access to the off-chip serial flash memory.

[0049] In this embodiment, the serial flash controller implements a basic set of serial flash operation logic, combined with a universal off-chip flash read / write program, to ensure compatibility with mainstream serial flash memories on the market. The serial flash controller provides flexible configuration options, allowing customized access sequences based on the characteristics of the off-chip serial flash memory. This part, combined with the universal off-chip flash read / write application program interface, enables seamless support for mainstream serial flash memories on the market. This design allows users to easily interact with different brands and types of serial flash memories without having to worry about the underlying implementation details.

[0050] In this embodiment, the parameter information of the off-chip serial flash memory includes but is not limited to: flash memory type (such as NOR flash memory or NAND flash memory), storage capacity (such as 8MB, 16MB, etc.), page size (the number of bytes per write operation, such as 256 bytes), block size (the number of bytes per erase operation), clock frequency (the maximum operating frequency of the flash memory operation, which determines the read and write speed), access latency (the time required for read and write operations), and one or more parameter information in the interface protocol (such as SPI or QSPI).

[0051] In this embodiment, the process of configuring the serial flash memory controller's access sequence and access parameters aims to achieve compatibility with multiple mass-produced interfaces (such as serial ports, USB, SPI, SWD, and JTAG). The process includes: first, designing the access sequence, specifying device selection, issuing an operation command (such as a read, write, or erase command), providing the corresponding data address, and performing the data transfer (read or write); second, configuring the access parameters, including setting the clock frequency (ensuring it matches the maximum operating frequency of the flash memory), selecting the bus width (such as single, dual, or quad channels), and determining the transmission mode (full-duplex or half-duplex); third, ensuring that the electrical characteristics (such as voltage levels and signal integrity) and physical connections (such as interface pinouts or adapters) are compatible with the different mass-produced interfaces to avoid failures caused by electrical mismatches; and finally, integrating the corresponding software drivers and middleware layers to enable the mass-produced interfaces to access and manage multiple interfaces in a unified manner.

[0052] In this embodiment, based on the access sequence and access parameters of the serial flash memory controller, the process of configuring the interface of the off-chip serial flash memory using a general off-chip flash memory read and write application includes the following steps: parsing the parameter information of the flash memory, the parameter information including one or more of the flash memory type, storage capacity, and access delay, to determine the optimal configuration method; sending an initialization command to the serial flash memory controller to ensure that device selection, command sending, and address configuration are correct; configuring access parameters, such as setting the clock frequency, bus width, and transmission mode, to adapt to different mass production interfaces; performing actual read and write operations, and interacting with the off-chip serial flash memory through a standardized interface to achieve effective access and management of the flash memory.

[0053] Furthermore, the universal off-chip flash memory read / write application is a software tool for interacting with and managing various types of off-chip serial flash memory. It supports multiple interface protocols, including SPI, I2C, and USB, ensuring adaptability and compatibility in diverse hardware environments. Its core functions include initializing the flash memory device, performing read and write operations, erasing storage areas, querying device status, and configuring access parameters. It communicates with the serial flash memory controller using standard command and data formats, enabling flexible interface configuration for mass production.

[0054] Figure 2The present invention shows a schematic structural diagram of a mass production system based on serial flash memory in one embodiment of the present invention. The system includes: an on-chip microcontroller for mass production based on serial flash memory, an off-chip serial flash memory 15 for mass production based on serial flash memory, and an on-chip module 12 for mass production based on serial flash memory. Among them, the on-chip microcontroller is the main innovation of this application. The on-chip microcontroller includes: an on-chip boot code 1, which includes a security algorithm software and hardware module 2, a command container detection module 6, a command container processing module 7, and a serial flash memory controller 14. The security algorithm software and hardware module 2 includes: a digital signature verification module 3, a symmetric encryption and decryption module 4, and a secure hash algorithm module 5. The command container processing module 7 includes: a command container parsing engine 8, a timer trigger module 9, a configuration save and trigger module 10, a storage read and write module 11, a custom command interactive execution module 12, and a universal off-chip flash memory read and write application program interface 13. The on-chip module 12 includes a memory module 16 and an on-chip peripheral 21. The memory module 16 includes a memory protection unit 17, an on-chip flash memory 18, an on-chip one-time programmer 19, and an on-chip SRAM 20. The on-chip peripherals 21 support communication connections via GPIO, UART, SPI, I2C, CAN, USB, Ethernet, etc.

[0055] A command container detection unit 102 is configured to be communicatively connected to an off-chip serial flash memory and a security algorithm verification unit, respectively. The command container detection unit is configured to detect whether a mass-produced programming container with preset characteristics is included in the off-chip serial flash memory, and upon detecting a mass-produced programming container with the preset characteristics, read the mass-produced programming container and send the mass-produced programming container to the security algorithm verification unit.

[0056] In one embodiment of the present invention, the preset format mass production burning container includes: a firmware container, which is used to indicate command container metadata of the mass production burning container; a command container, which contains one or more command blocks, each command block containing command content and a command tail; each command content includes one or more firmware management functions; the tail of each command block contains authentication information of the next command content, and in response to the authentication information of the next command content meeting a condition, a parsing and processing operation is performed on the next command content.

[0057] Figure 3 This diagram shows the structure of a pre-formatted mass-production burning container in one embodiment of the present invention. It includes a firmware container and a command container. The firmware container uses a standardized packaging method to organize the firmware structure, integrating multiple firmware components and providing necessary management information. The command container effectively ensures the security and stability of command execution through an authentication mechanism for each command block, preventing the execution of illegal commands.

[0058] Furthermore, the firmware container includes a firmware container header, a firmware information table, a device configuration block, a signature block, and a FW Blob module. The firmware container header contains important metadata, including one or more of signature information, encryption-related information, firmware container size, command container start offset, version information, and a checksum, used to verify the integrity and origin of the firmware. The firmware information table includes the name, size, type, address, and version information of each firmware component for component management and identification. The device configuration block stores device hardware and software configuration information, such as processor type, memory size, peripheral information, operating system version, network configuration, and application configuration. The signature block contains a digital signature, typically signed by a certification authority, used to verify the integrity of the firmware container. The FW BLOB (Firmware Binary Large Object) module refers to a data format used to store firmware. In embedded systems and hardware devices, firmware is the program or software that controls hardware operations and is stored in the device's internal memory, such as flash memory. BLOBs represent a method for storing large amounts of binary data and are commonly used in databases or storage systems. FW BLOBs are used to package firmware into a large binary file for storage and updating on the device.

[0059] Furthermore, the command container consists of a series of independent command blocks, each of which contains command content and a command trailer. The command content includes specific instruction operations, such as configuring memory, erasing areas, writing data, configuring peripherals indicating operating status, and loading custom applets. To ensure the safe execution of commands, the trailer of each command block contains authentication information used to verify the next command. Only when the authentication conditions are met can the next command be correctly parsed and processed. The command container in this invention effectively prevents the execution of illegal commands, ensuring the security and stability of the system.

[0060] In one embodiment of the present invention, the process of the command container detection unit detecting whether the off-chip serial flash memory contains a mass production burning container in a preset format includes: based on the erase granularity of the off-chip serial flash memory, detecting an offset position corresponding to the erase granularity in the off-chip serial flash memory to determine whether the current offset position contains a mass production burning container in the preset format.

[0061] In this embodiment, the command container detection module is used to locate and identify command containers in the off-chip serial flash memory. It detects command containers at the corresponding offset address based on the flash memory's erase granularity and confirms their presence by analyzing command container characteristics (such as specific data structures, checksums, or flags). For example, if the off-chip serial flash memory has an erase granularity of 4KB and the command container starts at 0x10000, the detection module checks each erase block, starting at 0x10000 and in 4KB increments, looking for predefined characteristics, such as the "CMD_CONTAINER" byte sequence. If a characteristic is found, the block is determined to contain a command container and its starting address is recorded.

[0062] In one embodiment of the present invention, based on the erase granularity of an off-chip serial flash memory, a process of detecting an offset position corresponding to the erase granularity in the off-chip serial flash memory to determine whether a mass production programming container in a preset format is contained at the current offset position includes: traversing the off-chip serial flash memory starting from a start address of the off-chip serial flash memory and using the erase granularity of the off-chip serial flash memory as a step size; comparing the data memory of a data block read during each traversal with the mass production programming container in the preset format; in response to a consistency between the data memory of the read data block and the mass production programming container in the preset format, reading the mass production programming container header information and performing a data security verification operation; in response to a consistency between the data memory of the read data block and the mass production programming container in the preset format, determining whether a current access offset is less than the memory size of the off-chip serial flash memory; if the current access offset is less than the memory size of the off-chip serial flash memory, increasing the access offset by the erase granularity of the off-chip serial flash memory and continuing to traverse the off-chip serial flash memory; otherwise, exiting the current mass production process.

[0063] In this embodiment, the algorithm for comparing the data memory of each data block read during each traversal with the mass-produced burning container in a preset format includes a byte-by-byte comparison algorithm or a signature comparison algorithm. The byte-by-byte comparison algorithm directly compares each byte of the two data blocks and is suitable for smaller data blocks, but it is less efficient and data-sensitive. The signature comparison algorithm, on the other hand, compares the signature of the data blocks by calculating the signature, such as using a CRC checksum, MD5, or SHA-256 hash algorithm, and can quickly compare larger data blocks.

[0064] This embodiment allows the user to flexibly set the erase range according to needs without being restricted by a fixed size. This flexible erasure method, combined with erasing based on search results (block-aligned areas), can achieve efficient erasing operations. However, the existing system design has limitations, forcing the parsing and execution of mass production operations from a fixed 4KB offset of the off-chip flash memory, resulting in the flash memory only being able to be erased at a granularity of less than or equal to 4KB. This design limits the possibility of using a larger erase granularity to improve erase efficiency. For example, when 64KB of flash memory space needs to be erased, 16 erase operations are required using a 4KB granularity, while only one erase operation is required using a 64KB granularity. The efficiency gap is obvious, thereby solving the problem of the limited granularity of the off-chip flash memory in the prior art, which affects the erase efficiency.

[0065] Figure 4 This figure shows a flow chart of the detection and verification process performed by the mass production burning container detection module in one embodiment of the present invention. When the on-chip boot code is powered on and begins execution, it first checks whether the trigger conditions for detection and verification are met. If the trigger conditions are met, the mass production burning container characteristics are searched in sequence by FLASH block size. If the mass production burning container characteristics are detected, the firmware container header in the mass production burning container is loaded and verified. If the verification passes, the command container processing sub-process is entered; otherwise, the mass production process is exited. If the mass production burning container characteristics are not detected, a further determination is made as to whether the end of the flash memory has been reached. If so, the mass production process is exited; otherwise, the access offset is increased by the FLASH block size.

[0066] Security algorithm verification unit 103: The security algorithm verification unit is communicatively connected to the command container detection unit and the command container processing unit respectively. The security algorithm verification unit is used to receive the mass production burning container sent by the command container detection unit, perform a data security verification operation on the mass production burning container, and send the mass production burning container to the command container processing unit after passing the data security verification operation.

[0067] In one embodiment of the present invention, the security algorithm verification unit includes: one or more of a digital signature verification module, a symmetric encryption and decryption module, and a secure hash algorithm module.

[0068] In this embodiment, the digital signature verification module verifies the integrity and source of off-chip data by verifying the digital signature based on the principles of public key cryptography. The digital signature verification process includes: obtaining the digital signature corresponding to the off-chip data and verifying the digital signature using the public key of the on-chip system. If the verification is successful, the off-chip data is considered complete and comes from a legitimate source. The data is signed using the private key of the off-chip serial flash memory to generate a digital signature. The on-chip boot code verifies the digital signature using the public key of the off-chip serial flash memory. If the verification passes, it indicates that the data has not been tampered with and comes from a legitimate source.

[0069] In this embodiment, the symmetric encryption and decryption module uses the same key for encryption and decryption operations, ensuring security during off-chip data transmission. The verification process of the symmetric encryption and decryption module includes encrypting off-chip data using the key and decrypting the encrypted data using the same key. If decryption is successful, the data is deemed to have not been stolen or tampered with. A symmetric encryption algorithm uses the same key for encryption and decryption operations. The encryption process converts plaintext into ciphertext, and the decryption process converts ciphertext into plaintext.

[0070] In this embodiment, the secure hash algorithm module uses a hash algorithm to calculate a digest of off-chip data for data integrity verification. The secure hash algorithm module's verification process includes calculating a hash value for the off-chip data and comparing the calculated hash value with a stored hash value. If the two hash values ​​are identical, the data is deemed untampered with. The hash algorithm converts data of arbitrary length into a fixed-length hash value. Even slight changes to the data can significantly alter its hash value. The hash value can be used to verify data integrity.

[0071] Command container processing unit 104: The command container processing unit is respectively connected to the security algorithm verification unit and the on-chip module for communication. The command container processing unit is used to receive the mass production burning container sent by the security algorithm verification unit and perform a burning operation on the on-chip module based on the mass production burning container.

[0072] In one embodiment of the present invention, the command container processing unit includes: a command container parsing engine, a timer triggering engine, a configuration saving and triggering module, a memory read and write module, a custom command interactive execution module and a general off-chip read and write application program interface. One or more.

[0073] In one embodiment of the present invention, a command container parsing module is used to parse the various commands stored in the command container and, based on the parsing results, sequentially execute corresponding actions, such as erasing flash memory or illuminating an error indicator. This module first parses the received command, determining its type and parameters, and then performs the corresponding function based on the desired operation. During execution, the module pays attention to the execution order and conditions to ensure that the user's intent is accurately reflected. This design ensures that the on-chip module responds appropriately to various events in different states, thereby improving system stability and reliability.

[0074] In one embodiment of the present invention, a timer trigger engine is used to execute user-defined operations on a scheduled basis. It can automatically perform certain actions at specific intervals, such as flashing an indicator light during operation. This module uses a timer to periodically execute specific tasks at user-preset intervals, improving the dynamic responsiveness and interactivity of the on-chip module. Users can adjust the timer settings as needed, such as modifying the flashing frequency or duration, to achieve personalized functionality.

[0075] In one embodiment of the present invention, the configuration saving and triggering module is used to save the action sequences and trigger conditions indicated in the mass production program. This means that when configuring the device, users can set various behavioral specifications, such as the pins corresponding to indicator lights and the flashing frequency. Whenever the device is powered on or reset, the module quickly restores the previous state based on the saved configuration, thus ensuring consistency and stability. Preferably, this module also provides a simple interface to avoid confusion during the configuration process, allowing users to easily manage and update action sequences and trigger conditions.

[0076] In one embodiment of the present invention, a memory read / write module is used for erase, read, and write operations on on-chip memory modules or external serial flash memory. This module supports a variety of memories, ensuring secure data access and efficient memory resource management. During the read / write process, the module handles various states, such as busy waits and error handling, to ensure data consistency and accuracy, enabling data persistence and flexible management.

[0077] In one embodiment of the present invention, the custom command interactive execution module is used to load and execute its designated mini-programs, providing a high degree of flexibility and scalability. Users can write and upload mini-programs as needed, which can complete specific tasks or interact with other parts of the system. Before executing the mini-programs, the module performs security and compatibility checks to prevent potential errors or security vulnerabilities. This design not only improves the system's customizability but also enables the system to quickly adapt to changing needs and application scenarios.

[0078] Furthermore, through the custom command interaction execution module, you can implement various functional mini-programs on the on-chip module to meet different application requirements. For example, the LED control mini-program uses serial port commands to control the LED state, including on, off, and flashing functions. The temperature monitoring and alarm mini-program reads temperature sensor data in real time and triggers an alarm when the temperature exceeds the set threshold. The data logging and storage mini-program regularly collects environmental sensor data and stores it for subsequent analysis. Through the serial port command parsing and execution mini-program, users can send custom commands, and the system parses and executes the corresponding operations. The real-time clock and timed wakeup mini-program maintains time accuracy in low-power states and provides timed wakeup capabilities. The custom task scheduling mini-program executes a series of operations based on user-defined policies, such as periodically enabling devices or collecting data. The simple user interface mini-program provides a basic input interface for easy adjustment of device status. The remote firmware update mini-program supports receiving and burning new firmware over the network, optimizing the device update process. These mini-programs enhance the application capabilities of the on-chip module.

[0079] In one embodiment of the present invention, the universal off-chip flash memory read and write application program interface is implemented based on the JESD216 standard and supports mainstream off-chip serial NOR flash memory on the market. This interface is designed to provide a unified operating method, enabling developers to read and write data in a consistent manner, increasing the versatility and portability of the system. Through this interface, developers can quickly implement support for multiple types of flash memory without having to consider specific hardware implementation details, thereby saving development time and costs. This interface not only meets market needs but also improves the overall performance and stability of the system. JESD216 refers to the standard for serial NOR flash memory developed by JEDEC (Solid State Technology Association). It aims to standardize the interface and performance characteristics of flash memory and promote market uniformity and compatibility.

[0080] In one embodiment of the present invention, the process of the command container processing unit performing a programming operation on the on-chip module based on the mass production burning container includes: sequentially loading and verifying each command block in the command container of the mass production burning container; in response to a current command block in the command container of the mass production burning container passing the verification, parsing the command content of the current command block, executing a corresponding firmware management function on the on-chip module based on the parsing result, and after the corresponding firmware management function is executed, determining whether the mass production end of the mass production burning container has been reached; if the mass production end of the mass production burning container has been reached, completing the mass production task; if the mass production end of the mass production burning container has not been reached, loading and verifying the next command block in the command container of the mass production burning container, and repeating the command content parsing and firmware management functions.

[0081] In one embodiment of the present invention, the process of mass production burning of the on-chip module in collaboration with the on-chip code and the off-chip serial flash memory includes the following steps: the user's on-chip boot program is burned to the 256KB offset of the off-chip serial flash memory, which has multiple key functions to ensure the safety and efficiency of the device during the mass production process. First, the on-chip boot program is digitally signed using the ESDSA-P256 algorithm and encrypted using the AES-CBC encryption algorithm to ensure the integrity and security of the program. After the mass production process begins, the PA10 pin in the on-chip module is set as a running indicator light by the on-chip boot program. When the burning process is running normally, the pin is set to flash once every 100 milliseconds to clearly indicate the running status of the program.

[0082] Furthermore, to provide timely feedback on potential production issues, the PA11 pin is configured as a production failure indicator. If a failure occurs, the pin is set to flash every 500 milliseconds to alert the user to a programming failure. Subsequently, the on-chip boot program erases and writes the user program to the 4KB offset in the off-chip flash memory to ensure that the user program is loaded correctly.

[0083] Figure 5 The following is a flow chart of the command container processing process in one embodiment of the present invention. After the mass production burning container passes the verification, the command container parsing is started, the first command block is loaded and verified, and it is determined whether the mass production burning container has passed the verification. If it has passed the verification, the command block content is further parsed. The structure of the command block is as follows: Figure 3 As shown in the figure, each command block contains the command content and a command tail, which contains information about the next command. This further enhances security. The parsed command block content includes configuration operation status indication, memory configuration, memory erase, memory write, load operation definition instructions (program), and reset. After the current command block is executed, it determines whether the end of the mass production burning container has been reached. If so, the current mass production process is completed. Otherwise, the next command block is loaded and verified. If verification fails, the current mass production process is exited.

[0084] Furthermore, the program writes the hash value of the secure boot key into the on-chip one-time programmer to further ensure the security of the boot process, and burns life cycle related codes to effectively manage the use cycle of the device and ensure its stable operation. After completing the security settings, the on-chip boot program will load a special chip definition instruction, which configures the UART and communicates with the mass production machine to realize the burning of the product serial number. When the serial number entry is completed, the program will return to the corresponding command sequence for subsequent processing. Finally, after completing all the above operations, the on-chip boot program will execute the erase of the on-chip boot program itself and restart the chip of the on-chip module, thereby successfully completing the entire mass production process of the product. During this period, the on-chip boot code will follow Figure 4 The steps shown in the figure complete the detection and verification of the command container required for mass production, and then follow Figure 5 The process shown completes the parsing and execution of the command container. Through this series of interrelated steps, the on-chip boot program ensures the security, correct burning, and integrity of the user's device, thereby achieving an efficient mass production process.

[0085] Furthermore, the command block for programming an on-chip module includes the following operations: Configure the operating status indicator to confirm that the module has successfully started and is operating normally, such as lighting an LED or setting a status register. Configure the memory to set the type, size, and access method of the module's internal memory to ensure that programs and data can be correctly stored and read. Erase the memory to restore the memory to its initial state to make room for new programs and data. Write the memory to transfer the new program code and related data to the module's memory so that the module can run the program and access the data. Load the run definition instructions (program) to load the program code into the module's memory so that it can run the program. Reset the module to its initial state, clear the internal status register, and stop program execution to allow for a new programming operation.

[0086] It should be understood that the division of units and modules in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the present application may be integrated into a single processor, or may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or software functional modules.

[0087] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" represent examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0088] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b, c can be single or multiple.

[0089] Figure 6 FIG. 1 is a flow chart of a method for mass producing serial flash memory provided by an embodiment of the present application, wherein the method is applied to an on-chip microcontroller. Figure 6 As shown, the method includes the following steps:

[0090] Step S61: establishing a data transmission management channel with the off-chip serial flash memory.

[0091] Step S62: detecting whether a mass production burning container with preset characteristics is included in the off-chip serial flash memory, and reading the mass production burning container when a mass production burning container with preset characteristics is detected.

[0092] Step S63: performing a data security verification operation on the mass production burning container, and after the data security verification operation passes, performing a burning operation on the on-chip module based on the mass production burning container.

[0093] It should be understood that the specific process of executing the above corresponding steps in each process step has been described in detail in the embodiment of the above-mentioned on-chip microcontroller, and for the sake of brevity, it will not be repeated here.

[0094] Figure 7 A schematic diagram of the interaction process of an embodiment of a serial flash memory-based mass production system of the present application is shown. The system includes an off-chip serial flash memory, an on-chip microcontroller, and an on-chip module. The interaction process of the system includes:

[0095] A data transmission management channel is established between the on-chip microcontroller and the off-chip serial flash memory. The on-chip microcontroller detects whether a mass-produced programming container with preset characteristics is included in the off-chip serial flash memory, and reads the mass-produced programming container when a mass-produced programming container with preset characteristics is detected. The on-chip microcontroller performs a data security verification operation on the mass-produced programming container, and after the data security verification operation passes, performs a programming operation on the on-chip module based on the mass-produced programming container.

[0096] In one embodiment of the present invention, the implementation of this solution relies on multiple storage-related modules in the on-chip module to ensure the feasibility and security of the solution. Specifically, the storage protection unit in the memory module is used to prevent the execution of illegal code during the mass production process, thereby enhancing the security of the system. On-chip flash memory and on-chip one-time programmer are important components of the mass production solution, and are mainly used to implement programming and burning of on-chip storage. In addition, on-chip SRAM is used to store some configuration data or user-defined instructions required in the mass production process. At the same time, the on-chip peripherals assume the function of indicating the mass production status, and support the execution of user-defined instructions and communication processes and other operations. The collaborative work of these modules ensures the smooth progress of the mass production process, further improving the reliability of the overall system and user experience.

[0097] It should be understood that the specific process of executing the above corresponding steps in each process step has been described in detail in the embodiment of the above-mentioned on-chip microcontroller, and for the sake of brevity, it will not be repeated here.

[0098] As used in this specification, the terms "component," "module," "system," and the like are used to refer to computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. By way of illustration, both an application running on a computing device and the computing device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on a single computer and / or distributed across two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component on a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).

[0099] Those skilled in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0100] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0101] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0102] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0104] In the above embodiments, the functions of each functional unit can be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions (programs). When these computer program instructions (programs) are loaded and executed on a computer, they fully or partially produce the processes or functions according to the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., high-density digital video discs (DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0105] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

[0106] In summary, the present application provides a mass-produced on-chip microcontroller, method, and system based on serial flash memory. The present invention provides a method for improving the efficiency and security of mass-production burning of on-chip modules. Through the on-chip microcontroller and its on-chip boot code, efficient and secure product mass production is achieved. It can support erasing according to the optimal memory block to optimize the burning time and improve the burning efficiency. It also provides configuration options to facilitate users to monitor the mass production status. In addition, it can support user-defined instructions to meet more complex mass production requirements. It also has a built-in secure boot and encryption mechanism to ensure the security of the burning process and the confidentiality of data. This effectively improves production efficiency, ensures product safety, and meets more complex mass production requirements. Therefore, the present application effectively overcomes the various shortcomings of the existing technology and has high industrial utilization value.

[0107] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.

Claims

1. A mass-produced on-chip microcontroller based on serial flash memory, characterized in that: The on-chip microcontroller includes: Serial flash memory controller: The serial flash memory controller is communicatively connected to an off-chip serial flash memory; the serial flash memory controller is used to establish a data transmission management channel between the on-chip microcontroller and the off-chip serial flash memory, wherein the process includes: obtaining parameter information of the off-chip serial flash memory; configuring an access sequence and access parameters of the serial flash memory controller based on the parameter information of the off-chip serial flash memory; and configuring an interface of the off-chip serial flash memory using a universal off-chip flash memory read / write application based on the access sequence and access parameters of the serial flash memory controller to enable access to the off-chip serial flash memory; A command container detection unit: The command container detection unit is communicatively connected to the off-chip serial flash memory and the security algorithm verification unit respectively; the command container detection unit is used to detect whether a mass-produced programming container with preset characteristics is included in the off-chip serial flash memory, and when a mass-produced programming container with preset characteristics is detected, the mass-produced programming container is read and sent to the security algorithm verification unit; the process of the command container detection unit detecting whether a mass-produced programming container with a preset format is included in the off-chip serial flash memory includes: based on the erase granularity of the off-chip serial flash memory, detecting an offset position corresponding to the erase granularity in the off-chip serial flash memory to determine whether the current offset position contains a mass-produced programming container with the preset format; A security algorithm verification unit is communicatively connected to the command container detection unit and the command container processing unit. The security algorithm verification unit is configured to receive the mass production burning container sent by the command container detection unit, perform a data security verification operation on the mass production burning container, and send the mass production burning container to the command container processing unit after the data security verification operation passes. Command container processing unit: The command container processing unit is respectively communicatively connected to the security algorithm verification unit and the on-chip module. The command container processing unit is used to receive the mass production burning container sent by the security algorithm verification unit, and perform a burning operation on the on-chip module based on the mass production burning container.

2. The mass-produced on-chip microcontroller based on serial flash memory according to claim 1, characterized in that: The mass production burning container of the preset format includes: A firmware container, wherein the firmware container is used to indicate command container metadata of the mass production burning container; A command container, wherein the command container includes one or more command blocks, each command block includes command content and a command tail; each command content includes one or more firmware management functions; the tail of each command block includes authentication information of the next command content, and in response to the authentication information of the next command content meeting a condition, a parsing and processing operation is performed on the next command content.

3. The mass-produced on-chip microcontroller based on serial flash memory according to claim 1, characterized in that: Based on the erase granularity of the off-chip serial flash memory, a process of detecting an offset position corresponding to the erase granularity in the off-chip serial flash memory to determine whether the current offset position contains a mass production programming container of a preset format includes: Starting from the starting address of the off-chip serial flash memory, the off-chip serial flash memory is traversed with the erase granularity of the off-chip serial flash memory as a step size; the data memory of the data block read in each traversal is compared with the mass production burning container of a preset format; In response to the data memory of the read data block being consistent with the characteristics of the mass production burning container in a preset format, reading the header information of the mass production burning container and performing a data security verification operation; In response to the data memory of the read data block being inconsistent with the mass production burning container characteristics of the preset format, it is determined whether the current access offset is smaller than the memory size of the off-chip serial flash memory. If the current access offset is smaller than the memory size of the off-chip serial flash memory, the access offset is increased according to the size of the erase granularity of the off-chip serial flash memory, and the traversal of the off-chip serial flash memory is continued; otherwise, the current mass production process is exited.

4. The mass-produced on-chip microcontroller based on serial flash memory according to claim 1, characterized in that: The security algorithm verification unit includes: one or more of a digital signature verification module, a symmetric encryption and decryption module, and a security hash algorithm module.

5. The mass-produced on-chip microcontroller based on serial flash memory according to claim 1, characterized in that: The command container processing unit includes one or more of a command container parsing engine, a timer triggering engine, a configuration saving and triggering module, a memory read / write module, a custom command interactive execution module, and a general off-chip read / write application program interface.

6. The mass-produced on-chip microcontroller based on serial flash memory according to claim 2, characterized in that: The process of the command container processing unit performing a programming operation on the on-chip module based on the mass production programming container includes: sequentially loading and verifying each command block in the command container of the mass production burning container; In response to a current command block in the command container of the mass production burning container passing verification, the command content of the current command block is parsed, a corresponding firmware management function is executed on the on-chip module according to the parsing result, and after the corresponding firmware management function is executed, it is determined whether the mass production end of the mass production burning container has been reached; if the mass production end of the mass production burning container has been reached, the mass production task is completed; if the mass production end of the mass production burning container has not been reached, the next command block in the command container of the mass production burning container is loaded and verified, and the command content parsing and firmware management functions are repeated.

7. A mass production method based on serial flash memory, characterized in that: The method is applied to a mass-produced on-chip microcontroller based on a serial flash memory according to any one of claims 1 to 6, and the method comprises: Build a data transmission management channel with the off-chip serial flash memory; Detecting whether a mass production burning container with preset characteristics is included in the off-chip serial flash memory, and reading the mass production burning container when a mass production burning container with the preset characteristics is detected; A data security verification operation is performed on the mass production burning container, and after the data security verification operation passes, a burning operation is performed on the on-chip module based on the mass production burning container.

8. A mass production system based on serial flash memory, characterized in that: The system includes an off-chip serial flash memory, a mass-produced on-chip microcontroller based on the serial flash memory and an on-chip module according to any one of claims 1 to 6, and the interaction process of the system includes: A data transmission management channel is established between the on-chip microcontroller and the off-chip serial flash memory; The on-chip microcontroller detects whether a mass production burning container with preset characteristics is included in the off-chip serial flash memory, and reads the mass production burning container when the mass production burning container with the preset characteristics is detected; The on-chip microcontroller performs a data security verification operation on the mass production burning container, and after passing the data security verification operation, performs a burning operation on the on-chip module based on the mass production burning container.

Citation Information

Patent Citations

  • Terminal equipment parameter automatic mass production system and method

    CN111258631A

  • Method and system for burning electric quantity management product and burner

    CN115993976A