<Linux development> -The detailed record of system transplantation uboot transplantation process (Part 3) (uboot transplantation completed)

<Linux development> -The detailed record of the system transplantation uboot transplantation process (Part 3)

<Linux development> -The detailed record of the uboot migration process of system transplantation (Part 1)
<Linux development> -The detailed record of the uboot migration process of system transplantation (Part 2)

This section mainly explains the general process of U-Boot graphical configuration.

1. Install the support library
Install the ncurses library in ubuntu with the following command:

sudo apt-get install build-essential 
sudo apt-get install libncurses5-dev 

2. Graphical configuration
1. After the first part of the uboot migration is completed, and in the root directory of the uboot folder after the second part, enter the main command:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_onefu_emmc_defconfig 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig 

Or change "mx6ull_onefu_emmc.sh" to the following:

#!/bin/bash
#清理工程
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
#执行配置uboot
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_onefu_emmc_defconfig
#执行图形配置界面
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
#执行编译
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16

#注1: ARCH=arm  设置目标为arm架构
#注2: CROSS_COMPILE=arm-linux-gnueabihf-    指定编译工具链前缀
#注3: V=1  用于设置编译过程的信息输出级别
#注4-j16 使用16核编译uboot

Compared with the previous one, a sentence "make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-menuconfig" has been added.
Give "mx6ull_onefu_emmc.sh" executable permission, then run ""mx6ull_onefu_emmc.sh"".

chmod 777 mx6ull_onefu_emmc.sh
./mx6ull_onefu_emmc.sh

2. Introduction to the graphical interface

After the configuration is completed, a graphical interface will pop up, as follows:
insert image description here
The English at the top of the main interface is a simple operation instruction. The operation method is as follows: Use the "↑" and "↓" keys on the keyboard to select the menu to be configured, and press "Enter" ” key to enter the submenu. The highlighted letter in the menu is the hotkey of the menu. Press the key corresponding to the highlighted letter on the keyboard to quickly select the corresponding menu. After selecting the submenu, pressing the "Y" key will compile the corresponding code into Uboot, and the front of the menu will become "< * >". Pressing the "N" key does not compile the corresponding code, and pressing the "M" key will compile the corresponding code into a module, and the front of the menu changes to "<M>". Press the "Esc" key twice to exit, that is, return to the previous level, press the "?" key to view the help information of this menu, and press the "/" key to open the search box, where you can enter the content you want to search for.
There are five buttons at the bottom of the configuration interface. The functions of these five buttons are as follows:
: Select button, which has the same function as the "Enter" key, and is responsible for selecting and entering a certain menu.
: Exit button, has the same function as pressing the "Esc" key twice, exits the current menu and returns to the previous level.
: Help button to view the help information of the selected menu.
: Save button to save the modified configuration file.
: Load button to load the specified configuration file.

In the figure above, there are 13 main configuration items, which can be adjusted by the up and down keys on the keyboard. Followed by "—>" indicates that this configuration item has sub-configuration items, and you can enter the sub-configuration items by pressing the Enter key.

Take how to enable the dns command as an example to explain how to configure uboot through the graphical interface. Enter the "Command line interface —>" configuration item, which is used to configure the uboot command, as shown in the following figure after entering:
insert image description here
As can be seen from the above figure, there are many configuration items, and these configuration items also have sub-configuration items, select "Network commands —>", enter the network-related command configuration items, as shown in the figure below:
insert image description here
As can be seen from the above figure, there are many network-related commands in uboot, such as bootp, tftpboot, dhcp, and so on. Select dns, and then press the "Y" key on the keyboard. At this time, the "[ ]" in front of dns becomes "[ * ]", as shown in the figure below:
insert image description here
There are 3 compilation options for each option: Compile into uboot (that is, compiling into u-boot.bin), cancel the compilation (that is, do not compile this function module), and compile it as a module. Pressing the "Y" key means compiling into uboot, at this time, "[ ]" becomes "[ * ]"; pressing "N" means not compiling, and "[ ]" means not compiling by default; some function modules support Compiled as a module, this is generally used in the Linux kernel, and is not used under uboot. If you want to compile a function into a module, press "M", then "[ ]" will become "< M >".

Careful friends should find that in mx6ull_onefu_emmc.h, we configure and enable dhcp and ping commands, but in Figure 34.1.3, the "[ ]" in front of dhcp and ping is not "[ * ]", which means no Compile the dhcp and ping commands, isn't this a conflict? The actual situation is that the dhcp and ping commands are compiled. The reason why it is not reflected in Figure 34.1.3 is because we directly define the macros CONFIG_CMD_PING and CONFIG_CMD_DHCP in mx6ull_onefu_emmc.h, and menuconfig judges which functions are enabled by reading the .config file. There is no such thing in .config. The macros CONFIG_CMD_PING and CONFIG_CMD_DHCP, so menuconfig will recognize the error.
Select dns, and then press the "H" or "?" key to open the prompt information of the dns command.

Press the ESC key twice to exit the prompt interface, which is equivalent to returning to the previous layer. After selecting the dns command, press the ESC key twice (pressing the ESC key twice is equivalent to returning to the previous layer) to exit the current configuration item and enter the previous configuration item. If there is nothing to be modified, press the ESC key twice to exit to the main configuration interface. If there is nothing else to be modified, press the ESC key again to exit the menuconfig configuration interface. If the configuration has been modified, there will be a prompt as shown in the following figure when exiting the main interface:
insert image description here
the above figure asks whether to save the new configuration file, select the "Yes" item by pressing the ← or → key on the keyboard, and then press the key on the keyboard. Press Enter to confirm saving. At this point, we have completed the dns command that enables uboot through the graphical interface, open the .config file, and find the line "CONFIG_CMD_DNS=y", as shown in the red box in the following figure:
insert image description here
3. Compile and
configure above After DNS, after exiting, it will continue to compile.
insert image description here
After the compilation is complete, download it to the SD card, and insert the development board to start.
Restart the development board to enter the uboot command mode, enter "?" to see if there is a "dns" command, generally there must be.
insert image description here

Test whether the dns command works normally, and use the dns command to check the IP address of Baidu's official website "www.baidu.com". To set the IP address of the dns server first, that is, to set the value of the environment variable dnsip, the command is as follows:

setenv dnsip 114.114.114.114 
saveenv 

insert image description here
After setting, you can use the dns command to view the IP address of Baidu's official website, enter the command:

dns www.baidu.com

insert image description here
It can be seen that the IP address of "www.baidu.com" is 14.215.177.38, indicating that the dns command works normally. This is to configure uboot through graphical commands. Generally, it is very convenient to enable some commands, so that you don't need to find the configuration macro of the command everywhere, and then define it in the configuration file.

So far, the general process of graphical configuration has been explained with the example of DNS, and other parameters can also be configured through this graphical configuration.

If you want to know more about the graphical configuration, you can open the punctual atomic linux development manual, or find relevant information on the Internet to learn.

The uboot porting part of system porting in linux development has been fully explained.
Follow-up will continue to launch linux porting and file system porting.

<Linux development> -The detailed record of the uboot migration process of system transplantation (Part 1)
<Linux development> -The detailed record of the uboot migration process of system transplantation (Part 2)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324488170&siteId=291194637