XR829模组适配
本章节将讲解如何在 TinaSDK5 适配 xr829 模组,并生成镜像。
获取环境变量
在ubuntu上,新建一个终端,进入TinaSDK5根目录,执行以下指令:
source build/envsetup.sh
其中:
- source build/envsetup.sh :获取环境变量。
ubuntu@ubuntu1804:~/T113-i/tina5sdk-bsp$ source build/envsetup.sh
NOTE: The SDK(/home/ubuntu/T113-i/tina5sdk-bsp) was successfully loaded
load openwrt... ok
Please run lunch next for openwrt.
load buildroot,bsp...ok
Invoke . build/quick.sh from your shell to add the following functions to your environment:
croot - Changes directory to the top of the tree
cbsp - Changes directory to the bsp
cbsptest - Changes directory to the bsptest
ckernel - Changes directory to the kernel
cbrandy - Changes directory to the brandy
cboot - Changes directory to the uboot
cbr - Changes directory to the buildroot
cchips - Changes directory to the board
cconfigs - Changes directory to the board's config
cbin - Changes directory to the board's bin
cdts - Changes directory to the kernel's dts
ckernelout - Changes directory to the kernel output
cout - Changes directory to the product's output
copenssl - Changes directory to the product's openssl-1.0.0
Usage: build.sh [args]
build.sh - default build all
build.sh bootloader - only build bootloader
build.sh kernel - only build kernel
build.sh buildroot_rootfs - only build buildroot
build.sh menuconfig - edit kernel menuconfig
build.sh saveconfig - save kernel menuconfig
build.sh recovery_menuconfig - edit recovery menuconfig
build.sh recovery_saveconfig - save recovery menuconfig
build.sh buildroot_menuconfig - edit buildroot menuconfig
build.sh buildroot_saveconfig - save buildroot menuconfig
build.sh clean - clean all
build.sh distclean - distclean all
build.sh pack - pack firmware
build.sh pack_debug - pack firmware with debug info output to card0
build.sh pack_secure - pack firmware with secureboot
Usage: pack [args]
pack - pack firmware
pack -d - pack firmware with debug info output to card0
pack -s - pack firmware with secureboot
pack -sd - pack firmware with secureboot and debug info output to card0
ubuntu@ubuntu1804:~/T113-i/tina5sdk-bsp$
这样,就可以使用相应的指令来配置xr829模组。
内核设备树修改
查看原理图
对于wifi功能需要查看的引脚:
由图可知,
WL_REG_ON
对应的引脚是 ==> PB12
WL_WAKE_AP
对应的引脚是 ==> PG10
对于蓝牙功能需要查看的引脚:
由图可知,
BT_RST_N
对应的引脚是 ==> PG18
修改内核设备树
在TinaSDK源码中,进入目录/device/config/chips/t113_i/configs/evb1_auto/linux-5.4
修改目录下的内核设备树文件board.dts
vim board.dts
对于wifi设备树节点修改对应的引脚:
在普通模式下,键盘输入/wlan
,找到wlan设备树节点,点击键盘上的i
键,进入编辑模式,修改如下:
对于蓝牙设备树节点修改对应的引脚:
点击键盘的esc
键进入普通模式,输入/bt
,找到蓝牙设备树节点,点击键盘上的i
键,进入编辑模式,修改如下:
修改完成后,普通模式下,输入:wq
,回车之后,即可保存退出。
内核配置选择
进入TinaSDK源码目录,
执行./build.sh menuconfig
进入内核配置界面。
找到Device Drivers
,回车进入。
找到 Network device support
,回车进入。
找到 Wireless LAN
,回车进入。
找到XR829 WLAN support
,按住键盘M
,选为编译成内核模块。
控制键盘上的方向键,选择Save
,一路回车,保存完毕后,最后选择Exit
,直到退出为止退出。
在TinaSDK源码目录下,执行./build.sh kernel
ubuntu@dshanpi:~/meihao/t113i_tinasdk5.0-v1$ ./build.sh kernel
========ACTION List: build_kernel ;========
options :
INFO: build kernel ...
INFO: prepare_buildserver
INFO: Prepare toolchain ...
Building kernel
...
Copy boot.img to output directory ...
sun8iw20p1 compile all(Kernel+modules+boot.img) successful
INFO: build dts ...
INFO: Prepare toolchain ...
removed '/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/evb1_auto/buildroot/.board.dtb.d.dtc.tmp'
removed '/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/evb1_auto/buildroot/.board.dtb.dts.tmp'
'/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/kernel/build/arch/arm/boot/dts/.board.dtb.d.dtc.tmp' -> '/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/evb1_auto/buildroot/.board.dtb.d.dtc.tmp'
'/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/kernel/build/arch/arm/boot/dts/.board.dtb.dts.tmp' -> '/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/evb1_auto/buildroot/.board.dtb.dts.tmp'
'/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/kernel/staging/sunxi.dtb' -> '/home/ubuntu/meihao/t113i_tinasdk5.0-v1/out/t113_i/evb1_auto/buildroot/sunxi.dtb'
ubuntu@dshanpi:~/meihao/t113i_tinasdk5.0-v1$