全志T113方案调试

全志T113项目根文件系统使用openwrt

一、编译问题

1.1、./build.sh pack failed

script update sboot ok
./pack: line 1095: /home/workspace/SourceCode/T113_Tina5.0_v1.1/tools/pack/pctools/linux/fsbuild200/fsbuild: No such file or directory
do not set LINUX_DTBO_FILE
pack boot package
content_count=3
2:LICHEE_REDUNDANT_ENV_SIZE:0x20000
--mkenvimage create redundant env data!--
--redundant env data size 0x20000---
verity not supported yet
packing for linux
normal
commit : f7388902e9-dirty
mbr count = 4

partitation file Path=/home/workspace/SourceCode/T113_Tina5.0_v1.1/out/t113s2/evb1/pack_out/sys_partition.bin
mbr_name file Path=/home/workspace/SourceCode/T113_Tina5.0_v1.1/out/t113s2/evb1/pack_out/sunxi_mbr.fex
download_name file Path=/home/workspace/SourceCode/T113_Tina5.0_v1.1/out/t113s2/evb1/pack_out/dlinfo.fex

mbr size = 252
mbr magic softw411
disk name=boot-resource
ERROR:  unable to open file boot-resource.fex
update_for_part_info -1
ERROR: update mbr file fail
ERROR: update_mbr failed

解决方法:

sudo apt-get install libc6:i386 libgcc1:i386 libstdc++6:i386 -y

二、烧录问题

芯片选错,主板贴T113-S3,执行./build.sh config时需要选t113

三、系统运行问题

3.1、报错 

这种报错打印暂时不影响系统运行

3.2、打印输出乱码

设备树uart配置问题:

①、uart pin脚可能被别的设备占用(我这边是lcd占用了uart3 pin脚,此方案不需要用到lcd,直接屏蔽)

②、uart pin没配置对(默认uart0,改为uart3)

diff --git a/configs/evb1/linux-5.4/config-5.4 b/configs/evb1/linux-5.4/config-5.4
index ee3d8a2..a41a7af 100755
--- a/configs/evb1/linux-5.4/config-5.4
+++ b/configs/evb1/linux-5.4/config-5.4
@@ -175,13 +175,6 @@ CONFIG_MEDIA_CAMERA_SUPPORT=y
 CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=y
 # CONFIG_USB_GSPCA is not set
-CONFIG_FB=y
-CONFIG_DISP2_SUNXI=y
-# CONFIG_LCD_SUPPORT_HE0801A068 is not set
-# CONFIG_LCD_SUPPORT_WILLIAMLCD is not set
-# CONFIG_LCD_SUPPORT_LQ101R1SX03 is not set
-# CONFIG_LCD_SUPPORT_INET_DSI_PANEL is not set
-# CONFIG_LCD_SUPPORT_CC08021801_310_800X1280 is not set
 CONFIG_SOUND=y
 CONFIG_SND=y
 # CONFIG_SND_SUPPORT_OLD_API is not set

commit d565e69159563ae21cfdb72ecca96e54eac926fd
Author: zoipuus <chenwenlong@hct.hk>
Date:   Fri Apr 12 18:21:12 2024 -0700

    Set the uart debug port to uart3 for t113-s3 chip

diff --git a/configs/evb1/env.cfg b/configs/evb1/env.cfg
index 3fd36ed..611714a 100755
--- a/configs/evb1/env.cfg
+++ b/configs/evb1/env.cfg
@@ -2,7 +2,7 @@
 #kernel command arguments
 earlyprintk=sunxi-uart,0x02500000
 initcall_debug=0
-console=ttyS0,115200
+console=ttyS3,115200
 nand_root=/dev/ubiblock0_5
 mmc_root=/dev/mmcblk0p5
 mtd_name=sys
diff --git a/configs/evb1/linux-5.4/board.dts b/configs/evb1/linux-5.4/board.dts
index 8882736..17aaa37 100755
--- a/configs/evb1/linux-5.4/board.dts
+++ b/configs/evb1/linux-5.4/board.dts
@@ -315,11 +315,15 @@
        uart3_pins_a: uart3_pins@0 {  /* For EVB1 board */
                pins = "PD10", "PD11";
                function = "uart3";
-               muxsel = <5>;
                drive-strength = <10>;
                bias-pull-up;
        };
 
