Mass production on-chip microcontroller, method and system based on serial flash memory
By introducing serial flash controller, command container detection unit and security algorithm verification unit into the mass production microcontroller, the problems of low mass production efficiency and lack of monitoring mechanism are solved, and an efficient and safe mass production process is achieved. Supports interactive needs in complex environments.
Patent Information
- Application Number
- CN202411325932.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-23
AI Technical Summary
In the prior art, the mass production efficiency is low, the lack of monitoring mechanisms, the interaction needs in complex environments are not met, and the security and confidentiality are insufficient.
A mass-produced on-chip microcontroller based on serial flash memory is designed, including a serial flash memory controller, command container detection unit, security algorithm verification unit and command container processing unit, supporting flexible erase granularity, data security verification and self-service Define command execution to ensure transparency and security of the mass production process.
It significantly improves mass production efficiency, enhances process transparency, supports complex interactive logic, meets diverse needs, and maximizes the security and confidentiality of the mass production process under the dual protection of secure startup and encrypted startup.
Smart Images

Figure CN119166564A_ABST
Abstract
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 need to be burned with specific programs 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 its process more complicated. For example, the selection of interfaces needs to be considered during the mass production process, such as the application of multiple methods such as serial ports, USB, SPI, SWD and JTAG. In order to ensure the confidentiality of the mass production program, it is usually necessary to implement measures such as secure boot and encrypted burning, which undoubtedly increases the difficulty of designing mass production solutions. At the same time, the improvement of mass production efficiency usually depends on special fixtures and the parallel burning of multiple devices, which not only increases the economic cost, but also puts higher requirements on hardware design.
[0003] In response to these complexities, some manufacturers have proposed an improved solution, which is to improve mass production efficiency by solidifying the boot code on the chip and combining it with the mass production firmware in the off-chip flash memory. Specifically, first, the encrypted mass production firmware is pre-burned into the off-chip serial flash memory using an offline burner, where the mass production firmware contains a command sequence that can perform basic erasing and burning; secondly, the public key for secure boot and the seed for generating the symmetric key of the mass production firmware are preset at the factory; finally, when the system is started for the first time, the on-chip boot code parses the mass production firmware from the 4KB offset position of the off-chip serial flash memory, and after completing the signature verification, it performs the erasing and burning operations while decrypting.
[0004] Although the existing technical solutions have improved the convenience of the mass production process to a certain extent, there are still significant defects. First, since the above solution requires operations to be performed from a fixed 4KB offset, the erasure of the off-chip flash memory can only be performed at a granularity less than or equal to 4KB, which limits the application of erasure with a larger granularity (such as 32KB or 64KB), which in turn affects the actual mass production efficiency. Secondly, the lack of a command sequence for indicating the mass production status and results makes the mass production process opaque, and users cannot intuitively monitor the mass production process or obtain the mass production results in a timely manner, resulting in information asymmetry. Finally, since 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 in product serial numbers or performing write protection of 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 the present 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, so that users cannot know the mass production status and results in time, 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 an off-chip serial flash memory and a security algorithm verification unit respectively; the command container detection unit is used to detect whether a mass-produced burning container with preset features is contained in the off-chip serial flash memory, and when a mass-produced burning container with preset features is detected, the mass-produced burning container is read, and the mass-produced burning container is sent to the security algorithm verification unit. Full algorithm verification unit; security algorithm verification unit: the security algorithm software and hardware unit is respectively connected to the command container detection processing unit and the command container processing unit for communication, the security algorithm software and hardware unit is used to receive the mass production burning container sent by the command container detection unit, perform 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 detection processing unit; command container processing unit: the command container detection processing unit is respectively connected to the security algorithm software and hardware unit and the on-chip module for communication, the command container detection processing unit is used to receive the mass production burning container sent by the security algorithm verification unit, and perform 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 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, 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, taking the erase granularity of the off-chip serial flash memory as a step length, traversing the off-chip serial flash memory; comparing the data memory of the data block read in each traversal with the mass production burning container in a preset format; in response to the data memory of the read data block being consistent with the mass production burning container feature in a 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 mass production burning container feature in a preset format, determining whether the 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 according to 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 detection processing unit performing a burning operation on the on-chip module based on the mass production burning container includes: loading and verifying each command block in the command container of the mass production burning container in sequence; 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, judging 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 building 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 perform interface configuration on 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 purpose and other related purposes, 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, and the method includes: establishing a data transmission management channel between 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 purpose and other related purposes, the 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, and the interaction process of the system comprises: constructing a data transmission management channel 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 a mass production burning container with 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.
[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 erasing 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 can be 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 schematic 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 schematic diagram of an embodiment of a mass production system based on serial flash memory of the present application is shown.
[0019] Figure 3 A schematic structural diagram 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 is shown.
[0020] Figure 4 The figure shows a flow chart of detection and verification 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, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0025] Before further describing 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 applicable 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, which 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, such as analog-to-digital converters (ADCs) that convert analog signals into digital signals, digital-to-analog converters (DACs) that convert digital signals into analog signals, timers for precise timing, and serial ports 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 refers to the process of parsing, verifying, and executing command containers. First, the command and parameters in the command container are parsed, then verification is performed to ensure that the command is legal and valid, and finally the corresponding operation is performed according to 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 the chip to run, 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 LED may contain an "LED_ON" command and a brightness value.
[0033] <8> Erase granularity: The erase granularity refers to the smallest data unit that can be erased when the flash memory chip performs an erase operation. Flash memory chips cannot erase a single byte, but need to erase a sector or a block.
[0034] <9> Memory block: A memory block is a continuous storage space in the memory used to store data. Each memory block has a unique address, and the program can access the data in the block through the address.
[0035] <10> Byte-by-byte comparison method: The byte-by-byte comparison method is used to compare whether two data streams are the same. It compares the two data streams byte by byte, and if all bytes are the same, the two data streams are considered to be the same.
[0036] <11> Signature comparison method: The signature comparison method determines whether data streams are the same by comparing specific signatures in the data streams. A signature is a piece of data at a specific location in a 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 original factory state.
[0038] <13> Digital signature verification: Digital signature verification is a security mechanism used to verify the integrity and source of data. It uses a digital signature algorithm to encrypt the data, generate a digital signature, and attach it to the data. The recipient can ensure the integrity and source of the data by verifying the digital signature.
[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 have the key can decrypt the data.
[0040] <15> Secure Hash Algorithm: A secure hash algorithm is an algorithm that converts data of any length into a hash value of fixed length. 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 the 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, which can ensure the integrity and source of data.
[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 a volatile memory. Once the power is off, the stored data will be lost. It is usually used to store program code, working data and other data that need to be accessed quickly.
[0046] To facilitate understanding of the embodiments of the present application, first Figure 1 Detailed description. Figure 1 The structural diagram of a mass-produced on-chip microcontroller based on serial flash memory in an embodiment of the present invention is shown. The mass-produced on-chip microcontroller based on serial flash memory in this embodiment mainly includes the following units:
[0047] Serial flash memory controller 101: the serial flash memory controller is in communication connection 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 building 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 perform interface configuration on 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.
[0049] In this embodiment, the serial flash memory controller implements a set of basic serial flash memory operation logic, and cooperates with the general off-chip flash memory read and write program to be compatible with the mainstream serial flash memory on the market. The serial flash memory controller provides flexible configuration options, and can customize the corresponding access sequence according to the characteristics of the off-chip serial flash memory. This part is combined with the general off-chip flash memory read and write application program interface to achieve imperceptible support for mainstream serial flash memories on the market. Through such a design, users can easily interact with serial flash memories of different brands and types without having to pay attention to 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 for each write operation, such as 256 bytes), block size (the number of bytes for each erase operation), clock frequency (the maximum operating frequency of the flash memory operation, which determines the read and write speed), access delay (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 access sequence and access parameters of the serial flash controller is intended to achieve compatibility with multiple mass production interfaces (such as serial port, USB, SPI, SWD and JTAG). The process includes: first, designing the access sequence, clarifying the device selection, sending the operation command (such as read, write or erase command), providing the corresponding data address, and performing data transmission (read or write); second, configuring the access parameters, including setting the clock frequency (ensuring matching with the maximum operating frequency of the flash memory), selecting the bus width (such as single channel, dual channel or quad channel) and determining the transmission mode (full duplex or half duplex); then, ensuring that the electrical characteristics (such as voltage level and signal integrity) and physical connections (such as interface pins or adapters) are compatible with different mass production interfaces to avoid failures caused by electrical mismatch; finally, integrating the corresponding software driver and middleware layer so that the mass production interface can 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 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 best 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 read / write application is a software tool for interacting with and managing various types of off-chip serial flash memories. The universal off-chip flash read / write application supports multiple interface protocols, including SPI, I2C, USB, etc., to ensure adaptability and compatibility in different hardware environments. The core functions of the universal off-chip flash read / write application include initializing the flash device, performing read and write operations, erasing storage areas, querying device status, and configuring access parameters. It communicates data with the serial flash controller through standard commands and data formats, thereby achieving flexible mass production interface configuration.
[0054] Figure 2The structural schematic diagram of a mass production system based on serial flash memory in one embodiment of the present invention is shown. The system includes: a mass-produced on-chip microcontroller based on serial flash memory, a mass-produced off-chip serial flash memory 15 based on serial flash memory, and a mass-produced on-chip module 12 based on serial flash memory. Among them, the on-chip microcontroller is the main innovation of this application, and the on-chip microcontroller includes: an on-chip boot code 1, and the on-chip boot code 1 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 saving and triggering module 10, a storage read and write module 11, a custom command interactive execution module 12, and a general 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 storage 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 in the form of GPIO, UART, SPI, I2C, CAN, USB, Ethernet, etc.
[0055] Command container detection unit 102: The command container detection unit is respectively connected to the off-chip serial flash memory and the security algorithm verification unit in communication; the command container detection unit is used to detect whether a mass production burning container with preset characteristics is included in the off-chip serial flash memory, and when a mass production burning container with preset characteristics is detected, the mass production burning container is read, and the mass production burning container is sent to the security algorithm verification unit.
[0056] In one embodiment of the present invention, the mass production burning container in the preset format includes: a firmware container, which is used to indicate the command container metadata of the mass production burning container; a command container, which 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 processing operation is performed on the next command content.
[0057] Figure 3 The schematic diagram of the structure of the preset format mass production burning container in one embodiment of the present invention is shown. It contains a firmware container and a command container. The firmware container uses a standardized packaging method to organize the firmware structure, integrates multiple firmware components together, and provides necessary management information. The command container effectively ensures the security and stability of command execution through the authentication mechanism of each command block, and prevents 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. Among them, the firmware container header contains important metadata, including signature information, encryption related information, firmware container size, command container start offset, version information, and one or more metadata in the checksum, which are used to verify the integrity and source of the firmware. The firmware information table includes the name, size, type, address, and version information of each firmware component for management and identification of components. The device configuration block is used to store the hardware and software configuration information of the device, such as processor type, memory size, peripheral information, operating system version, network configuration, and application configuration. The signature block contains a digital signature for verifying the integrity of the firmware container, which is usually signed by a certification authority. The FW BLOB (Firmware Binary Large Object) module refers to a data format for storing firmware. In embedded systems and hardware devices, firmware is a program or software that controls hardware operations, which is stored in the internal memory of the device, such as flash memory. BLOB is used to represent a method for storing large amounts of binary data, and is often used in databases or storage systems. FW BLOB is used to package firmware into a large binary file for storage and update on the device.
[0059] Furthermore, the command container is composed of a series of independent command blocks, each of which contains command content and command tail. The command content part contains specific instruction operations, and the operation instructions configure memory, erase area, write data, configure operation status indication peripherals, load custom applets, etc. In order to ensure the safe execution of commands, the tail of each command block contains authentication information for verifying the next command. Only when the authentication conditions are met can the next command be correctly parsed and processed. The command container in the present invention effectively prevents the execution of illegal commands and ensures 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 a preset format.
[0061] In this embodiment, the command container detection module is used to locate and identify the command container in the off-chip serial flash memory. It detects at the corresponding offset address according to the erase granularity of the flash memory, and confirms its existence by analyzing the characteristics of the command container (such as a specific data structure, checksum or flag bit). Exemplarily, if the erase granularity of the off-chip serial flash memory is 4KB and the command container starting address is 0x10000, the detection module starts from 0x10000 and takes 4KB as a step size to check each erase block one by one to find predefined features, such as the "CMD_CONTAINER" byte sequence. If the feature is found, it is determined that the block contains a command container and its starting address is recorded.
[0062] In one embodiment of the present invention, 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 of a preset format includes: starting from the start address of the off-chip serial flash memory, taking the erase granularity of the off-chip serial flash memory as a step length, traversing the off-chip serial flash memory; comparing the data memory of the data block read in each traversal with the mass production burning container of 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 of 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 of the preset format, judging whether the 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 according to 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.
[0063] In this embodiment, the algorithm for comparing the data memory of the data block read each time with the mass-produced burning container of the preset format includes a byte-by-byte comparison algorithm or a feature code comparison algorithm. The byte-by-byte comparison algorithm directly compares each byte of the two data blocks, which is suitable for the case where the data block length is small, but the efficiency is low and it is sensitive to data. The feature code comparison algorithm compares by calculating the feature code of the data block, for example, using CRC check code, MD5 or SHA-256 hash algorithm, which can quickly compare larger data blocks.
[0064] In this embodiment, the user is allowed to flexibly set the erase range according to needs without being restricted by a fixed size. This flexible erasing method, combined with the search results (block-aligned area) for erasing, can achieve efficient erasing operations. However, the existing system design has limitations, and it is mandatory to parse and execute mass production operations from a fixed 4KB offset of the off-chip flash memory, resulting in the flash memory only being erased at a granularity less than or equal to 4KB. This design limits the possibility of using a larger erase granularity to improve the erase efficiency. For example, when it is necessary to erase 64KB of flash memory space, 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 The present invention shows a flowchart of the detection and verification of the mass production burning container detection module in one embodiment of the present invention. When the on-chip startup code is powered on and starts to execute, it first checks whether the trigger conditions for detection and verification are met. If the trigger conditions are met, the characteristics of the mass production burning container are searched in sequence according to the FLASH block size. If the characteristics of the mass production burning container are detected, the firmware container header in the mass production burning container is loaded and verified. If the verification is passed, the command container processing sub-process is entered, otherwise the mass production process is exited. If the characteristics of the mass production burning container are not detected, it is further determined whether the end of the flash memory has been reached. If the end of the flash memory has been reached, the mass production process is exited, otherwise the access offset is increased according to the FLASH block size.
[0066] Security algorithm verification unit 103: The security algorithm software and hardware unit is respectively connected to the command container detection processing unit and the command container processing unit for communication. The security algorithm software and hardware 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 detection processing unit.
[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 security hash algorithm module.
[0068] In this embodiment, the digital signature verification module verifies the integrity and source of the off-chip data by verifying the digital signature based on the principle of public key cryptography. The process of digital signature verification 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 to be complete and comes from a legitimate source. The off-chip serial flash memory is used to sign the data using a private key to generate a digital signature, and the on-chip boot code uses the public key of the off-chip serial flash memory to verify the digital signature. If the verification is successful, it means 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 to ensure the security of off-chip data transmission. The verification process of the symmetric encryption and decryption module includes: encrypting off-chip data using a key, and decrypting the encrypted data using the same key. If the decryption is successful, it is considered that the data has not been stolen or tampered with. The 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 the summary of the off-chip data for verifying the integrity of the data. The verification process of the secure hash algorithm module includes: calculating the hash value of the off-chip data, and comparing the calculated hash value with the stored hash value. If the two hash values are the same, it is considered that the data has not been tampered with. The hash algorithm is used to convert data of any length into a hash value of fixed length. Even if the data changes slightly, its hash value will change greatly. The hash value can be used to verify the integrity of the data.
[0071] Command container processing unit 104: The command container detection processing unit is respectively connected to the security algorithm hardware and software unit and the on-chip module for communication. The command container detection 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 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.
[0073] In one embodiment of the present invention, the command container parsing module is used to parse various commands stored in the command container, and execute corresponding actions in sequence according to the parsing results, such as erasing flash memory or lighting up an error indicator. The module first parses the received command, determines the type and parameters of the command, and then performs the corresponding function according to the required operation. During the execution process, the module pays attention to the order and conditions of execution to ensure that the user's intention is correctly reflected. This design can ensure that the on-chip module responds appropriately to various events in different states, thereby improving the stability and reliability of the system.
[0074] In one embodiment of the present invention, the timer trigger engine is used to execute user-defined operations at regular intervals, and can automatically perform certain actions within a specific time interval, such as flashing an indicator light during operation. This module sets a timer to periodically perform specific tasks according to the user's preset time interval, thereby improving the dynamic response capability and interactivity of the on-chip module. The user can adjust the timer settings as needed, such as modifying the flashing frequency or duration, to achieve personalized functions.
[0075] In one embodiment of the present invention, the configuration saving and triggering module is used to save the action sequence and trigger conditions indicated in the mass production program. This means that when configuring the device, the user can set various behavior specifications, such as the pin corresponding to the indicator light, the flashing frequency, etc. Whenever the device is started or reset, the module will quickly restore to the previous state according to the saved configuration, thereby ensuring consistency and stability. Preferably, the module also provides a simple interface so that the user will not be confused during the configuration process, and can easily manage and update the action sequence and trigger conditions.
[0076] In one embodiment of the present invention, the memory read / write module is used for erasing, reading and writing operations of an on-chip memory module or an external serial flash memory. The module supports multiple memories, ensures secure access to data, and effectively manages memory resources. During the reading and writing process, the module must handle multiple states, such as busy waiting, error handling, etc., to ensure data consistency and accuracy, so as to achieve 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 the mini-program specified by it, providing a high degree of flexibility and scalability. Users can write and upload mini-programs according to their needs, which can complete specific tasks or interact with other parts of the system. Before executing the mini-program, the module will perform security and compatibility checks on it to prevent potential errors or security vulnerabilities. This design not only improves the customizability of the system, but also enables the system to quickly adapt to changing needs and application scenarios.
[0078] Furthermore, through the custom command interactive execution module, the on-chip module can implement a variety of small programs with functions to meet different application requirements. For example, the LED control applet controls the state of the LED through serial port commands, including functions such as on, off and flashing. The temperature monitoring and alarm applet reads the temperature sensor data in real time and triggers an alarm when the temperature exceeds the set threshold. The data recording and storage applet regularly collects environmental sensor data and stores it for subsequent analysis. Through the serial port command parsing and execution applet, users can send custom commands, and the system parses and executes the corresponding operations. The real-time clock and timed wake-up applet maintains time accuracy and has a timed wake-up function in a low-power state. The custom task scheduling applet performs a series of operations according to the user-set strategy, such as regularly enabling the device or collecting data. The simple user interaction interface applet provides a basic input interface for easy adjustment of the device status. The remote firmware update applet supports receiving and burning new firmware over the network to optimize the device update process. These applets 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 an interface implemented based on the JESD216 standard, which supports the mainstream off-chip serial flash memory (Serial NOR) on the market. The design of this interface is to provide a unified operation method, so that developers can 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 various types of flash memory without considering the specific hardware implementation details, thereby saving development time and cost. This interface can improve the overall performance and stability of the system while meeting market demand. Among them, JESD216 refers to the standard for serial NOR flash memory formulated by JEDEC (Solid State Technology Association), which aims to standardize the interface and performance characteristics of flash memory and promote market unification and compatibility.
[0080] In one embodiment of the present invention, the process of the command container detection 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, judging 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.
[0081] In one embodiment of the present invention, the process of mass production burning of the on-chip module in cooperation 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, and has multiple key functions to ensure the safety and efficiency of the device during mass production. First, the on-chip boot program is digitally signed by 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 starts, the PA10 pin in the on-chip module is set as a running indicator light through 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, in order to promptly feedback problems that may occur during mass production, the PA11 pin is set as a mass production failure indicator. If a failure occurs, the pin is set to flash once every 500 milliseconds to remind the user of a failure in the burning process. Subsequently, the on-chip boot program will execute the erase and burn of the user program to the 4KB offset of the off-chip flash memory to ensure that the user program is loaded correctly.
[0083] Figure 5 The flowchart of the command container processing process in one embodiment of the present invention is shown. 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. Each command block contains command content and command tail, where the command tail contains relevant information of the next command. To further improve security. The parsed command block content includes configuration operation status indication, configuration memory, erase memory, write memory, load operation definition instructions (program) and reset. And after the current command block is executed, it is determined whether the tail of the mass production burning container has been reached. If it has reached the tail, the current mass production process is completed, otherwise the next command block is loaded and verified. If it fails to pass the verification, the current mass production program 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 lifecycle-related code to effectively manage the device's life cycle and ensure its stable operation. After completing the security settings, the on-chip boot program will load a special chip definition instruction that configures the UART and communicates with the mass production machine to achieve the burning of the product serial number. When the serial number entry is completed, the program will return 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] Further, the command block for burning the on-chip module includes the following operations: configure the running status indication to confirm whether the module has been successfully started and is working properly, such as lighting an LED light 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 stored and read correctly. Erase the memory to restore the memory to its initial state to make room for new programs and data. Write to 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 instruction (program) to load the program code into the module's memory so that it can run the program. Reset to reset the module to its initial state, clear the internal status register, and stop the program from running so that a new burning operation can be performed.
[0086] It should be understood that the division of units and modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0087] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" represent examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0088] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" 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: A exists alone, A and B exist at the same time, and B exists 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" or similar expressions refers to any combination of these items, including any combination of single 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 1 is a flow chart of a method for mass producing a serial flash memory provided in an embodiment of the present application, wherein the method is applied to an on-chip microcontroller. Figure 6 As shown, the method comprises the following steps:
[0090] Step S61: constructing 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 passing the data security verification operation, 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 each process step executing the above corresponding steps has been described in detail in the above-mentioned embodiment of the on-chip microcontroller, and for the sake of brevity, it will not be repeated here.
[0094] Figure 7 The interactive process diagram of an embodiment of a mass production system based on serial flash memory 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 interactive 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 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 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.
[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, the 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, and further improves the reliability of the overall system and user experience.
[0097] It should be understood that the specific process of each process step executing the above corresponding steps has been described in detail in the above-mentioned embodiment of the on-chip microcontroller, and for the sake of brevity, it will not be repeated here.
[0098] The terms "component", "module", "system", etc. used in this specification are used to represent 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 applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).
[0099] Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0100] Those skilled in the art can 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 the present 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 only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[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 by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When loading and executing computer program instructions (programs) on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. Available media may 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 disks (SSDs)).
[0105] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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 safety of mass-production burning of on-chip modules. Through the on-chip microcontroller and its on-chip startup code, efficient and safe mass production of products 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 also support user-defined instructions to meet more complex mass production requirements; and it has a built-in secure startup and encryption mechanism to ensure the security of the burning process and the confidentiality of data. Thereby effectively improving production efficiency, ensuring product safety, and meeting more complex mass production requirements. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.
[0107] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A mass-produced on-chip microcontroller based on serial flash memory, characterized in that: The on-chip microcontroller comprises: Serial flash memory controller: the serial flash memory controller is in communication connection 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; A command container detection unit: the command container detection unit is respectively connected to the off-chip serial flash memory and the security algorithm verification unit in communication; the command container detection unit is used to detect whether a mass production burning container with preset characteristics is included in the off-chip serial flash memory, and when a mass production burning container with preset characteristics is detected, the mass production burning container is read, and the mass production burning container is sent to the security algorithm verification unit; Security algorithm verification unit: the security algorithm software and hardware unit is respectively connected to the command container detection processing unit and the command container processing unit for communication, the security algorithm software and hardware 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 detection processing unit; Command container processing unit: The command container detection processing unit is respectively connected to the security algorithm hardware and software unit and the on-chip module for communication. The command container detection 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 2, characterized in that: The process of the command container detection unit detecting whether the off-chip serial flash memory contains a mass production burning container of 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 of a preset format.
4. The mass-produced on-chip microcontroller based on serial flash memory according to claim 3, characterized in that: Based on the erase granularity of the off-chip serial flash memory, the process of 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 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 the step length; the data memory of the data block read in each traversal is compared with the mass production burning container of the preset format; In response to the data memory of the read data block being consistent with the mass production burning container characteristics of 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 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 continues; otherwise, the current mass production process is exited.
5. 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.
6. The mass-produced on-chip microcontroller based on serial flash memory according to claim 1, characterized in that: The command container processing unit includes: 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 or more.
7. The mass-produced on-chip microcontroller based on serial flash memory according to claim 2, characterized in that: The process of the command container detection 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 the current command block in the command container of the mass production burning container passing the verification, the command content of the current command block is parsed, the 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 tail of the mass production burning container has been reached; if the mass production tail of the mass production burning container has been reached, the mass production task is completed; if the mass production tail 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 repeatedly executed.
8. The mass-produced on-chip microcontroller based on serial flash memory according to claim 1, characterized in that: 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; Based on the 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 access sequence and access parameters of the serial flash memory controller, a universal off-chip flash memory read and write application is used to configure the interface of the off-chip serial flash memory to access the off-chip serial flash memory.
9. A mass production method based on serial flash memory, characterized in that: The method is applied to an on-chip microcontroller, and the method comprises: Establishing 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 the mass production burning container with preset characteristics is detected; A data security verification operation is performed on the mass production burning container, and after the data security verification operation is passed, a burning operation is performed on the on-chip module based on the mass production burning container.
10. A mass production system based on serial flash memory, characterized in that: The system includes an off-chip serial flash memory, an on-chip microcontroller and an on-chip module, 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 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
Flash memory storage system for simulating rewritable disc device, flash memory controller, computer system, and method thereof
US20110145480A1
Processing commands according to authorization
US8332931B1
Cited By
Method and system for recovering long-term storage failure of mobile terminal
CN121210211A
