开发环境使用飞凌提供的ubuntu18.0.4,编译环境使用的是飞凌提供的flexbuild,flexbuild是 NXP 官方提供的 QorIQ LS 系列的编译环境,飞凌在 NXP 官方版本的 flexbuild 的基础上针对 OK1028A-C 平台进行了定制修改。
1、准备工作
- OK1028-linux-fs 源码目录结构
- 清除之前编译文件
flex-builder -i clean-linux
- 编译内核
flex-builder -c linux -a arm64 -m ls1028ardb
注意:配置内核前需要先将内核编译一遍,不然配置内核会报错。
错误信息:
/bin/sh: 1: scripts/mod/modpost: not found
/home/forlinx/work/OK1028-linux-fs/packages/linux/OK1028-linux-kernel/scripts/Makefile.modpost:93: recipe for target ‘__modpost’ failed
make[5]: *** [__modpost] Error 127
/home/forlinx/work/OK1028-linux-fs/packages/linux/OK1028-linux-kernel/Makefile:1609: recipe for target ‘modules’ failed
make[4]: *** [modules] Error 2
make[4]: Leaving directory ‘/home/forlinx/work/OK1028-linux-fs/build/linux/linux/arm64/LS/output’
Makefile:179: recipe for target ‘sub-make’ failed
make[3]: *** [sub-make] Error 2
make[3]: Leaving directory ‘/home/forlinx/work/OK1028-linux-fs/packages/linux/OK1028-linux-kernel’
Makefile:187: recipe for target ‘all’ failed
make[2]: *** [all] Error 2
make[2]: Leaving directory ‘/home/forlinx/work/OK1028-linux-fs/packages/linux/gpu_module’
Makefile:135: recipe for target ‘gpu_module’ failed
make[1]: *** [gpu_module] Error 2
make[1]: Leaving directory ‘/home/forlinx/work/OK1028-linux-fs/packages/linux’
Makefile:22: recipe for target ‘linux’ failed
make: *** [linux] Error 2
make: Leaving directory ‘/home/forlinx/work/OK1028-linux-fs’
2、配置内核
flex-builder -c linux:custom -m ls1028ardb -a arm64
- 配置USB支持设备
-> Device Drivers
-> <*> USB support
-> <*> Support for Host-side USB
-> <*> EHCI HCD (USB 2.0) support
-> <*> OHCI HCD (USB 1.1) support
-> <*> ChipIdea Highspeed Dual Role Controller
-> [*] ChipIdea device controller
-> [*] ChipIdea host controller
- 配置支持WIFI设备
-> Device Drivers
-> [*] Network device support
-> [*] Wireless LAN
-> <*> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)
-> [*] Support downloading firmware images with Host AP driver
-> [*] Support for non-volatile firmware download
- 配置支持IEEE 802.11
-> Networking support
-> -*- Wireless
-> [*] cfg80211 wireless extensions compatibility
-> <*> Generic IEEE 802.11 Networking Stack (mac80211)
- 配置支持RFKILL
-> Networking support
-> <*>RF switch subsystem support
-> [*]RF switch input support
-> <*> GPIO RFKILL driver
- 配置支持RTL8192CU
-> Device Drivers
-> [*] Network device support
-> [*] Wireless LAN
-><*> RTL8723AU/RTL8188[CR]U/RTL819[12]CU (mac80211) support
-><*> Realtek rtlwifi family of devices
-><*>Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter
3、编译内核
- 更新config文件
cp build/linux/linux/arm64/LS/output/.config packages/linux/linux/arch/arm64/configs/ok1028_defconfig
- 编译内核
flex-builder -c linux -a arm64 -m ls1028ardb
- 将编译好的内核更新到 build/images 目录
flex-builder -i mkboot -m ls1028ardb
4、开发板WIFI配置
- /etc/目录下新建wpa_supplicant.conf文件
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
network={
ssid="xxx" // WIFI名称
psk="xxx" // WIFI密码
}
- 将固件包放入/lib/firmware下(固件包没有的可以点击RTL8192CU固件下载)
mkdir /lib/firmware/rtlwifi
cp rtl8192cufw_TMSC.bin /lib/firmware/rtlwifi/
reboot
RTL8188 - RLT8192固件下载 firmware
https://download.csdn.net/download/qq_40555661/86245086
- 启动WIFI
mkdir /var/run/wpa_supplicant -p
ifconfig wlan0 up # 打开WIFI
wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i wlan0 & # 配置并连接WIFI
route del default # 删除默认路由
ip route add default via 192.168.0.1 dev wlan0 # 添加默认路由从wlan0网卡进行路由转发
udhcpc -i wlan0 # 动态分配wlan0 IP地址
echo "nameserver 114.114.114.114" > /etc/resolv.conf # 设置DNS
ping www.baidu.com # 查验开发板联网状态
附件:没积分可以去这个地址下载固件包ftp.cn.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-realtek_0.43_all.deb