Method for making eMMC mirror image for soc heterogeneous architecture
By dividing, filling and splicing the eMMC image of the soc heterogeneous architecture chip, the problem of inefficient writing data in the existing technology is solved, and good independent management and data efficiency of the soc heterogeneous architecture chip are achieved.
Patent Information
- Application Number
- CN202411915285.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-05-16
AI Technical Summary
The prior art is difficult to reasonably divide and configure the areas of each core program in the soc heterogeneous architecture chip on the memory, resulting in inefficient writing data.
By creating an eMMC image of empty data, it is divided into a boot partition image and a userdata partition image, and data filling and splicing of each partition image is respectively formed to form a complete eMMC image.
It realizes good independent management of soc heterogeneous architecture chips, reasonably divides and configures various core program areas, and improves the efficiency of writing data.
Smart Images

Figure CN120010763A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image production, and in particular to a method for producing an eMMC image for a soc heterogeneous architecture. Background Art
[0002] Traditional microprocessor chips cannot meet the increasing functional requirements of automobiles, so heterogeneous architecture chips of soc (system on chip) are born. While ensuring that regulatory-related functions run on MCU, more complex functions run on soc. In order to cooperate with the heterogeneous architecture of soc, the layout and burning of corresponding programs and resources on eMMC (Embedded Multi MediaCard, embedded memory standard specification) need to be designed.
[0003] With respect to the Soc heterogeneous architecture, how to reasonably divide and configure the memory area of each core program is a problem that the existing technology needs to solve. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the present invention provides a method for making eMMC mirroring for soc heterogeneous architecture, has good independent management for the partition design in the soc heterogeneous architecture chip, reasonably divides and configures the area of each core program on the memory, and improves the efficiency of writing data.
[0005] According to a first aspect of the present invention, a method for making an eMMC image for a soc heterogeneous architecture is provided, comprising: Step 1, create an eMMC image with empty data; Step 2, dividing the eMMC image into a boot partition image and a userdata partition image, wherein the boot partition image is empty data, and the userdata partition image includes: a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data; Step 3, respectively filling data into the boot partition image, GPT partition image, MCU partition image, OS system partition image and OS application partition image; Step 4, splicing the data-filled GPT partition image, MCU partition image, OS system partition image and OS application partition image as the userdata partition image, and using the userdata partition image and the data-filled boot partition image as the produced eMMC image.
[0006] Based on the above technical solution, the present invention can also make the following improvements.
[0007] Optionally, after step 1, the step further includes: dividing the eMMC into a boot partition and a userdata partition; dividing the userdata partition into a GPT partition, an MCU partition, an OS system partition, and an OS application partition; and the process of partitioning the userdata partition includes: Use the losetup command to set up a loop device and virtualize the userdata partition into a block device; Use the parted command to construct the OS system partition and OS application partition, and use the mkfs.ext4 command to format the OS system partition and OS application partition. At this time, the GPT partition will be generated synchronously.
[0008] Optionally, step 3 includes: Writing the bootloader program into the boot partition image with empty data to obtain the boot partition image with valid data; Write the MCU rtos and application program into the MCU partition image with empty data to obtain the MCU partition image with valid data; After mounting the OS system partition image with empty data, copying the file system data to the OS system partition image to obtain the OS system partition image with valid data; After the OS application partition image with empty data is mounted, the application program and resource data are copied to the OS application partition image with empty data through the copy command to obtain the OS application partition image with valid data.
[0009] Optionally, step 4 further includes: The gap between any two partitions in the userdata partition image is filled with 0 data to obtain a complete userdata partition image.
[0010] Optionally, after step 4, the following steps may be further performed: Step 5: Use the LZ4 compression algorithm to compress the boot partition image and the userdata partition image respectively to obtain a compressed boot partition image and a compressed userdata partition image.
[0011] Optionally, after step 4, the following steps may be further performed: Step 6, asymmetrically encrypt the boot partition image and the userdata partition image, and splice the public key and secret key into the compressed partition image header, and store the private key and secret key into the image burning program.
[0012] Optionally, after step 4, the following steps may be further performed: Step 7: Burn the completed eMMC image to the firmware through the burning program.
[0013] According to a second aspect of the present invention, there is provided a system for making an eMMC image for a soc heterogeneous architecture, comprising: a creation module, an eMMC image partitioning module, a data filling module and a splicing module; The creation module is used to create an eMMC image with empty data; The eMMC image partitioning module is used to divide the eMMC image into a boot partition image and a userdata partition image, wherein the boot partition image is empty data, and the userdata partition image includes: a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data; The data filling module is used to fill data for the boot partition image, the GPT partition image, the MCU partition image, the OS system partition image and the OS application partition image respectively; The splicing module is used to splice the GPT partition image, MCU partition image, OS system partition image and OS application partition image filled with data as the userdata partition image, and use the userdata partition image and the boot partition image filled with data as the produced eMMC image.
[0014] According to a third aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the processor is used to implement the steps of a method for making an eMMC image for a soc heterogeneous architecture when executing a computer management program stored in the memory.
[0015] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer management program is stored. When the computer management program is executed by a processor, the steps of a method for making an eMMC image for a soc heterogeneous architecture are implemented.
[0016] The present invention provides a method, system, electronic device and storage medium for making eMMC images for soc heterogeneous architecture, which has good independent management for the partition design in the soc heterogeneous architecture chip, that is, it takes into account different processor cores and integrates them well. In addition, there is a foresighted design for the safety authentication mechanism in the automotive field and the upgrade management of the later car factory, which is convenient for future functional expansion. At the same time, with the method of burning to the memory, the optimized eMMC burning process simplifies the burning steps and improves the efficiency of writing data for R&D personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of a method for making an eMMC image for a soc heterogeneous architecture provided by the present invention; Figure 2 A flowchart of an embodiment of a method for making an eMMC image for a soc heterogeneous architecture provided by the present invention; Figure 3 A flowchart of an embodiment of the compression and burning process in a method for making an eMMC image for a soc heterogeneous architecture provided by the present invention; Figure 4 A schematic diagram of eMMC partitions provided in an embodiment of the present invention; Figure 5 A structural block diagram of making an eMMC image for a soc heterogeneous architecture provided by the present invention; Figure 6 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention; Figure 7 A schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0018] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0019] Figure 1 The present invention provides a method flow chart for making eMMC images for soc heterogeneous architectures, such as Figure 1 As shown, the method includes: Step 1: Create an eMMC image with empty data.
[0020] In the specific implementation, an eMMC image with empty data is created according to the eMMC hardware specifications through the Linux built-in dd command.
[0021] Step 2, divide the eMMC image into a boot partition image and a userdata partition image, the boot partition image is empty data, and the userdata partition image includes: a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data.
[0022] In the specific implementation, according to the partition configuration table, the GPT partition, MCU partition, OS system partition, and OS application partition in the userdata partition image are exported as independent partition images through the dd command provided by Linux.
[0023] Step 3, respectively fill the boot partition image, GPT partition image, MCU partition image, OS system partition image and OS application partition image with data.
[0024] Step 4: splice the GPT partition image filled with data, the MCU partition image, the OS system partition image, and the OS application partition image as the userdata partition image, and use the userdata partition image and the boot partition image filled with data as the produced eMMC image.
[0025] In the specific implementation, the boot partition of valid data is used as a partition image alone, and no processing is required. According to the offset of the partition configuration table, the GPT partition image, the MCU partition image, the OS system partition image and the OS application partition image are spliced as the userdata partition image.
[0026] The present invention provides a method for making an eMMC mirror for a soc heterogeneous architecture, which has good independent management for the partition design in the soc heterogeneous architecture chip, reasonably divides and configures the area of each core program on the memory, and improves the efficiency of writing data.
[0027] Example 1 Embodiment 1 provided by the present invention is an embodiment of a method for making an eMMC image for a soc heterogeneous architecture provided by the present invention, such as Figure 2 and Figure 3 The flowcharts of the embodiments of the method for making an eMMC image for a soc heterogeneous architecture provided by the present invention, the compression and burning processes are respectively Figure 1-Figure 3 It can be seen that the embodiment of the method includes: Step 1: Create an eMMC image with empty data.
[0028] In a possible implementation manner, after step 1, the following steps are further included: dividing the eMMC into a boot partition and a userdata partition; dividing the userdata partition into a GPT partition, an MCU partition, an OS system partition, and an OS application partition; and the process of partitioning the userdata partition includes: Use the losetup command to set up a loop device and virtualize the userdata partition into a block device.
[0029] Use the parted command to construct the OS system partition and OS application partition, and use the mkfs.ext4 command to format the OS system partition and OS application partition. At this time, the GPT partition will be generated synchronously.
[0030] In specific implementation, Figure 4The eMMC partition diagram provided by the embodiment of the present invention is shown in FIG. Figure 4 It can be seen that the boot partition does not need additional processing. Only the userdata partition needs to be replanned. According to the partition configuration table, use the Linux built-in losetup command, parted command, and mkfs.ext4 command to partition.
[0031] Step 2, divide the eMMC image into a boot partition image and a userdata partition image, the boot partition image is empty data, and the userdata partition image includes: a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data.
[0032] Step 3, respectively fill the boot partition image, GPT partition image, MCU partition image, OS system partition image and OS application partition image with data.
[0033] In a possible implementation manner, step 3 includes: Write the bootloader program into the boot partition image with empty data to obtain the boot partition image with valid data.
[0034] Write the MCU rtos and application program into the MCU partition image with empty data to obtain the MCU partition image with valid data.
[0035] After mounting the OS system partition image with empty data, copy the file system data to the OS system partition image to obtain the OS system partition image with valid data.
[0036] After mounting the OS application partition image with empty data, use the copy command to copy the application program and resource data to the OS application partition image with empty data, and obtain the OS application partition image with valid data.
[0037] In the specific implementation, the boot partition with empty data does not need to be mounted, and the boot image is directly written into the boot partition bit by bit. The bootloader program is written into the boot partition with empty data through the dd command provided by Linux, thereby becoming a boot partition image with valid data.
[0038] When the userdata partition is constructed according to the partition configuration table, the GPT partition table group information is automatically generated. Therefore, when the GPT partition is exported, it is a GPT partition image with valid data, and the GPT partition does not need to be processed.
[0039] The MCU partition with empty data does not need to be mounted, and the MCU image can be directly written into the MCU partition bit by bit. Through the dd command provided by Linux, the MCU rtos and application programs can be written into the MCU partition with empty data, thus becoming the MCU partition image with valid data.
[0040] After mounting the empty OS system partition through the mount command provided by Linux, the file system is copied to the empty OS system partition through the copy command, thus becoming an OS system partition image with valid data.
[0041] After mounting the empty data OS application partition, transfer the application and resource data to the OS application partition by copying, and it becomes an OS application partition image with valid data. After mounting the empty data OS application partition by using the mount command provided by Linux, copy the application and resource data to the empty data OS application partition by using the copy command, and it becomes an OS application partition image with valid data.
[0042] Step 4: splice the GPT partition image filled with data, the MCU partition image, the OS system partition image, and the OS application partition image as the userdata partition image, and use the userdata partition image and the boot partition image filled with data as the produced eMMC image.
[0043] In a possible implementation manner, step 4 further includes: Fill the gaps between any two partitions in the userdata partition image with 0 data and splice them together to get a complete userdata partition image.
[0044] In a specific implementation, according to the partition configuration table, the security authentication area between two partitions is filled with data 0.
[0045] In a possible embodiment, step 4 further includes: Step 5: Use the LZ4 compression algorithm to compress the boot partition image and the userdata partition image respectively to obtain a compressed boot partition image and a compressed userdata partition image.
[0046] In the specific implementation, a third-party software package LZ4 is installed on Linux to compress the boot partition image and the userdata partition image respectively.
[0047] In a possible embodiment, step 4 further includes: Step 6: Asymmetrically encrypt the boot partition image and the userdata partition image, concatenate the public key and the private key into the compressed partition image header, and store the private key in the image burning program.
[0048] In a possible embodiment, step 4 further includes: Step 7: Burn the completed eMMC image to the firmware through the burning program.
[0049] In a specific implementation, the burning process can be: the PC is connected to the USB port of the development board through tty, enters the USB burning mode, uses the image burning program, and burns through USB; the image burning program decrypts the compressed partition image according to asymmetric encryption; the image burning program decompresses the decrypted partition image with LZ4, and then writes it into the development board storage device.
[0050] Example 2 Embodiment 2 provided by the present invention is an embodiment of the present invention for manufacturing an eMMC mirror system for a soc heterogeneous architecture. Figure 5 A structural diagram of an eMMC mirroring system for a soc heterogeneous architecture provided by an embodiment of the present invention, combined with Figure 5 It can be seen that the embodiment of the system includes: a creation module, an eMMC image partitioning module, a data filling module and a splicing module.
[0051] Create a module to create an eMMC image with empty data.
[0052] The eMMC image partitioning module is used to divide the eMMC image into a boot partition image and a userdata partition image. The boot partition image is empty data. The userdata partition image includes: a GPT partition image with valid data, an MCU partition image with empty data, an OS system partition image with empty data, and an OS application partition image with empty data.
[0053] The data filling module is used to fill data into the boot partition image, GPT partition image, MCU partition image, OS system partition image and OS application partition image respectively.
[0054] The splicing module is used to splice the GPT partition image, MCU partition image, OS system partition image and OS application partition image filled with data as the userdata partition image, and use the userdata partition image and the boot partition image filled with data as the produced eMMC image.
[0055] It can be understood that the system for making eMMC images for soc heterogeneous architecture provided by the present invention corresponds to the method for making eMMC images for soc heterogeneous architecture provided by the aforementioned embodiments. The relevant technical features of the system for making eMMC images for soc heterogeneous architecture can refer to the relevant technical features of the method for making eMMC images for soc heterogeneous architecture, which will not be repeated here.
[0056] See also Figure 6 , Figure 6 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 6 As shown, an embodiment of the present invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, the following steps are implemented: creating an eMMC image with empty data; dividing the eMMC into a boot partition and a userdata partition; dividing the userdata partition into a GPT partition, an MCU partition, an OS system partition, and an OS application partition; dividing the eMMC image into a boot partition image with empty data, a GPT partition image with valid data, an MCU partition image with empty data, an OS system partition image with empty data, and an OS application partition image with empty data; filling data in each partition image of the userdata partition and the boot partition image respectively; treating the boot partition image as a partition image alone; and splicing the GPT partition image, MCU partition image, OS system partition image, and OS application partition image filled with data as a userdata partition image.
[0057] See also Figure 7 , Figure 7 Schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Figure 7As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, the following steps are implemented: creating an eMMC image of empty data; dividing the eMMC into a boot partition and a userdata partition; dividing the userdata partition into a GPT partition, an MCU partition, an OS system partition, and an OS application partition; dividing the eMMC image into a boot partition image of empty data, a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data; filling data in each partition image of the userdata partition and the boot partition image respectively; treating the boot partition image as a partition image alone; and splicing the GPT partition image, MCU partition image, OS system partition image, and OS application partition image filled with data as a userdata partition image.
[0058] The embodiments of the present invention provide a method, system, electronic device and storage medium for making eMMC images for SOC heterogeneous architectures, which have good independent management for the partition design in SOC heterogeneous architecture chips, that is, different processor cores are taken into account and are also well integrated. In addition, there is a foresighted design for the safety authentication mechanism in the automotive field and the upgrade management of the later car factory, which is convenient for future functional expansion. At the same time, with the method of burning to the memory, the optimized eMMC burning process simplifies the burning steps and improves the efficiency of writing data for R&D personnel.
[0059] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0060] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0061] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0062] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0064] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0065] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for making eMMC images for soc heterogeneous architectures, characterized in that: The method comprises: Step 1, create an eMMC image with empty data; Step 2, dividing the eMMC image into a boot partition image and a userdata partition image, wherein the boot partition image is empty data, and the userdata partition image includes: a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data; Step 3, respectively filling data into the boot partition image, GPT partition image, MCU partition image, OS system partition image and OS application partition image; Step 4, splicing the GPT partition image, MCU partition image, OS system partition image and OS application partition image filled with data as the userdata partition image, and using the userdata partition image and the boot partition image filled with data as the produced eMMC image.
2. The method according to claim 1, characterized in that: After step 1, the following steps are further included: dividing the eMMC into a boot partition and a userdata partition; dividing the userdata partition into a GPT partition, an MCU partition, an OS system partition, and an OS application partition; and the process of partitioning the userdata partition includes: Use the losetup command to set up a loop device and virtualize the userdata partition into a block device; Use the parted command to construct the OS system partition and OS application partition, and use the mkfs.ext4 command to format the OS system partition and OS application partition. At this time, the GPT partition will be generated synchronously.
3. The method according to claim 1, characterized in that The step 3 comprises: Writing the bootloader program into the boot partition image with empty data to obtain the boot partition image with valid data; Write the MCU rtos and application program into the MCU partition image with empty data to obtain the MCU partition image with valid data; After mounting the OS system partition image with empty data, copying the file system data to the OS system partition image to obtain the OS system partition image with valid data; After the OS application partition image with empty data is mounted, the application program and resource data are copied to the OS application partition image with empty data through the copy command to obtain the OS application partition image with valid data.
4. The method according to claim 1, characterized in that The step 4 also includes: The gap between any two partitions in the userdata partition image is filled with 0 data to obtain a complete userdata partition image.
5. The method according to claim 1, characterized in that After step 4, the following steps are also included: Step 5: Use the LZ4 compression algorithm to compress the boot partition image and the userdata partition image respectively to obtain a compressed boot partition image and a compressed userdata partition image.
6. The method according to claim 1, characterized in that After step 4, the following steps are also included: Step 6, asymmetrically encrypt the boot partition image and the userdata partition image, and splice the public key and secret key into the compressed partition image header, and store the private key and secret key into the image burning program.
7. The method according to claim 1, characterized in that After step 4, the following steps are also included: Step 7: Burn the completed eMMC image to the firmware through the burning program.
8. A system for making eMMC images for soc heterogeneous architectures, characterized in that: The system includes: a creation module, an eMMC image partitioning module, a data filling module and a splicing module; The creation module is used to create an eMMC image with empty data; The eMMC image partitioning module is used to divide the eMMC image into a boot partition image and a userdata partition image, wherein the boot partition image is empty data, and the userdata partition image includes: a GPT partition image of valid data, an MCU partition image of empty data, an OS system partition image of empty data, and an OS application partition image of empty data; The data filling module is used to fill data for the boot partition image, the GPT partition image, the MCU partition image, the OS system partition image and the OS application partition image respectively; The splicing module is used to splice the GPT partition image, MCU partition image, OS system partition image and OS application partition image filled with data as the userdata partition image, and use the userdata partition image and the boot partition image filled with data as the produced eMMC image.
9. An electronic device, characterized in that: It includes a memory and a processor, and the processor is used to implement the steps of the method for making an eMMC image for a soc heterogeneous architecture as described in any one of claims 1 to 7 when executing a computer management program stored in the memory.
10. A computer-readable storage medium, characterized in that: A computer management program is stored thereon, and when the computer management program is executed by a processor, the steps of the method for making an eMMC image for a soc heterogeneous architecture as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Memory chip mirror image manufacturing method and device
CN120653325A