Wei Dongshan Embedded Getting Started Notes-The first APP and driver on the development board

 

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

 

text

1. Compile the program on the development board, that
is, use the cross compiler to compile the program

1. The most important thing is to find the prefix of the cross-compilation first:
(1) A way to use the auto-completion function:
input arm- and then add the Tab key, and the desired prefix will come out

(2) The second method is to view the environment variable CROSS_COMPILE

book@100ask:~$ echo $CROSS_COMPILE
arm-linux-gnueabihf-

2. If it is not cross-compiled, it will report an error on the development board as a format error

$ arm-linux-gnueabihf-gcc -o hello hello.c

3. After successfully compiling on Ubuntu, transfer the file to the development board and run the program.
First copy the compiled hello file to the Ubuntu nfs service directory

$ cp hello /home/book/nfs_rootfs
4. Connect the development board to the terminal
Specific steps:
(1) Turn on the switch of the development board and enter root after waiting for a while
(2) Execute the udhcpc command to obtain the IP of the development board
(3) Use the macro command to mount the NFS service directory of Ubuntu
 
5. Find and execute the program under /mnt 
 
/mnt/hello

2. Compile the driver on the development board
 
Return to completion when you learn to drive
 
 
 
 

Guess you like

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