Wei Dongshan embedded entry notes-preparation before programming

Note: The development board takes the IMX6ULL PRO development board as an example! ! !

text:

1. Connect the development board
1. As shown in the figure


2. Install the USB serial port module driver
Open the device manager to view the port: let Windows install automatically, if the computer does not display the port number, you need to manually install the driver (using the driver wizard). Download a driver wizard from the official website of the driver wizard, install, run, and test, and the serial port driver will be automatically installed.

2. Connect the terminal MobaXterm to open the serial port
1. Open MobaXterm, click "Session" in the upper left corner, select "Serial" in the pop-up interface, and select the port number as shown in the figure below (the port number COM21 shown in the device manager in the front), baud Rate (Speed ​​115200), flow control (Flow Control: none), and finally click "OK". The steps are shown in the figure below.


2. Then a black window is displayed. At this time, turn on the power switch of the board, and you will receive the data from the serial port of the board . After waiting for a while, enter the password: root, press Enter to log in successfully, and then you can execute various Linux Ordered

imx6ull login: root

3. Verify the development board network

Check the application development complete manual, Chapter 6, Section 6.4
1. Use the ifconfig command on the terminal to check whether the IP is automatically obtained.
2. If the IP is not obtained automatically, you can try to obtain the IP with udhcpc;
if it fails, perform the following Command to manually set the IP:

ifconfig eth0 192.168.1.130 // Assuming that the IP of the development board is set to 192.168.1.130

Execute ifconfig here and you can see that the IP of eth0 is set to 192.168.1.130

3. Get the IP of the windows network card

4. Try to ping windows and the development board
. After setting up, you can ping the IP of the development board on the Windows command line; or ping the IP of the Windows network card in the serial port of the development board . If only one direction is open, it means there is no problem.

Ping the IP of the development board in windows:
open the search in the lower left corner: cmd to open the windows command line, enter ping   192.168.1.130:

The result above shows that the network connection is successful.
If so, please reconnect the network cable!

 

Fourth, use MobaXterm to remotely log in to the development board

After operating according to the above figure, you can see the IP address of the development board on the left side of MobaXterm, and you can log in to Ubuntu remotely by double-clicking it next time you log in.
 
 
5. Use FileZilla to transfer files between Windows and the development board
 
 
 
Six, the development board mounts the NFS directory of Ubuntu
 
In addition to using FileZilla the transfer of files between Windows and development boards, but also more convenient to use NFS to mount Ubuntu development board service in a particular directory, so that you can achieve the development board and direct interaction Ubuntu file without Transfer files multiple times to improve efficiency.
 
undone.
 


 

Seven, preparation before programming

7.1 Use GIT to download the source code
slightly

7.2  Use repo to download kernel and toolchain, etc.

1. Configure repo
 
Before downloading the repo tool, you need to set the git mailbox and user name. Please configure the git mailbox and user name according to your personal circumstances.
 
book@100ask:~$ git config --global user.email "[email protected]"
book@100ask:~$ git config --global user.name "100ask"
Note: Please configure the git mailbox and user name first, otherwise the download will fail (refer to the example picture below).
After configuration, you can execute the following command to confirm success:
 
git config --list
 
2. Download the source code
 
Execute the following 4 commands
 
book@100ask:~$ git clone https://e.coding.net/codebug8/repo.git
book@100ask:~$ mkdir -p 100ask_imx6ull-sdk && cd 100ask_imx6ull-sdk
book@100ask:~/100ask_imx6ull-sdk$ ../repo/repo init -u https://e.coding.net/weidongshan/manifests.git -b linux-sdk -m imx6ull/100ask_imx6ull_linux4.9.88_release.xml --no-repo-verify
book@100ask:~/100ask_imx6ull-sdk$ ../repo/repo sync -j4
 
When executing the third command, you will be asked if you want to use a color font to represent the file. Enter y to indicate agreement
 
Note: The code downloaded from the repo online is the same as the code in the supporting information of the network disk. We will update the source code package at regular intervals. If you use the online method to obtain the source code, you can directly execute it in the ~/100ask_imx6ull-sdk directory ../ repo/repo sync -c to update the latest code synchronously!
 
7.3 Configure cross-compilation tool chain
The cross-compilation tool chain is used to compile applications on the Ubuntu host, and these applications are run on other platforms such as ARM. Setting up the cross-compilation tool is mainly to set the three environment variables of PATH, ARCH and CROSS_COMPILE. The following describes the specific setting methods. There are many ways to set these 3 environment variables. You can choose one of them at will. It is recommended to use the "permanent effect" method.
 
1. Permanently effective
For permanent modification, please modify the user profile.
 
vim ~/.bashrc
Add or modify at the end of the text, add the following lines, after adding successfully, enter : wq to save and exit vim to return:
 
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=$PATH:/home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin
After setting, execute the source ~/.bashrc command to make it effective, this command is to load the environment variables of these settings.
You can check whether it takes effect:
 
2. Provisional entry into force
You can also manually execute the " export " command to set the environment variable, which is only valid for the current terminal (you need to set it again when you open another terminal).
 
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf
export PATH=$PATH:/home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin
 
3. Test the cross-compilation toolchain
(1) Test environment variables:
book@100ask:~$ echo $ARCH
arm
book@100ask:~$ echo $CROSS_COMPILE
arm-linux-gnueabihf-
Red font is on the board cross compiler command prefix
 
(2) Test the cross compiler:
Execute the following commands, and the results are shown in the figure below:
book@100ask:~$ arm-linux-gnueabihf-gcc -v
 
 
7.4 Use Source Insight to read the Linux kernel source code
 
7.4.1 Introduction to Source Insight
7.4.2 Decompress the kernel source code on Windows
7.4.3 Build a project example
The above are omitted
 
7.4.4 Operation example
1. Open the project
After the project proposed above, the project will be opened automatically. If you want to open the project next time, after starting Source Insight, click the menu
"Project -> Open Porject" can select the previously created project in a list.
 
2. Open the file in the project
Click the "P" icon to open the file list, double-click the file to open the file, or enter the file name to find the file


3. View the definition of a function or variable in the
file After opening the file, while holding down the ctrl key, click the function or variable with the mouse to jump to the position

where it was defined . When you need to return to the original code, press     Alt +, shortcut key to return to the code of the original calling function

4. Find function or variable references
double-click function, right-click on the pop-up dialog box, select the "lookup reference"; after or double-click function, use shortcut keys "ctrl + /" to find references

5. Other shortcut keys
Shortcut key Description
Alt +, go back
Alt +. Forward
F8 highlight the selected character
Ctrl+F find
F3 or Shift+F3 to search forward
F4 or Shift+F4 to search backward
 
 
 
 
 
 

Guess you like

Origin blog.csdn.net/San_a_fish_of_dream/article/details/113505120