Jetson module flashing method, system, device and storage medium
By making offline flash packages and using Linux boot disk for USB boot, the complex and time-consuming problem of Jetson module flashing in the existing technology is solved, and a more efficient flashing process is achieved.
Patent Information
- Application Number
- CN202210603809.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In the prior art, the Jetson module flashing method requires the use of a host that installs a Linux system, and the flashing process is complicated, time-consuming and labor-intensive, affecting efficiency.
By obtaining the kernel image file and device tree file, making an offline flash package, and using the Linux boot disk to start the host in USB, enter the Linux environment, and performing the flash operation of the Jetson module.
The flashing process of Jetson module is simplified, the steps of preparing the Linux system host are avoided, and the flashing efficiency is improved, saving time and effort.
Smart Images

Figure CN114995902B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of server technology, and in particular to a Jetson module flashing method, system, device and storage medium. Background Art
[0002] With the development of the Internet of Things and AI chips, more and more data are processed on the edge. The edge platform needs greater flexibility to support constantly updated models and ensure the real-time performance of pre- and post-inference functions and performance impact analysis during inference.
[0003] NVIDIA's Jetson module is designed for scenarios such as robots, autonomous machines, medical equipment, and embedded edge computing, bringing unlimited possibilities to edge computing. However, the Jetson module needs to be upgraded. When the Jetson module is upgraded or needs to be re-flashed, the existing method of reinstalling the Jetson module can only be in accordance with NVIDIA's official documents. The Jetson module only supports the Linux system. Therefore, when flashing the Jetson module, an additional host with a Linux system installed is required. If there is no host with a Linux system, the host needs to be reinstalled with the Linux system, which will delete the data in the host's hard disk. Therefore, the existing method of flashing the Jetson module is inconvenient, time-consuming and labor-intensive. Summary of the invention
[0004] Based on this, it is necessary to provide a Jetson module flashing method, system, computer device and storage medium that can improve the flashing efficiency in response to the above technical problems.
[0005] On the one hand, a Jetson module flashing method is provided, and the Jetson module flashing method comprises:
[0006] Obtain kernel image files and device tree files according to the preset kernel configuration file;
[0007] In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file;
[0008] After the Jetson module's flash verification is passed, make the kernel image file and device tree file into an offline flash package;
[0009] Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host;
[0010] Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
[0011] In one of the embodiments, before obtaining the kernel image file and the device tree file according to the preset kernel configuration file, the method further includes:
[0012] Get the Jetson driver package, root file system package, and development environment package;
[0013] Execute the environment script to generate the Jetson module development environment according to the Jetson driver package, root file system package, and development environment package.
[0014] In one embodiment, the step of obtaining a kernel image file and a device tree file according to a preset kernel configuration file includes:
[0015] Obtain the kernel source code package, and obtain the kernel configuration file based on the kernel source code package;
[0016] Configure the kernel configuration file and compile it to generate a new kernel image file and device tree file;
[0017] Replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file.
[0018] In one embodiment, the flashing verification of the Jetson module according to the kernel image file and the device tree file in the Jetson module development environment includes:
[0019] Execute the verification script to verify the new kernel image file and device tree file in the Jetson module development environment.
[0020] In one embodiment, after the flash verification of the Jetson module is passed, the kernel image file and the device tree file are made into an offline flash package, including:
[0021] After the flash verification is passed, execute the flash package script to obtain the offline flash package based on the new kernel image file and device tree file.
[0022] In one embodiment, storing the offline flash package to a Linux boot disk includes:
[0023] Start the Linux system boot disk tool, receive the USB disk and Linux system image file selected by the user, and create a Linux boot disk;
[0024] Create a second partition for the Linux boot disk and store the offline flash package of the Jetson module in the second partition of the Linux boot disk.
[0025] In one embodiment, the method of starting the host in USB mode, allowing the host to enter the Linux environment through a Linux boot disk, and flashing the Jetson module using an offline flashing package in the Linux environment includes:
[0026] Receive the host boot mode set by the user, boot the host in USB mode, so that the host enters the Linux environment through the Linux boot disk;
[0027] In the Linux environment, use the offline flashing package of the Jetson module to flash the Jetson module.
[0028] On the other hand, a Jetson module flashing system is provided, and the Jetson module flashing system includes:
[0029] A file acquisition module, used to acquire kernel image files and device tree files according to a preset kernel configuration file;
[0030] Flash verification module, used to verify the flash of Jetson module according to kernel image file and device tree file in Jetson module development environment;
[0031] Flash package generation module, used to make kernel image files and device tree files into offline flash packages;
[0032] The Jetson flashing module is used to start the host via USB, enable the host to enter the Linux environment through the Linux boot disk, and flash the Jetson module using the offline flashing package in the Linux environment.
[0033] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0034] Obtain kernel image files and device tree files according to the preset kernel configuration file;
[0035] In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file;
[0036] After the Jetson module's flash verification is passed, make the kernel image file and device tree file into an offline flash package;
[0037] Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host;
[0038] Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
[0039] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a processor, the processor performs the following steps:
[0040] Obtain kernel image files and device tree files according to the preset kernel configuration file;
[0041] In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file;
[0042] After the Jetson module's flash verification is passed, make the kernel image file and device tree file into an offline flash package;
[0043] Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host;
[0044] Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
[0045] The above technical solution of the present invention has the following advantages compared with the prior art:
[0046] The above-mentioned Jetson module flashing method, system, computer equipment and storage medium prepare an offline package according to the files required for flashing the Jetson module; use the boot disk tool and the U disk to prepare a Linux boot disk; store the offline flashing package in the Linux boot disk, connect the Linux boot disk to the host, and build a flashing tool in a Linux environment, namely, the Linux flashing tool; connect the Jetson module to the host, start the host in USB mode through the Linux flashing tool, the host enters the Linux environment in the Linux boot disk through the Linux boot disk, and the host flashes the Jetson module according to the official operation in the Linux environment in the Linux boot disk, and no longer needs to prepare a host with a Linux system, which saves time and effort, simplifies the flashing process of the Jetson module, and improves the flashing efficiency of the Jetson module. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 This is a first method flow chart of the Jetson module flashing method of the present invention;
[0049] Figure 2 It is a second method flow chart of the Jetson module flashing method of the present invention;
[0050] Figure 3 It is a system structure diagram of the Jetson module flashing system of the present invention;
[0051] Figure 4 It is a device structure diagram of the computer device of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The Jetson module only supports Linux kernel systems and can only run on the Ubuntu operating system based on the Linux kernel. Therefore, when flashing the Jetson module in the prior art, the flashing operation must be performed in a Linux environment, so a host with a Linux operating system must be prepared. In actual scenarios, to prepare a host with a Linux operating system, a nearby Windows host must be reinstalled as a Linux system, which clears the hard disk data of the Windows host and destroys the original Windows operating system of the host. Therefore, the Jetson module flashing method in the prior art is extremely inconvenient, time-consuming and labor-intensive. In view of this problem, the present invention prepares an offline package according to the files required for flashing the Jetson module; uses a boot disk tool and a U disk to prepare a Linux boot disk; stores the offline flashing package in the Linux boot disk, connects the Linux boot disk to a host, and builds a flashing tool in a Linux environment, namely, a Linux flashing tool; connects the Jetson module to the host, starts the host in a USB mode through the Linux flashing tool, the host enters the Linux environment in the Linux boot disk through the Linux boot disk, and the host flashes the Jetson module according to official operations in the Linux environment in the Linux boot disk, and no longer needs to prepare a host with a Linux system, which saves time and labor, simplifies the flashing process of the Jetson module, and improves the flashing efficiency of the Jetson module.
[0054] Embodiment 1:
[0055] The Jetson module flashing method in this embodiment refers to Figure 1-2 As shown, Figure 1 This is a flow chart of the first method of the Jetson module flashing method of the present invention; Figure 2 This is a second method flow chart of the Jetson module flashing method of the present invention.
[0056] The method comprises the following steps:
[0057] Obtain kernel image files and device tree files according to the preset kernel configuration file;
[0058] The premise of entering the Linux environment through the Linux boot disk and flashing the Jetson module is to create an offline flashing package for the Jetson module. The offline flashing package needs to be configured according to the kernel configuration file (Kernel Configuration File, .config file) to configure the Jetson module according to the actual functional requirements. The configured kernel configuration file is called the preset kernel configuration file. After the functional requirements of the Jetson module are configured in the kernel configuration file, the preset kernel configuration file is obtained, and then the kernel image file (.image file) and the device tree file (.dtb file) are obtained according to the preset kernel configuration file, so as to facilitate the flashing verification of the Jetson module according to the kernel image file and the device tree file.
[0059] In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file;
[0060] After obtaining the kernel image file and device tree file according to the preset kernel configuration file, you need to verify the flashing of the Jetson module according to the kernel image file and the device tree file. The prerequisite for flashing verification is to enter the Jetson module development environment. Therefore, during the R&D stage, R&D personnel need to verify the flashing of the Jetson module according to the kernel image file and the device tree file in the Jetson module development environment in order to make the offline flashing package of the Jetson module.
[0061] After the flash verification of the Jetson module is passed, the kernel image file and device tree file are made into an offline flash package;
[0062] In the Jetson module development environment, perform flash verification on the Jetson module according to the kernel image file and device tree file. After the flash verification of the Jetson module passes, it means that the kernel image file and device tree file are normal. The kernel image file and device tree file can be made into an offline flash package, so that customers can flash the Jetson module through the Linux boot disk and the offline flash package of the Jetson module.
[0063] Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host;
[0064] After the offline flashing package is made, it is stored in the Linux boot disk. The Linux boot disk can allow the host to enter the Linux environment, and can also store the offline flashing package of the Jetson module. The Linux boot disk is made through a U disk, which is easy to carry, convenient, and easy to operate, and can effectively improve the flashing efficiency of the Jetson module. After the offline flashing package of the Jetson module is stored in the Linux boot disk, the Jetson module and the Linux boot disk can be connected to the host to start the host in USB mode, and the host can enter the Linux environment through the Linux boot disk, and the Jetson module can be flashed using the offline flashing package of the Jetson module in the Linux environment.
[0065] Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
[0066] The host, Linux boot disk, and Jetson module flashing package are built into a flashing tool. When flashing the Jetson module, these three elements are sufficient. After satisfying these three elements, connect the Linux boot disk to the host, then set the host's startup items, and start the host via USB, that is, the host starts through the Linux boot disk, and the host enters the Linux environment in the Linux boot disk. In the Linux environment, with the help of the Jetson module's offline flashing package, you can perform the flashing operation according to the NVIDIA official documentation. There is no need to prepare a Linux system host, which improves the flashing efficiency of the Jetson module. Of course, before executing the flashing of the Jetson module, the Jetson module needs to be connected to the host for communication.
[0067] In one embodiment, before obtaining the kernel image file and the device tree file according to the preset kernel configuration file, the method further includes:
[0068] Get the Jetson driver package, root file system package, and packages required for the development environment;
[0069] To verify the flashing of the Jetson module according to the kernel image file and the device tree file, you must first enter the Jetson module development environment. The establishment of the Jetson module development environment requires the Jetson driver package (L4T package), the root file system package (Root-Filesystem) and the development environment package. Therefore, you need to obtain the Jetson driver package, the root file system package and the development environment package to establish the Jetson module development environment.
[0070] Execute the environment script to generate the Jetson module development environment according to the Jetson driver package, root file system package, and development environment package.
[0071] After obtaining the Jetson driver package, root file system package, and development environment package, execute the environment script, that is, the apply_binaries.sh script. The Jetson module development environment will be generated through the Jetson driver package, root file system package, and development environment package. In the Jetson module development environment, the Jetson module can be flashed and verified according to the kernel image file and device tree file.
[0072] In one implementation manner, the obtaining of the kernel image file and the device tree file according to the preset kernel configuration file includes:
[0073] Obtain the kernel source code package, and obtain the kernel configuration file based on the kernel source code package;
[0074] To obtain the kernel image file and device tree file according to the preset kernel configuration file, you must first obtain the kernel source code package, install the kernel tool according to the kernel source code package, set the shell environment variables, and configure the GCC cross-compilation environment variables; you can get the kernel configuration file according to the kernel tool, so as to configure the kernel configuration file according to the functional requirements.
[0075] Configure the kernel configuration file and compile it to generate a new kernel image file and device tree file for the Jetson module;
[0076] After obtaining the kernel configuration file from the kernel source code package, configure the kernel configuration file, and then compile the kernel configuration file to obtain a new kernel image file and device tree file. Configuring the kernel configuration file is essentially configuring the kernel functions, including security configuration, firewall configuration, and other functions. After configuring the kernel configuration file according to actual needs, compile the kernel configuration file to obtain the corresponding new kernel image file and device tree file according to the function configuration.
[0077] Replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file.
[0078] The official kernel image file and device tree file exist in the Jetson driver package, which are called the old kernel image file and device tree file. After generating the new kernel image file and device tree file, replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file, and you can get the kernel image file and device tree file containing the required functions, so that you can make an offline flashing package based on the new kernel image file and device tree file, and the obtained offline flashing package will contain the required functions.
[0079] In one embodiment, the flashing verification of the Jetson module according to the kernel image file and the device tree file in the Jetson module development environment includes:
[0080] Execute the verification script to verify the new kernel image file and device tree file in the Jetson module development environment.
[0081] After obtaining the new kernel image file and device tree file, you can make an offline flash package based on the new kernel image file and device tree file. However, before making the offline flash package, you must first verify whether the new kernel image file and device tree file are available. Therefore, after obtaining the new kernel image file and device tree file, first execute the verification script, which is the official flash script, that is, the flash.sh script. In the Jetson module development environment, executing the verification script can verify the flashing of the new kernel image file and device tree file, which is essentially the operation of flashing the Jetson module. If the Jetson module functions normally after flashing, it means that the new kernel image file and device tree file obtained according to the kernel configuration file are normal and available; if the Jetson module does not function normally, it means that the new kernel image file and device tree file obtained according to the kernel configuration file cannot be used and need to be remade.
[0082] In one embodiment, after the flash verification of the Jetson module is passed, the kernel image file and the device tree file are made into an offline flash package, including:
[0083] After the flash verification is passed, execute the flash package script to obtain the offline flash package based on the new kernel image file and device tree file.
[0084] In the Jetson module development environment, the new kernel image file and device tree file are flashed and verified. After the flash verification is passed, the Jetson module functions normally, which means that the new kernel image file and device tree file obtained according to the kernel configuration file are normally available. Then, the flash package script can be executed, that is, the nvmassflashgen.sh script. Through the flash package script, the offline flash package can be obtained according to the new kernel image file and device tree file. After obtaining the offline flash package, the offline storage package can be stored as a Linux boot disk, so that the host can enter the Linux environment through the Linux boot disk and perform the flash operation of the Jetson module.
[0085] In one embodiment, storing the offline flash package to the Linux boot disk includes:
[0086] Start the Linux system boot disk tool, receive the USB disk and Linux system image file selected by the user, and create a Linux boot disk;
[0087] To make a boot disk, you must first connect the USB flash drive used to make the Linux boot disk to the host, and then start the Linux system boot disk tool on the host. Generally, the Rufus tool is used to make the Linux boot disk. After starting the Linux system boot disk tool, select the corresponding Linux system image file and USB flash drive in the corresponding position of the boot disk tool, that is, the Linux system image file and the USB flash drive used to make the boot disk, such as selecting the image of ubuntu-18.04.5-desktop-amd64.iso; then make relevant settings, execute the boot disk tool production process, and start making the Linux boot disk. After the Linux boot disk is made, you can further prepare the offline flashing package of the Jetson module, so that the host can use the Linux boot disk to enter the Linux environment. The host can perform the flashing operation in the Linux environment according to the NVIDIA official documentation, and there is no need to prepare the Linux system host, which improves the flashing efficiency of the Jetson module.
[0088] Create a second partition for the Linux boot disk and store the Jetson module flash package in the second partition of the Linux boot disk.
[0089] There are two common methods for storing the offline flashing package of the Jetson module. The first method is to store the offline flashing package of the Jetson module through the host, that is, directly copy the offline flashing package of the Jetson module to the hard disk of the host. When entering the Linux environment through the Linux boot disk in USB mode, the offline flashing package of the Jetson module located in the hard disk of the host can be obtained. Therefore, the offline flashing package of the Jetson module can be stored in the storage device of the host. Of course, this method also has its inconvenience. When flashing multiple Jetson modules at different locations, the Jetson module flashing package needs to be stored on the host at different locations in advance, and the operation procedures are cumbersome. The second common method for storing the offline flashing package of the Jetson module is to directly copy the offline flashing package of the Jetson module to the Linux boot disk. However, if this method is adopted, a second partition needs to be established for the Linux boot disk. The first partition is the storage partition required for making the Linux boot disk; the second partition is the storage partition for storing the offline flashing package of the Jetson module. When making a Linux boot disk, the U disk must be in fat32 format, and the U disk in fat32 format does not support copying data larger than 4G, and the offline flashing package of the Jetson module has a single data larger than 4G. Therefore, in order to support the copying of data larger than 4G, the U disk needs to be made into NTFS or exfat format. In order to simultaneously meet the functions of the Linux boot disk fat32 format and copying data larger than 4G, a second partition is created for the U disk, and the second partition is formatted as NTFS or exfat format, while the first partition is still in fat32 format, so that the Jetson module flashing package larger than 4G can be stored in the second partition of the Linux boot disk. In addition, the offline flashing package of the Jetson module is stored in the Linux boot disk, which is easy to carry, and when flashing multiple Jetson modules at different locations, it is not necessary to copy the Jetson module flashing package to the host in advance, which improves the convenience of flashing the Jetson module. Generally, the second method is preferred for flashing the Jetson module. Partitioning tools can be selected according to actual conditions. Tools that can partition Linux boot disks are fine, such as diskgenius, AOMEI Partition Assistant, etc. After creating a second partition for Linux, you can directly copy the offline flashing package of the Jetson module to the second partition of the Linux boot disk. The second partition in the Linux boot disk stores the offline flashing package of the Jetson module, which is easy to carry. When flashing multiple Jetson modules at different locations, there is no need to copy the offline flashing package of the Jetson module to the host in advance, which improves the convenience of flashing the Jetson module.
[0090] In one embodiment, the method of starting the host in USB mode, allowing the host to enter the Linux environment through a Linux boot disk, and flashing the Jetson module using an offline flashing package in the Linux environment includes:
[0091] Receive the host boot mode set by the user, boot the host in USB mode, so that the host enters the Linux environment through the Linux boot disk;
[0092] After the Linux flashing tool is built, the flashing operation of the Jetson module can be performed. First, the host startup mode set by the user must be received, that is, the user sets the startup items of the host, and the host is started in USB mode, that is, the host is started through the Linux boot disk, and the host enters the Linux environment. In the Linux environment, with the help of the offline flashing package of the Jetson module, the flashing operation can be performed according to the official NVIDIA documentation. It is no longer necessary to prepare a host with a Linux system, which improves the flashing efficiency of the Jetson module.
[0093] In the Linux environment, use the offline flash package to flash the Jetson module.
[0094] After starting the host in USB mode, the host starts through the Linux boot disk and enters the Linux environment. In the Linux environment, with the help of the offline flashing package of the Jetson module, you can perform the flashing operation according to the official NVIDIA documentation. There is no need to prepare a Linux system host, which improves the flashing efficiency of the Jetson module.
[0095] In one embodiment, after making the Linux boot disk, the method further includes:
[0096] Perform the boot disk verification procedure on the Linux boot disk.
[0097] After the Linux boot disk is made, it is necessary to test the Linux boot disk to determine whether the Linux boot disk can be used normally. The Linux boot disk test procedure is to connect the Linux boot disk to the host, restart the host, enter the host's boot item setting interface, select the USB Linux boot disk boot item, and then test whether the host can normally enter the Linux system of the Linux boot disk. If it can enter normally, it means that the Linux boot disk is made normally; if it cannot enter normally, it means that the Linux boot disk is made abnormally and needs to be remade; the reasons for the abnormality may be as follows: there is a problem with the U disk; there is a problem with the image file, etc. After the Linux boot disk is successfully tested, the host uses the Linux boot disk to enter the Linux environment. The host can perform the flashing operation in the Linux environment according to the NVIDIA official documentation. There is no need to prepare a host with a Linux system, which improves the flashing efficiency of the Jetson module.
[0098] In one embodiment, before storing the offline flash package of the Jetson module to the second partition of the Linux boot disk, the method includes:
[0099] Check whether the second partition is partitioned successfully.
[0100] Before storing the offline flashing package of the Jetson module to the second partition of the Linux boot disk, the second partition must be checked. If the check is successful, the offline flashing package of the Jetson module can be stored in the second partition of the Linux boot disk; if the check is unsuccessful, the second partition of the Linux boot disk needs to be re-established; the reasons for the partition failure may be as follows: problems with the USB flash drive; problems with the partitioning tool, etc. By checking the second partition, problems can be prevented in the subsequent process of flashing the Jetson module, thus improving the flashing efficiency.
[0101] Embodiment 2:
[0102] Reference Figure 2 As shown, Figure 2 This is a flow chart of the second method of the Jetson module flashing method of the present invention.
[0103] Get the Jetson driver package, root file system package, and development environment package;
[0104] To verify the flashing of the Jetson module according to the kernel image file and the device tree file, you must first enter the Jetson module development environment. The establishment of the Jetson module development environment requires the Jetson driver package (L4T package), the root file system package (Root-Filesystem) and the development environment package. Therefore, you need to obtain the Jetson driver package, the root file system package and the development environment package to establish the Jetson module development environment.
[0105] Execute the environment script to generate the Jetson module development environment according to the Jetson driver package, root file system package and development environment package;
[0106] After obtaining the Jetson driver package, root file system package, and development environment package, execute the environment script, that is, the apply_binaries.sh script. The Jetson module development environment will be generated through the Jetson driver package, root file system package, and development environment package. In the Jetson module development environment, the Jetson module can be flashed and verified according to the kernel image file and device tree file.
[0107] Obtain the kernel source code package, and obtain the kernel configuration file based on the kernel source code package;
[0108] To obtain the kernel image file and device tree file according to the preset kernel configuration file, you must first obtain the kernel source code package, install the kernel tool according to the kernel source code package, set the shell environment variables, and configure the GCC cross-compilation environment variables; you can get the kernel configuration file according to the kernel tool, so as to configure the kernel configuration file according to the functional requirements.
[0109] Configure the kernel configuration file and compile it to generate a new kernel image file and device tree file;
[0110] After obtaining the kernel configuration file from the kernel source code package, configure the kernel configuration file, and then compile the kernel configuration file to obtain a new kernel image file and device tree file. Configuring the kernel configuration file is essentially configuring the kernel functions, including security configuration, firewall configuration, and other functions. After configuring the kernel configuration file according to actual needs, compile the kernel configuration file to obtain the corresponding new kernel image file and device tree file according to the function configuration.
[0111] Replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file;
[0112] The official kernel image file and device tree file exist in the Jetson driver package, which are called the old kernel image file and device tree file. After generating the new kernel image file and device tree file, replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file, and you can get the kernel image file and device tree file containing the required functions, so that you can make an offline flashing package based on the new kernel image file and device tree file, and the obtained offline flashing package will contain the required functions.
[0113] Execute the verification script to verify the new kernel image file and device tree file in the Jetson module development environment;
[0114] After obtaining the new kernel image file and device tree file, you can make an offline flash package based on the new kernel image file and device tree file. However, before making the offline flash package, you must first verify whether the new kernel image file and device tree file are available. Therefore, after obtaining the new kernel image file and device tree file, first execute the verification script, which is the official flash script, that is, the flash.sh script. In the Jetson module development environment, executing the verification script can verify the flashing of the new kernel image file and device tree file, which is essentially the operation of flashing the Jetson module. If the Jetson module functions normally after flashing, it means that the new kernel image file and device tree file obtained according to the kernel configuration file are normal and available; if the Jetson module does not function normally, it means that the new kernel image file and device tree file obtained according to the kernel configuration file cannot be used and need to be remade.
[0115] After the flash verification is passed, execute the flash package script to obtain the offline flash package according to the new kernel image file and device tree file;
[0116] In the Jetson module development environment, the new kernel image file and device tree file are flashed and verified. After the flash verification is passed, the Jetson module functions normally, which means that the new kernel image file and device tree file obtained according to the kernel configuration file are normally available. Then, the flash package script can be executed, that is, the nvmassflashgen.sh script. Through the flash package script, the offline flash package can be obtained according to the new kernel image file and device tree file. After obtaining the offline flash package, the offline storage package can be stored as a Linux boot disk, so that the host can enter the Linux environment through the Linux boot disk and perform the flash operation of the Jetson module.
[0117] Start the Linux system boot disk tool, receive the USB disk and Linux system image file selected by the user, and create a Linux boot disk;
[0118] To make a boot disk, you must first connect the USB flash drive used to make the Linux boot disk to the host, and then start the Linux system boot disk tool on the host. Generally, the Rufus tool is used to make the Linux boot disk. After starting the Linux system boot disk tool, select the corresponding Linux system image file and USB flash drive in the corresponding position of the boot disk tool, that is, the Linux system image file and the USB flash drive used to make the boot disk, such as selecting the image of ubuntu-18.04.5-desktop-amd64.iso; then make relevant settings, execute the boot disk tool production process, and start making the Linux boot disk. After the Linux boot disk is made, you can further prepare the offline flashing package of the Jetson module, so that the host can use the Linux boot disk to enter the Linux environment. The host can perform the flashing operation in the Linux environment according to the NVIDIA official documentation, and there is no need to prepare the Linux system host, which improves the flashing efficiency of the Jetson module.
[0119] Perform the boot disk verification procedure on the Linux boot disk;
[0120] After the Linux boot disk is made, it is necessary to test the Linux boot disk to determine whether the Linux boot disk can be used normally. The Linux boot disk test procedure is to connect the Linux boot disk to the host, restart the host, enter the host's boot item setting interface, select the USB Linux boot disk boot item, and then test whether the host can normally enter the Linux system of the Linux boot disk. If it can enter normally, it means that the Linux boot disk is made normally; if it cannot enter normally, it means that the Linux boot disk is made abnormally and needs to be remade; the reasons for the abnormality may be as follows: there is a problem with the U disk; there is a problem with the image file, etc. After the Linux boot disk is successfully tested, the host uses the Linux boot disk to enter the Linux environment. The host can perform the flashing operation in the Linux environment according to the NVIDIA official documentation. There is no need to prepare a host with a Linux system, which improves the flashing efficiency of the Jetson module.
[0121] Create a second partition for the Linux boot disk and store the offline flash package of the Jetson module in the second partition of the Linux boot disk;
[0122] The preferred method for storing the offline flashing package of the Jetson module is to directly copy the offline flashing package of the Jetson module to the Linux boot disk. However, if this method is adopted, a second partition needs to be created for the Linux boot disk. The first partition is the storage partition required for making the Linux boot disk; the second partition is the storage partition for storing the offline flashing package of the Jetson module. When making a Linux boot disk, the U disk must be in fat32 format, and the fat32 format U disk does not support the copying of data exceeding 4G in size, and the offline flashing package of the Jetson module has a single data larger than 4G. Therefore, in order to support the copying of data above 4G, the U disk needs to be made into NTFS or exfat format. In order to simultaneously meet the functions of the Linux boot disk fat32 format and copying data above 4G, a second partition is created for the U disk, and the second partition is formatted as NTFS or exfat format, while the first partition is still in fat32 format, so that the Jetson module flashing package above 4G can be stored in the second partition of the Linux boot disk. In addition, the offline flashing package of the Jetson module is stored in the Linux boot disk, which is easy to carry. When flashing multiple Jetson modules at different locations, there is no need to copy the Jetson module flashing package to the host in advance, which improves the convenience of flashing the Jetson module. Before storing the offline flashing package of the Jetson module in the second partition of the Linux boot disk, the second partition must be checked. If the check is successful, the offline flashing package of the Jetson module can be stored in the second partition of the Linux boot disk; if the check is unsuccessful, the second partition of the Linux boot disk needs to be re-established; the partitioning failure may have the following reasons: problems with the USB flash drive; problems with the partitioning tool, etc. By checking the second partition, problems can be prevented in the subsequent process of flashing the Jetson module, thereby improving the flashing efficiency.
[0123] Receive the host boot mode set by the user, boot the host in USB mode, so that the host enters the Linux environment through the Linux boot disk;
[0124] After the Linux flashing tool is built, the flashing operation of the Jetson module can be performed. First, the host startup mode set by the user must be received, that is, the user sets the startup items of the host, and the host is started in USB mode, that is, the host is started through the Linux boot disk, and the host enters the Linux environment. In the Linux environment, with the help of the offline flashing package of the Jetson module, the flashing operation can be performed according to the official NVIDIA documentation. It is no longer necessary to prepare a host with a Linux system, which improves the flashing efficiency of the Jetson module.
[0125] In the Linux environment, use the offline flashing package of the Jetson module to flash the Jetson module.
[0126] After starting the host in USB mode, the host starts through the Linux boot disk and enters the Linux environment. In the Linux environment, with the help of the offline flashing package of the Jetson module, you can perform the flashing operation according to the official NVIDIA documentation. There is no need to prepare a Linux system host, which improves the flashing efficiency of the Jetson module.
[0127] It should be understood that although Figures 1-2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1-2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0128] Embodiment three:
[0129] Reference Figure 3 As shown, Figure 3 This is a system structure diagram of the Jetson module flashing system of the present invention.
[0130] The Jetson module flashing system includes:
[0131] A file acquisition module, used to acquire kernel image files and device tree files according to a preset kernel configuration file;
[0132] The premise of entering the Linux environment through the Linux boot disk and flashing the Jetson module is to create an offline flashing package for the Jetson module. To create an offline flashing package, you need to configure it according to the kernel configuration file to configure the Jetson module according to the actual functional requirements. The configured kernel configuration file is called the preset kernel configuration file. After the functional requirements of the Jetson module are configured in the kernel configuration file, the preset kernel configuration file is obtained, and then based on the file acquisition module, the kernel image file and the device tree file are obtained according to the preset kernel configuration file, so as to facilitate the flashing verification of the Jetson module according to the kernel image file and the device tree file.
[0133] The flash verification module is used to verify the flash of the Jetson module according to the kernel image file and device tree file in the Jetson module development environment;
[0134] After obtaining the kernel image file and device tree file according to the preset kernel configuration file, you need to verify the flashing of the Jetson module through the flashing verification module. The prerequisite for flashing verification is to enter the Jetson module development environment. Therefore, during the R&D stage, R&D personnel need to verify the flashing of the Jetson module according to the kernel image file and device tree file in the Jetson module development environment in order to make the offline flashing package of the Jetson module.
[0135] Flash package generation module, used to make kernel image files and device tree files into offline flash packages;
[0136] In the Jetson module development environment, perform flash verification on the Jetson module according to the kernel image file and device tree file. After the flash verification of the Jetson module passes, it means that the kernel image file and the device tree file are normal. The kernel image file and the device tree file can be made into an offline flash package through the flash package generation module, so that customers can flash the Jetson module through the Linux boot disk and the offline flash package of the Jetson module.
[0137] The Jetson flashing module is used to start the host via USB, enable the host to enter the Linux environment through the Linux boot disk, and flash the Jetson module using the offline flashing package in the Linux environment.
[0138] The host, Linux boot disk, and Jetson module flashing package form a flashing tool. When flashing the Jetson module, these three elements are sufficient. After these three elements are met, insert the Linux boot disk into the host, set the host's startup items, and start the host in USB mode, that is, the host starts through the Linux boot disk, and the host enters the Linux environment in the Linux boot disk. In the Linux environment, with the help of the Jetson module's offline flashing package, you can use the Jetson flashing module to perform flashing operations according to NVIDIA official documents. There is no need to prepare a Linux system host, which improves the flashing efficiency of the Jetson module.
[0139] In one embodiment, the Jetson module flashing system includes:
[0140] Development environment module, used to generate Jetson module development environment;
[0141] After obtaining the Jetson driver package, root file system package, and development environment package, execute the environment script, that is, the apply_binaries.sh script. The Jetson module development environment will be generated through the Jetson driver package, root file system package, and development environment package. In the Jetson module development environment, the Jetson module can be flashed and verified according to the kernel image file and device tree file. The development environment module is used to generate the Jetson module development environment.
[0142] For the specific definition of the Jetson module flashing system, please refer to the definition of the method above, which will not be repeated here. Each module in the above-mentioned Jetson module flashing system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0143] Embodiment 4:
[0144] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a Jetson module flashing method when executing the computer program.
[0145] The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the Jetson module flashing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0146] Those skilled in the art should understand that Figure 4The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0147] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0148] Obtain kernel image files and device tree files according to the preset kernel configuration file;
[0149] In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file;
[0150] After the Jetson module's flash verification is passed, make the kernel image file and device tree file into an offline flash package;
[0151] Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host;
[0152] Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] Get the Jetson driver package, root file system package, and development environment package;
[0155] Execute the environment script to generate the Jetson module development environment according to the Jetson driver package, root file system package, and development environment package.
[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0157] Obtain the kernel source code package, and obtain the kernel configuration file based on the kernel source code package;
[0158] Configure the kernel configuration file and compile it to generate a new kernel image file and device tree file;
[0159] Replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file.
[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0161] Execute the verification script to verify the new kernel image file and device tree file in the Jetson module development environment.
[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0163] After the flash verification is passed, execute the flash package script to obtain the offline flash package based on the new kernel image file and device tree file.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] Start the Linux system boot disk tool, receive the USB disk and Linux system image file selected by the user, and create a Linux boot disk;
[0166] Create a second partition for the Linux boot disk and store the offline flash package of the Jetson module in the second partition of the Linux boot disk.
[0167] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0168] Receive the host boot mode set by the user, boot the host in USB mode, so that the host enters the Linux environment through the Linux boot disk.
[0169] Embodiment five:
[0170] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0171] Obtain kernel image files and device tree files according to the preset kernel configuration file;
[0172] In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file;
[0173] After the Jetson module's flash verification is passed, make the kernel image file and device tree file into an offline flash package;
[0174] Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host;
[0175] Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0177] Get the Jetson driver package, root file system package, and development environment package;
[0178] Execute the environment script to generate the Jetson module development environment according to the Jetson driver package, root file system package, and development environment package.
[0179] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0180] Obtain the kernel source code package, and obtain the kernel configuration file based on the kernel source code package;
[0181] Configure the kernel configuration file and compile it to generate a new kernel image file and device tree file;
[0182] Replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file.
[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0184] Execute the verification script to verify the new kernel image file and device tree file in the Jetson module development environment.
[0185] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0186] After the flash verification is passed, execute the flash package script to obtain the offline flash package based on the new kernel image file and device tree file.
[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0188] Start the Linux system boot disk tool, receive the USB disk and Linux system image file selected by the user, and create a Linux boot disk;
[0189] Create a second partition for the Linux boot disk and store the offline flash package of the Jetson module in the second partition of the Linux boot disk.
[0190] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0191] Receive the host boot mode set by the user, boot the host in USB mode, so that the host enters the Linux environment through the Linux boot disk.
[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0194] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for flashing a Jetson module, characterized in that: The Jetson module flashing method includes: Obtain kernel image files and device tree files according to the preset kernel configuration file; In the Jetson module development environment, verify the flashing of the Jetson module according to the kernel image file and device tree file; After the Jetson module's flash verification is passed, make the kernel image file and device tree file into an offline flash package; Store the offline flash package to the Linux boot disk and connect the Jetson module and the Linux boot disk to the host; Start the host in USB mode, use the Linux boot disk to make the host enter the Linux environment, and use the offline flash package to flash the Jetson module in the Linux environment.
2. The Jetson module flashing method according to claim 1, characterized in that: Before obtaining the kernel image file and the device tree file according to the preset kernel configuration file, the method further includes: Get the Jetson driver package, root file system package, and development environment package; Execute the environment script to generate the Jetson module development environment according to the Jetson driver package, root file system package, and development environment package.
3. The Jetson module flashing method according to claim 2, characterized in that: The step of obtaining the kernel image file and the device tree file according to the preset kernel configuration file includes: Obtain the kernel source code package, and obtain the kernel configuration file based on the kernel source code package; Configure the kernel configuration file and compile it to generate a new kernel image file and device tree file; Replace the old kernel image file and device tree file in the Jetson driver package with the new kernel image file and device tree file.
4. The Jetson module flashing method according to claim 1 or 2, characterized in that: The flashing verification of the Jetson module according to the kernel image file and the device tree file in the Jetson module development environment includes: Execute the verification script to verify the new kernel image file and device tree file in the Jetson module development environment.
5. The Jetson module flashing method according to claim 1, characterized in that: After the flash verification of the Jetson module is passed, the kernel image file and the device tree file are made into an offline flash package, including: After the flash verification is passed, execute the flash package script to obtain the offline flash package based on the new kernel image file and device tree file.
6. The Jetson module flashing method according to claim 1, characterized in that: The step of storing the offline flash package to the Linux boot disk includes: Start the Linux system boot disk tool, receive the USB disk and Linux system image file selected by the user, and create a Linux boot disk; Create a second partition for the Linux boot disk and store the offline flash package of the Jetson module in the second partition of the Linux boot disk.
7. The Jetson module flashing method according to claim 1, characterized in that: The method of starting the host in USB mode, allowing the host to enter the Linux environment through the Linux boot disk, and flashing the Jetson module using an offline flashing package in the Linux environment includes: Receive the host boot mode set by the user, boot the host in USB mode, so that the host enters the Linux environment through the Linux boot disk; In the Linux environment, use the offline flashing package of the Jetson module to flash the Jetson module.
8. A Jetson module flashing system, characterized in that: The Jetson module flashing system includes: A file acquisition module, used to acquire kernel image files and device tree files according to a preset kernel configuration file; Flash verification module, used to verify the flash of Jetson module according to kernel image file and device tree file in Jetson module development environment; The flash package generation module is used to make the kernel image file and device tree file into an offline flash package after the flash verification of the Jetson module is passed; The Jetson flashing module is used to start the host via USB, enable the host to enter the Linux environment through the Linux boot disk, and flash the Jetson module using the offline flashing package in the Linux environment.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed by a processor, the processor is caused to execute the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
A method and a device for realizing a terminal brush machine
CN109101278A
Quick boot method after upgrade based on android system
CN109165048A