preface

Taking JZ2440 development board as the target board, this paper will introduce the preparation work that needs to be done before it is developed, that is, the construction of development environment.

Setup of development environment

The development of embedded LINUX is generally carried out on Windows system, LINUX system and development board at the same time. The general operation process is to develop the program on Windows system, compile and link the program on LINUX system, and finally run the program on the development board. As a beginner, the first step is to be able to transfer data between the three, which is also a headache step.

The PC, VM, and development board ping each other

First of all, I use a wireless network card to access the Internet on my computer, and a wired network card is used as the intermediary between the three. For the virtual machines, I use VMware Workstation 15.5, and ubuntu uses the images given by Bainen.

  • Step 1: Select the VIRTUAL machine editor and set it to bridge mode to connect to the wired network card of the PC.

  • Step 2: In the Windows system command line window, input the command ipconfig, check the IP address of the cable network card, mine is 196.254.51.57.

  • Step 3: Set the UBUNTU IP address to the same network segment as the PC IP address. Enter the command: sudo ifconfig ens33 169.254.51.58

After the modification, run ping 169.254.51.57. The VM can ping the PC.

  • Step 4: Connect the development board to the PC with the network cable and serial cable. At this time, the development board should have LINUX system. Then through the MobaXterm tool can enter the development board system for debugging.
  • Step 5: Use the same method to set the IP address of the development board to the same network segment as that of the PC, but the IP address cannot be occupied. Then ping the VM on the development board.

Files are transferred between the PC and the VM, and between the VM and the development board

Once the three can ping through each other, the next thing to do is to send files to each other.

Files are transferred between the PC and THE VM

  • Method 1: Drag a file in Windows to the VM using the mouse. This method is simple, but usually not very convenient.
  • Method 2: Use FileZilla, enter VM information at 1, and click Quick Connect. After the connection is successful, two directories in the Windows operating system are displayed, and three directories in the VM are displayed. You can drag or double click the file to transfer files between the two systems.

File transfer between the VIRTUAL machine and the development board

This paper uses NFS (network file system) to transfer files between virtual machine and development board. You must first configure an NFS server on the virtual machine system.

  • Vim /etc/exports; Then add it to the file

/ work/nfs_root / * (rw, sync, no_root_squash). This means that the directory is used as the directory where files need to be shared

  • Go back to the cli and run the sudo /etc/init.d/nfs-kernel-server restart command. Restarting the NFS Server
  • Enter mount -t NFS -o nolock 169.254.51.58:/work/nfs_root/MNT; The former is the directory under the virtual machine, and the latter is the directory under the development board. The files in the/MNT directory are the same as those in the /work/nfs_root directory of the VM.

Have a problem

** NFS: server 169.254.51.58 not responding, still Trying error while operating file under/MNT

** Solution: ** Run the mount -t NFS -o nolock,rsize=1024,wsize=1024 169.254.51.58:/work/nfs_root/MNT statement to mount the NFS directory.