RK3568
- 一、配置IP地址
- 二、开发板连接网络,电脑连接无线,都正常上网
- 三、GCC
- 四、CMake
- 1. CMakeLists.txt
- 2. main.cpp
- 3.build
- 五、传输文件
一、配置IP地址
vi /etc/init.d/S99z_ip
//权限chmod a+x S99z_ip
/***********************************/
case "$1" in
start)
#echo "stop network"
#/etc/init.d/ S40network stop
echo "stop S45connman..."
/etc/init.d/S45connman stop
echo "restart network"
/etc/init.d/S40network restart
echo "set dns"
echo "nameserver 114.114.114.114">>/etc/resolv.conf
;;
stop)
echo "do nothing..."
;;
*)
echo "Usage: $0 {start|stop}"
esac
exit 0
vi /etc/network/interfaces
/***********************************/
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.5.9
network 192.168.5.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.5.1
二、开发板连接网络,电脑连接无线,都正常上网
三、GCC
GCC_COMPILER=/opt/atk-dlrk356x-toolchain/bin/aarch64-buildroot-linux-gnu
四、CMake
1. CMakeLists.txt
cmake_minimum_required(VERSION 3.4.1)
project(test)
message(STATUS"cmake version ${CMAKE_VERSION}")
option(ADD_TEST "option for test" OFF)
if(ADD_TEST)
add_definitions(-DTEST)
mESSage("*****************")
endif()
add_executable(test main.cpp)
2. main.cpp
#include <iostream>
int main(int arg , char** argv)
{
#ifdef TEST
printf("OK\r\n");
#else
printf("no\r\n");
#endif
}
3.build
cmake -D ADD_TEST=ON ../
五、传输文件
虚拟机Ubuntu <----->开发板
adb connect 192.168.5.9
adb devices
adb push test/ /userdata
/ / Ubuntu>>>开发板
adb pull /userdata/test/ .
/ / 开发板>>>Ubuntu
scp.exe -r test root@192.168.5.9:/userdata
/ / Windows>>>开发板
scp.exe -r test alientek@192.168.5.11:~/
/ / Windows>>Ubuntu
scp -r root@192.168.25.3:/mnt/hirain_extdata/messages.2 ./
/ / 开发>>Windows