SSH for communication with the board
Regenerating the SD card image and reflashing the entire SD card every time we want to change our application is not going to be very efficient during the application development/debugging. So instead, we’ll set up networking communication with the board, and use SSH to transfer files. This will also be useful for Qt Creator, as it uses SFTP to deploy files to the target.
Let’s start by enabling a small SSH client/server, called Dropbear. Go in Buildroot menuconfig, and enable the BR2_PACKAGE_DROPBEAR
option (in Target packages, Networking applications, dropbear). While Dropbear provides SSH access, it does not support SFTP which will be needed by Qt Creator, so we’ll also enable an SFTP server, gesftpserver. So, we’ll enable BR2_PACKAGE_GESFTPSERVER
as well (in Target packages, Networking applications, gesftpserver).
Then, in order to log in through SSH as root, we must have a non-empty root password, so set BR2_TARGET_GENERIC_ROOT_PASSWD
(in System configuration, Root password) to a value you like.
You can now exit menuconfig, as we have enabled all features we needed. Before restarting the build, we need to do one last thing: set up a network configuration file so that our STM32MP15 system configures an IP address. To do this, we’ll create a /etc/network/interfaces
file, and add it to the root filesystem using the root filesystem overlay mechanism, which was presented in the first post of this series. So, in your Buildroot sources, just create a file board/stmicroelectronics/stm32mp157c-dk/overlay/etc/network/interfaces
, with the following contents:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp
Caution: Directories etc and network could be missing in overlay directory.
Then, run make
in Buildroot, reflash your SD card, and boot your system. At boot time, you should see:
Starting dropbear sshd: OK
You can also run ip addr show dev eth0
to check the IP address of the eth0
interface:
Troubleshooting
If make fails with the following error:
*** *** ERROR: package host-mkpasswd installs executables without proper RPATH: *** /local/gosper/lab4-new/buildroot/output/host/bin/fincore *** /local/gosper/lab4-new/buildroot/output/host/bin/lsblk *** /local/gosper/lab4-new/buildroot/output/host/bin/prlimit *** /local/gosper/lab4-new/buildroot/output/host/bin/umount *** /local/gosper/lab4-new/buildroot/output/host/bin/uuidparse *** /local/gosper/lab4-new/buildroot/output/host/bin/genimage *** /local/gosper/lab4-new/buildroot/output/host/bin/eject *** /local/gosper/lab4-new/buildroot/output/host/bin/setfacl *** /local/gosper/lab4-new/buildroot/output/host/bin/getfacl *** /local/gosper/lab4-new/buildroot/output/host/bin/findmnt *** /local/gosper/lab4-new/buildroot/output/host/bin/lsmem *** /local/gosper/lab4-new/buildroot/output/host/bin/column *** /local/gosper/lab4-new/buildroot/output/host/bin/chacl *** /local/gosper/lab4-new/buildroot/output/host/bin/lscpu *** /local/gosper/lab4-new/buildroot/output/host/bin/mount *** /local/gosper/lab4-new/buildroot/output/host/bin/uuidgen *** /local/gosper/lab4-new/buildroot/output/host/bin/pkgconf *** /local/gosper/lab4-new/buildroot/output/host/bin/lsattr *** /local/gosper/lab4-new/buildroot/output/host/bin/chattr *** /local/gosper/lab4-new/buildroot/output/host/bin/mountpoint *** /local/gosper/lab4-new/buildroot/output/host/bin/lsipc *** /local/gosper/lab4-new/buildroot/output/host/bin/lslocks *** /local/gosper/lab4-new/buildroot/output/host/bin/lsns *** /local/gosper/lab4-new/buildroot/output/host/bin/attr *** /local/gosper/lab4-new/buildroot/output/host/sbin/e4crypt *** /local/gosper/lab4-new/buildroot/output/host/sbin/fstrim *** /local/gosper/lab4-new/buildroot/output/host/sbin/sfdisk *** /local/gosper/lab4-new/buildroot/output/host/sbin/tune2fs *** /local/gosper/lab4-new/buildroot/output/host/sbin/fsck.cramfs *** /local/gosper/lab4-new/buildroot/output/host/sbin/e2freefrag *** /local/gosper/lab4-new/buildroot/output/host/sbin/fsck *** /local/gosper/lab4-new/buildroot/output/host/sbin/partx *** /local/gosper/lab4-new/buildroot/output/host/sbin/e2undo *** /local/gosper/lab4-new/buildroot/output/host/sbin/mke2fs *** /local/gosper/lab4-new/buildroot/output/host/sbin/e2image *** /local/gosper/lab4-new/buildroot/output/host/sbin/wipefs *** /local/gosper/lab4-new/buildroot/output/host/sbin/dumpe2fs *** /local/gosper/lab4-new/buildroot/output/host/sbin/resize2fs *** /local/gosper/lab4-new/buildroot/output/host/sbin/e2fsck *** /local/gosper/lab4-new/buildroot/output/host/sbin/losetup *** /local/gosper/lab4-new/buildroot/output/host/sbin/mkswap *** /local/gosper/lab4-new/buildroot/output/host/sbin/debugfs *** /local/gosper/lab4-new/buildroot/output/host/sbin/swaplabel *** /local/gosper/lab4-new/buildroot/output/host/sbin/fdisk *** /local/gosper/lab4-new/buildroot/output/host/sbin/badblocks *** /local/gosper/lab4-new/buildroot/output/host/sbin/findfs *** /local/gosper/lab4-new/buildroot/output/host/sbin/mkfs.cramfs *** /local/gosper/lab4-new/buildroot/output/host/sbin/blkid *** /local/gosper/lab4-new/buildroot/output/host/sbin/swapon *** /local/gosper/lab4-new/buildroot/output/host/sbin/swapoff make: *** [package/pkg-generic.mk:282: /local/gosper/lab4-new/buildroot/output/build/host-mkpasswd/.stamp_host_installed] Error 1
run
make clean world make