Toybrick

中文 / EN

源码下载

TB-RK3399ProD/TB-RK3399ProX

git clone https://github.com/rockchip-toybrick/kernel.git -b stable

TB-RK3568X

git clone https://github.com/rockchip-toybrick/kernel.git -b develop-4.19

TB-RV1126Ds

git clone https://github.com/rockchip-toybrick/kernel.git -b rv1126-develop-4.19

源码编译

1、在kernel同级目录创建prebuilts文件夹

2、在prebuilts目录下创建gcc文件夹

3、下载交叉编译工具(linux-x86)到gcc目录

git clone https://github.com/rockchip-toybrick/linux-x86.git -b master

4、编译kernel

TB-RK3399ProD

① ./make.sh linux prod
② ./make.sh android prod

TB-RK3399ProX

① ./make.sh linux prox
② ./make.sh android prox

TB-RV1126Ds

① ./make-linux.sh arm

TB-RK3568X

为android11编译kernel

① 下载boot.img到kernel目录的上级目录,下载地址:https://eyun.baidu.com/s/3c2W6VhI#sharelink/path=%2F

② ./make-android.sh arm64 ../ rk3568-toybrick-core-android-x0 11

③ 根据‘arch/arm64/boot/dts/rockchip/rk3568-toybrick.dtsi’里的pmu_io_domains配置各路vccio的电压

为Debian编译kernel

① ./make-linux.sh arm64

② 根据‘arch/arm64/boot/dts/rockchip/rk3568-toybrick.dtsi’里的pmu_io_domains配置各路vccio的电压

5、android生成boot.img,linux生成boot_linux.img

6、注意:如果在android工程目录下编译,则不需要1-3步操作。

驱动

Mini-Pcie驱动开发

目前以Quectel EC20CFD-512-STD 4G模组为例。

驱动支持

首先需要对Linux内核驱动进行修改来支持EC20。

drivers/usb/serial/option.c

/* Quectel products using Quectel vendor ID */
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
  .driver_info = RSVD(4) },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25),
  .driver_info = RSVD(4) },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
  .driver_info = RSVD(4) },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06),
  .driver_info = RSVD(4) | RSVD(5) },

模块测试

将重新编译好的内核下载到开发板之后,重新启动,在/dev/目录下会出现如下设备节点:

/dev/ttyUSB0 
/dev/ttyUSB1 
/dev/ttyUSB2
/dev/ttyUSB3

EC20的AT端口是/dev/ttyUSB2,使用AT测试,结果如下:

#cat /dev/ttyUSB2 &
#echo -e “AT\r\n” > /dev/ttyUSB2
#AT

拨号

通过几个不同的配置文件,在拨号的时候选择相应的配置文件,现将配置文件列举如下:

编辑好这几个文件之后,便可以通过pppd进行拨号:

/etc/ppp/peers/quectel-ppp

1.png

/etc/ppp/peers/quectel-chat-connect

1.png

/etc/ppp/peers/quectel-chat-disconnect

1.png

通过pppd进行拨号:

# pppd call quectel-ppp &

如果拨号成功会出现以下打印:

pppd options in effect:
debug           # (from /etc/ppp/peers/quectel-ppp)
nodetach                # (from /etc/ppp/peers/quectel-ppp)
dump            # (from /etc/ppp/peers/quectel-ppp)
noauth          # (from /etc/ppp/peers/quectel-ppp)
user test               # (from /etc/ppp/peers/quectel-ppp)
password ??????         # (from /etc/ppp/peers/quectel-ppp)
remotename 3gppp                # (from /etc/ppp/peers/quectel-ppp)
/dev/ttyUSB3            # (from /etc/ppp/peers/quectel-ppp)
115200          # (from /etc/ppp/peers/quectel-ppp)
lock            # (from /etc/ppp/peers/quectel-ppp)
connect chat -s -v -f /etc/ppp/peers/quectel-chat-connect               # (from /etc/ppp/peers/quectel-ppp)
disconnect chat -s -v -f /etc/ppp/peers/quectel-chat-disconnect         # (from /etc/ppp/peers/quectel-ppp)
nocrtscts               # (from /etc/ppp/peers/quectel-ppp)
modem           # (from /etc/ppp/peers/quectel-ppp)
hide-password           # (from /etc/ppp/peers/quectel-ppp)
novj            # (from /etc/ppp/peers/quectel-ppp)
novjccomp               # (from /etc/ppp/peers/quectel-ppp)
ipcp-accept-local               # (from /etc/ppp/peers/quectel-ppp)
ipcp-accept-remote              # (from /etc/ppp/peers/quectel-ppp)
ipparam 3gppp           # (from /etc/ppp/peers/quectel-ppp)
noipdefault             # (from /etc/ppp/peers/quectel-ppp)
ipcp-max-failure 30             # (from /etc/ppp/peers/quectel-ppp)
defaultroute            # (from /etc/ppp/peers/quectel-ppp)
usepeerdns              # (from /etc/ppp/peers/quectel-ppp)
noccp           # (from /etc/ppp/peers/quectel-ppp)
abort on (BUSY)
abort on (NO CARRIER)
abort on (NO DIALTONE)
abort on (ERROR)
abort on (NO ANSWER)
timeout set to 30 seconds
send (AT^M)
expect (OK)
AT^M^M
OK
 -- got it

send (ATE0^M)
expect (OK)
^M
ATE0^M^M
OK
 -- got it

send (ATI;+CSUB;+CSQ;+CPIN?;+COPS?;+CGREG?;&D2^M)
expect (OK)
^M
^M
Quectel^M
EC20F^M
Revision: EC20CEFDR02A09M4G^M
^M
SubEdition: V04^M
^M
+CSQ: 14,99^M
^M
+CPIN: READY^M
^M
+COPS: 0^M
^M
+CGREG: 0,0^M
^M
OK
 -- got it

send (AT+CGDCONT=1,"IP","3gnet",,0,0^M)
expect (OK)
^M
^M
OK
 -- got it

send (ATD*99#^M)
expect (CONNECT)
^M
^M
CONNECT
 -- got it

Script chat -s -v -f /etc/ppp/peers/quectel-chat-connect finished (pid 785), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB3
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x1f2b413> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xd11eadc2> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xd11eadc2> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x1f2b413> <pcomp> <accomp>]
rcvd [LCP DiscReq id=0x1 magic=0xd11eadc2]
rcvd [CHAP Challenge id=0x1 <40aedf97298706e7675d614c0cea9175>, name = "UMTS_CHAP_SRVR"]
sent [CHAP Response id=0x1 <1bf312e7aa43615e474c49c28fbbaca5>, name = "test"]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x0]
sent [IPCP ConfNak id=0x0 <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x1 <addr 10.35.149.45> <ms-dns1 218.4.4.4> <ms-dns2 218.2.2.2>]
sent [IPCP ConfReq id=0x2 <addr 10.35.149.45> <ms-dns1 218.4.4.4> <ms-dns2 218.2.2.2>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
rcvd [IPCP ConfAck id=0x2 <addr 10.35.149.45> <ms-dns1 218.4.4.4> <ms-dns2 218.2.2.2>]
Could not determine remote IP address: defaulting to 10.64.64.64
local  IP address 10.35.149.45
remote IP address 10.64.64.64
primary   DNS address 218.4.4.4
secondary DNS address 218.2.2.

显示驱动

1、MIPI显示

1080x1920,需要在板级dts中include文件:rk3399pro-toybrick-mipi-ILI9881D.dtsi

720x1280,需要在板级dts中include文件:rk3399pro-toybrick-mipi.dtsi

例如在rk3399pro-toybrick-prox-linux-mipi.dts文件中添加:

#include "rk3399pro-toybrick-mipi.dtsi"

2、EDP显示

1536x2048,需要在板级dts中include文件:rk3399pro-toybrick-edp.dtsi

例如在rk3399pro-toybrick-prox-linux-edp.dts文件中添加:

#include "rk3399pro-toybrick-edp.dtsi"

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


返回顶部