续这位仁兄的贴子:https://bbs.aw-ol.com/topic/263
屏幕链接:https://item.taobao.com/item.htm?id=623507778498
转接板工程:
坑1:这个屏幕竟然是1lane,并非2lane。
坑2:卖家没给具体时序参数,看来得从屏幕上iic配置抓。
还没详细调时序参数,但初步已有显示。
软件过几天有空了详细调试后整理上传。
续这位仁兄的贴子:https://bbs.aw-ol.com/topic/263
屏幕链接:https://item.taobao.com/item.htm?id=623507778498
转接板工程:
还没详细调时序参数,但初步已有显示。
软件过几天有空了详细调试后整理上传。
固件,直接去资料页面,百度云下载就行。
附个H618工程版图片
终于lay到尾声,能不能跑起来得看运气。
当时MCore-H616核心板有几个缺点:
1、显示仅HDMI,和几乎没啥用的cvbs
2、核心板没带EMMC,导致只能配合TF卡运行
3、内存是单颗粒DDR3L,导致带宽有限
然后,就尝试lay了一下R818,这是芯片框图:
R818更侧重于本地显示和CSI,可直接驱动 DSI/LVDS/RGB 这种接口的屏幕,其他资源和H616相当,惊喜是默认工规,有这类场景的可以多关注关注。
核心板带EMMC,最大64G还是128G来着到时候再说。
内存是LPDDR4,32bit的数据线,最大4GB可拉满R818的胃口。
另外芯片本体更小,所以这次将R818+EMMC+LPDDR4+PMU(带锂电池管理)整体做到了3x3cm。并且预留屏蔽罩安装。商业版本可选择焊接A133。
系统方面除了本身提供的Android10以外,还有Tina-Linux。所以到时做完会发布Tina,ArmBian,Android三套系统。
续前贴:https://bbs.aw-ol.com/topic/311/
当时使用D1开发板驱动了,因D1的mipi是30pin,需要转接才能接树莓DSI屏。
麻雀设计的时候考虑到这点,直接板载的15Pin,所以直接接上就好。
效果:
代码:(board.dts 和uboot-board.dts都替换下边的)
&lcd0 {
lcd_used = <1>;
lcd_driver_name = "tft08006";
lcd_backlight = <100>;
lcd_if = <4>;
lcd_x = <800>;
lcd_y = <480>;
lcd_width = <52>;
lcd_height = <52>;
lcd_dclk_freq = <33>;
lcd_pwm_used = <1>;
lcd_pwm_ch = <2>;
lcd_pwm_freq = <1000>;
lcd_pwm_pol = <0>;
lcd_pwm_max_limit = <255>;
/*
lcd_hbp = <32>;
lcd_ht = <868>;
lcd_hspw = <4>;
lcd_vbp = <12>;
lcd_vt = <500>;
lcd_vspw = <4>;
*/
lcd_hbp = <32>;
lcd_ht = <868>;
lcd_hspw = <4>;
lcd_vbp = <10>;
lcd_vt = <520>;
lcd_vspw = <4>;
lcd_dsi_if = <0>;
lcd_dsi_lane = <1>;
lcd_lvds_if = <0>;
lcd_lvds_colordepth = <0>;
lcd_lvds_mode = <0>;
lcd_frm = <0>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_io_phase = <0x0000>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
lcd_fsync_en = <0>;
lcd_fsync_act_time = <1000>;
lcd_fsync_dis_time = <1000>;
lcd_fsync_pol = <0>;
deu_mode = <0>;
lcdgamma4iep = <22>;
smart_color = <90>;
/* lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;*/
pinctrl-0 = <&dsi4lane_pins_a>;
pinctrl-1 = <&dsi4lane_pins_b>;
};
首先,查原理图,GT911触摸挂在TWI2上(PE12,PE13),CTP中断PB3,CTP复位控制:PB2
然后修改对应dts的twi2部分(Tina-Linux/device/config/chips/t113/configs/mq_r/linux-5.4/board.dts),修改好如下:
make kernel_menuconfig
Device Drivers --->
Input device support --->
[*] Touchscreens --->
[M] gt9xxnew touchscreen driver
检查启动模块加载控制:Tina-Linux/target/allwinner/t113-mq_r/busybox-init-base-files/etc/init.d/rc.modules
文件内容如下,这里我们重点将gt9xxnew_ts.ko前的注释去掉,同时根据实际mangopi板子选择需要加载的wifi驱动模块。
#!/bin/sh
echo "------run rc.modules file-----"
#export boot_partition=$(fw_printenv -n boot_partition 2>/dev/null)
# if [ x${boot_partition} == xboot ];then
/sbin/insmod /lib/modules/5.4.61/usb-storage.ko
/sbin/insmod /lib/modules/5.4.61/sunxi_gpadc.ko
/sbin/insmod /lib/modules/5.4.61/gt9xxnew_ts.ko
echo 0x07090160 0x083F10F7 > /sys/class/sunxi_dump/write
# /sbin/insmod /lib/modules/5.4.61/8723ds.ko
/sbin/insmod /lib/modules/5.4.61/8189fs.ko
sleep 4
wpa_supplicant -Dnl80211 -iwlan0 -c /etc/wifi/wpa_supplicant.conf -B
# fi
然后编译打包:make;pack
[ 6.076660] sunxi_gpadc_init,2151, success
[ 6.081641] sunxi_gpadc_setup: get channel scan data failed
[ 6.088244] input: sunxi-gpadc0 as /devices/virtual/input/input1
[ 6.100435] get ctp_power is fail, -22
[ 6.104646] get ctp_power_ldo_vol is fail, -22
[ 6.109692] sunxi_ctp_startup: ctp_power_io is invalid.
[ 6.115586] get ctp_gesture_wakeup fail, no gesture wakeup
[ 6.121812] gt9xxnew_ts 2-0014: 2-0014 supply ctp not found, using dummy regulator
[ 6.329053] input: gt9xxnew_ts as /devices/virtual/input/input2
此时得到gt911的设备节点是event2:
root@TinaLinux:/# ls /dev/input/event*
/dev/input/event0 /dev/input/event1 /dev/input/event2
因为我们的tina-linux默认勾选了lvgl8,所以直接修改文件461行即可:/home/mango/1/Tina-Linux/package/gui/littlevgl-8/lv_examples/src/lv_drv_conf.h
重新打包编译:m;p
root@TinaLinux:/# lv_examples 0
wh=800x480, vwh=800x480, bpp=32, rotated=0
头铁没注意看官方默认版本是14.04,总体来说还挺顺利,编译过程中遇到小坑记录一下。
https://d1.docs.allwinnertech.com/study/study_2getsdk/
repo branch 输出是 product-smartx-d1-tina-v1.0-release
参考官方:https://d1.docs.allwinnertech.com/study/study_3ubuntu/
gdbusauth.c: In function '_g_dbus_auth_run_server':
gdbusauth.c:1298:11: error: '%s' directive argument is null [-Werror=format-overflow=]
1298 | debug_print ("SERVER: WaitingForBegin, read '%s'", line);
解决:
out/d1-nezha/compile_dir/target/host/glib-2.50.1/gio/gdbusauth.c 将1298行的挪到 if语句后边,改完如下:
1294 line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream),
1295 &line_length,
1296 cancellable,
1297 error);
1298 //debug_print ("SERVER: WaitingForBegin, read '%s'", line);
1299 if (line == NULL)
1300 goto out;
1301 debug_print ("SERVER: WaitingForBegin, read '%s'", line);
gdbusmessage.c: In function 'g_dbus_message_to_blob':
gdbusmessage.c:2698:30: error: '%s' directive argument is null [-Werror=format-overflow=]
2698 | tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
解决方法:同坑1,把gio/gdbusmessage.c: 2698行的tupled_signature_str = g_strdup_printf ("(%s)", signature_str);移到if else 语句块后面
2697 gchar *tupled_signature_str;
2698 //tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
2699 if (signature == NULL)
2700 {
2701 g_set_error (error,
2702 G_IO_ERROR,
2703 G_IO_ERROR_INVALID_ARGUMENT,
---
2717 goto out;
2718 }
2719 tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
2720 g_free (tupled_signature_str);
./mkerrcodes | gawk -f ./mkerrcodes2.awk >code-from-errno.h
gawk: ./mkerrcodes2.awk:94: warning: regexp escape sequence `\#' is not a known regexp operator
gawk -f ./mkstrtable.awk -v textidx=2 -v nogettext=1 \
./err-sources.h.in >err-sources-sym.h
gawk: ./mkstrtable.awk:113: warning: regexp escape sequence `\#' is not a known regexp operator
比较省事的办法是gawk降级。
sudo apt autoremove gawk
wget https://ftp.gnu.org/gnu/gawk/gawk-4.2.1.tar.gz
然后解压,./configure --prefix=/usr --libexecdir=/usr/lib , make , make check , sudo make install , 再检查gawk:
mg@Ubuntu:~/tina-d1-open$ gawk --version
GNU Awk 4.2.1, API: 2.0
然后清理一遍之前输出: rm -r out/d1-nezha/compile_dir/target/libgpg-error-1.27
再 make -j1 编译通过。
@lucky123456 应该不行,RMII没有独立的tx-ck和rx-ck,所以共用一个时钟源来同步。将PE10打开看看是否有50M时钟给外部phy。
剩下就是检查外边引脚电压是否匹配。