+       uart3_pins_b: uart3_pins@1 {
+               pins = "PD10", "PD11";
+               function = "gpio_in";
+       };
+
        twi0_pins_a: twi0@0 {
                pins = "PB10", "PB11";  /*sck sda*/
                function = "twi0";
@@ -591,7 +595,7 @@
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&uart0_pins_a>;
        pinctrl-1 = <&uart0_pins_b>;
-       status = "okay";
+       status = "disabled";
 };
 
 &uart1 {
@@ -609,11 +613,10 @@
 };
 
 &uart3 {
-       compatible = "allwinner,sun20iw1-dsp-uart";
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&uart3_pins_a>;
-       pinctrl-1 = <&uart3_pins_a>;
-       status = "disabled";
+       pinctrl-1 = <&uart3_pins_b>;
+       status = "okay";
 };
 
 &soc {
diff --git a/configs/evb1/linux-5.4/config-5.4 b/configs/evb1/linux-5.4/config-5.4
old mode 100644
new mode 100755
index 6c593dd..ee3d8a2
--- a/configs/evb1/linux-5.4/config-5.4
+++ b/configs/evb1/linux-5.4/config-5.4
@@ -36,7 +36,7 @@ CONFIG_ARM_PSCI=y
 CONFIG_OABI_COMPAT=y
 # CONFIG_ARM_MODULE_PLTS is not set
 # CONFIG_ATAGS is not set
-CONFIG_CMDLINE="loglevel=8 initcall_debug=1 console=ttyS0 init=/init"
+CONFIG_CMDLINE="loglevel=8 initcall_debug=1 console=ttyS3 init=/init"
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_FREQ_TIMES=y
@@ -309,5 +309,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=20
 # CONFIG_FTRACE is not set
 # CONFIG_RUNTIME_TESTING_MENU is not set
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_UART_PHYS=0x02500000
-CONFIG_DEBUG_UART_VIRT=0xf2500000
+CONFIG_DEBUG_SUNXI_UART3=y
+CONFIG_DEBUG_UART_PHYS=0x02500c00
+CONFIG_DEBUG_UART_VIRT=0xf2500c00
+CONFIG_EARLY_PRINTK=y
diff --git a/configs/evb1/sys_config.fex b/configs/evb1/sys_config.fex
index 993cfef..45f441f 100755
--- a/configs/evb1/sys_config.fex
+++ b/configs/evb1/sys_config.fex
@@ -199,9 +199,9 @@ twi_sda  = port:PC1<3><1><default><default>
 ;uart_debug_rx  |Boot串口接收的GPIO配置     |
 ;----------------------------------------------------------------------------------
 [uart_para]
-uart_debug_port = 0
-uart_debug_tx   = port:PF02<3><1><default><default>
-uart_debug_rx   = port:PF04<3><1><default><default>
+uart_debug_port = 3
+uart_debug_tx   = port:PD10<5><1><default><default>
+uart_debug_rx   = port:PD11<5><1><default><default>

 3.3、can't open /dev/ttyS0: No such file or directory

openwrt控制台参数默认uart0,改为uart3即可

diff --git a/t113-evb1/busybox-init-base-files/etc/inittab b/t113-evb1/busybox-init-base-files/etc/inittab
index 89ad71c..bbce2b5 100755
--- a/t113-evb1/busybox-init-base-files/etc/inittab
+++ b/t113-evb1/busybox-init-base-files/etc/inittab
@@ -27,8 +27,8 @@
 ::sysinit:/etc/init.d/rcS boot
 
 # Put a getty on the serial port
-ttyS0::respawn:-/bin/sh
-#ttyS0::respawn:/sbin/getty -n -L ttyS0 115200 vt100 -n -l /bin/sh # GENERIC_SERIAL
+ttyS3::respawn:-/bin/sh
+#ttyS3::respawn:/sbin/getty -n -L ttyS3 115200 vt100 -n -l /bin/sh # GENERIC_SERIAL
 
 # Stuff to do for the 3-finger salute
 #::ctrlaltdel:/sbin/reboot

3.4、 USB识别不到设备

设备树配置问题 

diff --git a/configs/evb1/linux-5.4/board.dts b/configs/evb1/linux-5.4/board.dts
index f723970..940b043 100755
--- a/configs/evb1/linux-5.4/board.dts
+++ b/configs/evb1/linux-5.4/board.dts
@@ -877,7 +877,7 @@ tvd_row*tvd_column is the total tvd channel number to be used in multichannel mo
  */
 &usbc0 {
        device_type = "usbc0";
-       usb_port_type = <0x2>;
+       usb_port_type = <0x0>;
        usb_detect_type = <0x1>;
        usb_detect_mode = <0>;
        usb_id_gpio = <&pio PB 6 GPIO_ACTIVE_HIGH>;

四、openwrt新增模块

在kernel中添加模块源码后,编译可以得到.ko文件,但是openwrt不配置的话无法打包到固件中

以下是添加fcs950r和4g模块的.ko文件配置 

/home/workspace/T113_Tina5.0_v1.1/openwrt/target/t113$ git diff .
diff --git a/t113-common/modules.mk b/t113-common/modules.mk
index 2e76194..768465f 100755
--- a/t113-common/modules.mk
+++ b/t113-common/modules.mk
@@ -252,6 +252,24 @@ endef
 
 $(eval $(call KernelPackage,net-rtl8821cs))
 
+define KernelPackage/net-fcs950r
+  SUBMENU:=$(WIRELESS_MENU)
+  TITLE:=FCS950R support (staging)
+  FILES:=$(LINUX_DIR)/drivers/net/wireless/wlan_src/8821cs.ko
+  AUTOLOAD:=$(call AutoProbe,8821cs)
+endef
+
+$(eval $(call KernelPackage,net-fcs950r))
+
+define KernelPackage/net-quectel_4g
+  SUBMENU:=$(WIRELESS_MENU)
+  TITLE:=QUECTEL 4G support (staging)
+  FILES:=$(LINUX_DIR)/drivers/net/wireless/quectel_4g/quectel_4g.ko
+  AUTOLOAD:=$(call AutoProbe,quectel_4g)
+endef
+
+$(eval $(call KernelPackage,net-quectel_4g))
+
 define KernelPackage/sunxi-disp
   SUBMENU:=$(VIDEO_MENU)
   TITLE:=sunxi-disp support

 在SDK代码根目录执行make menuconfig,把新增的两个配置选上

保存后退出

diff --git a/t113-evb1/defconfig b/t113-evb1/defconfig
index 8e7931d..dc6afc2 100755
--- a/t113-evb1/defconfig
+++ b/t113-evb1/defconfig
@@ -4,7 +4,6 @@
 #
 CONFIG_MODULES=y
 CONFIG_HAVE_DOT_CONFIG=y
-# CONFIG_TARGET_t113_awol_evb1 is not set
 # CONFIG_TARGET_t113_dev is not set
 CONFIG_TARGET_t113_evb1=y
 # CONFIG_TARGET_t113_evb1_auto is not set
@@ -3981,6 +3980,8 @@ CONFIG_PACKAGE_kmod-cfg80211=y
 # CONFIG_PACKAGE_kmod-mt76x2u is not set
 # CONFIG_PACKAGE_kmod-mwifiex-sdio is not set
 # CONFIG_PACKAGE_kmod-net-broadcom is not set
+CONFIG_PACKAGE_kmod-net-fcs950r=y
+CONFIG_PACKAGE_kmod-net-quectel_4g=y
 # CONFIG_PACKAGE_kmod-net-rtl8192su is not set
 # CONFIG_PACKAGE_kmod-net-rtl8821cs is not set
 CONFIG_PACKAGE_kmod-net-xr819s=y

 编译、烧录固件

root@TinaLinux:/# ls -l /lib/modules/5.4.61/
-rw-r--r--    1 root     root       3431100 May 18  2023 8821cs.ko
-rw-r--r--    1 root     root         49752 May 18  2023 gt9xxnew_ts.ko
-rw-r--r--    1 root     root          4908 May 18  2023 quectel_4g.ko
-rw-r--r--    1 root     root         24508 May 18  2023 sunxi_gpadc.ko
-rw-r--r--    1 root     root         76188 May 18  2023 usb-storage.ko
-rw-r--r--    1 root     root          8052 May 18  2023 wireless_switch.ko
-rw-r--r--    1 root     root        517796 May 18  2023 xr819.ko

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zoipuus

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值