FAQ_MA35D1_Network File system by Yocto

Post Reply
ytliu6
Posts: 80
Joined: 08 Nov 2022, 10:28

09 Dec 2022, 16:32

This can cross-compile the application on PC and execute it on device through NFS rather than build the whole Linux image or use another way to send the application to device.
The following demo is operated on Ubuntu 20.04 not in the Docker container
First, install the network file system server on host OS

Code: Select all

$ sudo apt-get install nfs-kernel-server nfs-common
Create a folder to put your application code and shared with device
Modify the network file system setting. Add the following statement in exports

Code: Select all

$ sudo gedit /etc/exports
Add ” *(The folder path you want to share)*(EVB’s IP ADDRESS)(rw,sync,no_root_squash, no_subtree_check) ”
/home/user/yocto/helloworld 192.168.0.100(rw,sync,no_root_squash,no_subtree_check)
Restart the network file system service

Code: Select all

$sudo /etc/init.d/nfs-kernel-server restart
Enable NFS client in Linux kernel

Code: Select all

~/build$ bitbake linux-ma35d1 -c devshell
~/build/tmp-glibc/work-shared/ma35d1-evb/kernel-source# make menuconfig

Code: Select all

File systems  --->
    [*] Enable POSIX file locking API
    [*] Network File Systems  --->
           <*>   NFS client support
           <*>        NFS client support for NFS version 2
           <*>        NFS client support for NFS version 3
           [*]          NFS client support for the NFSv3 ACL protocol extension
           <*>        NFS client support for NFS version 4
Leave the kernel setting

Code: Select all

~/build/tmp-glibc/work-shared/ma35d1-evb/kernel-source# exit
Add nfs-utils to image and add the command to /build/conf/local.conf

Code: Select all

IMAGE_INSTALL_append = "nfs-utils"
Re-compile image and program to device

Code: Select all

~/build$ bitbake linux-ma35d1 -C compile
~/build$ bitbake nvt-image-qt5
Create a folder in device terminal

Code: Select all

root@ma35d1-evb:~# mkdir -p /mnt/nfs
Check the IP address if device and host are in the same internet domain
Mount the NFS on device

Code: Select all

mount -o nolock -t nfs 192.168.0.103:/home/user/yocto/build/helloworld /mnt/nfs/
Now, you can find the folder shared with host helloworld folder
FAQ_MA35D1_Network File System 1.png
FAQ_MA35D1_Network File System 1.png (88.52 KiB) Viewed 6783 times
After cross-compile the application, you can copy the binary file to USB storage and execute on evaluation board
Copy the application to USB drive, insert it to evaluation board, and confirm USB device number

Code: Select all

$ fdisk -l
Create a folder named usb for USB device under mnt folder, and mount on USB device

Code: Select all

$ mount /dev/sda1 /mnt/usb
Execute the application

Code: Select all

$ ./hello
FAQ_MA35D1_Network File System 2.png
FAQ_MA35D1_Network File System 2.png (15.81 KiB) Viewed 6783 times

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests