使用SD卡转接卡连接串口与挥码枪

建议先看这两篇文章:

使用挥码枪调试幽兰内核:https://www.nanocode.cn/wiki/docs/youlan/youlan-1empe0pkfiidk
SD卡强大的扩展无法-串口功能:https://www.nanocode.cn/wiki/docs/youlan/youlansd

1.硬件清单

格蠹SD卡转接板 x1
公对公杜邦线 x6
串口转接板 x1
上位机(windows/linux) x1
幽兰代码本 x1
USB线(一端为Type-C,另一端为Type-A) x1

2.SD卡连接挥码枪

将挥码枪的1,3,5引脚与sd卡相连,已经在下面第二张图标记出来


连接之后如下图:

3.sd卡连接串口

其中GND TX RX在串口转接板上应有标注,在SD卡转接板中,GND有明确的标注,而D0TXD1RX



连接之后如下图所示:

4.把他们合在一起,如下图:

连接幽兰与上位机

SD卡插入幽兰右侧卡槽,将串口和连接挥码枪的usb口插入上位机,如下图所示:

打开nano code 和 MobaXterm

启动nano code内核调试和串口通讯可以看下面两篇文章
使用挥码枪调试幽兰内核:https://www.nanocode.cn/wiki/docs/youlan/youlan-1empe0pkfiidk
SD卡强大的扩展无法-串口功能:https://www.nanocode.cn/wiki/docs/youlan/youlansd
内核调试和串口通讯启动成功如下图所示:

下面是串口打印出来的UBOOT和内核信息

▒▒current value of RK3588_BUS_IOC_GPIO4D_IOMUX_SEL_L: 55aa
the serial port function of the SD card has been enabled
discover SD card insertion, the serial port will be redirected to print to sdmmc                                                                                     -uart2
you can enter the uboot command line by typing x5 repeatedly
PreSerial: 2, raw, 0xfeb50000
DRAM:  16 GiB
Sysmem: init
Relocation Offset: edb31000
CR: M/C/I
Using default environment

DM: v2
spi2: RK806: 2
ON=0x00, OFF=0x00
vdd_gpu_s0 750000 uV
vdd_npu_s0 750000 uV
vdd_log_s0 750000 uV
vdd_vdenc_s0 750000 uV
vdd_gpu_mem_s0 750000 uV
vdd_npu_mem_s0 750000 uV
vdd_vdenc_mem_s0 750000 uV
Failed to request rk8xx irq, ret=-16
spi2: RK806: 2
ON=0x00, OFF=0x00
vdd_cpu_big1_s0 750000 uV
vdd_cpu_big0_s0 750000 uV
vdd_cpu_lit_s0 750000 uV
vdd_cpu_big1_mem_s0 750000 uV
vdd_cpu_big0_mem_s0 750000 uV
vdd_cpu_lit_mem_s0 750000 uV
vdd_ddr_s0 850000 uV
get vp0 plane mask:0x5, primary id:2, cursor_plane:-1, from dts
get vp1 plane mask:0xa, primary id:3, cursor_plane:-1, from dts
get vp2 plane mask:0x140, primary id:8, cursor_plane:-1, from dts
get vp3 plane mask:0x280, primary id:9, cursor_plane:-1, from dts
SF: Detected sfc_nor with page size 256 Bytes, erase size 4 KiB, total 8 MiB
## Unknown partition table type 0
PartType: <NULL>
Could not find baseparameter partition
No misc partition
boot mode: normal
I2c2 speed: 100000Hz
fusb302 device ID: 0x81
vconn is already Off
Start toggling
fusb302 start drp toggling
fusb302@22: init finished
Enable charge animation display
Exit charge: due to boot modes
Rockchip UBOOT DRM driver version: v1.0.1
vp0 have layer nr:2[0 2 ], primary plane: 2
vp1 have layer nr:2[1 3 ], primary plane: 3
vp2 have layer nr:2[6 8 ], primary plane: 8
vp3 have layer nr:2[7 9 ], primary plane: 9
Using display timing dts
edp@fded0000:  detailed mode clock 148500 kHz, flags[a]
    H: 1920 1968 2000 2200
    V: 1080 1083 1089 1126
bus_format: 100e
VOP update mode to: 1920x1080p0, type: eDP1 for VP2
rockchip_vop2_init:No hdmiphypll clk0 found, use system clk
rockchip_vop2_init:No hdmiphypll clk1 found, use system clk
Link Training success!
final link rate = 0x0a, lane count = 0x02
CLK: (uboot. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 742000 KHz
  aupll 786215 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 850000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
No misc partition
Net:   No ethernet found.
Autoboot in 2 seconds
switch to partitions #0, OK
mmc0(part 0) is current device
skip mmc partition operate.
switch to partitions #0, OK
mmc0(part 0) is current device
19185517 bytes read in 116 ms (157.7 MiB/s)
13281631 bytes read in 87 ms (145.6 MiB/s)
165808 bytes read in 4 ms (39.5 MiB/s)
Uncompressed size: 48769536 = 0x2E82A00
No misc partition
## Flattened Device Tree blob at 0x17000000
   Booting using the fdt blob at 0x17000000
  'reserved-memory' ramoops@110000: addr=110000 size=f0000
   Loading Ramdisk to ead26000, end eb9d095f ... OK
   Loading Device Tree to 00000000eacfa000, end 00000000ead257a9 ... OK
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000)
Adding bank: 0x100000000 - 0x3fc000000 (size: 0x2fc000000)
Adding bank: 0x3fc500000 - 0x3fff00000 (size: 0x03a00000)
Adding bank: 0x4f0000000 - 0x500000000 (size: 0x10000000)
get chosen bootargs: root=PARTUUID=614e0000-0000 rw rootfstype=ext4 net.ifnames=                                                                                     0 biosdevname=0 splash quiet plymouth.ignore-serial-consoles rootwait earlycon=u                                                                                     art8250,mmio32,0xfeb50000 console=tty0 wifibt=ap6275s:ttyS1, will send it to ker                                                                                     nel
== DO RELOCATE == Kernel from 0x00400000 to 0x14000000
Total: 4852.583 ms

Starting YourLand kernel ...

I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Secondary CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
I/TC: Secondary CPU 4 initializing
I/TC: Secondary CPU 4 switching to normal world boot
I/TC: Secondary CPU 5 initializing
I/TC: Secondary CPU 5 switching to normal world boot
I/TC: Secondary CPU 6 initializing
I/TC: Secondary CPU 6 switching to normal world boot
I/TC: Secondary CPU 7 initializing
I/TC: Secondary CPU 7 switching to normal world boot
[    6.889766] fiq_debugger fiq_debugger.0: IRQ fiq not found
[    6.889818] fiq_debugger fiq_debugger.0: IRQ wakeup not found
[    6.889855] fiq_debugger_probe: could not install nmi irq handler
[    7.825016] mpp-iep2 fdbb0000.iep: allocate roi buffer failed
[    7.825947] rk-pcie fe150000.pcie: IRQ msi not found
[    7.825986] rk-pcie fe150000.pcie: Missing *config* reg space
[    7.826162] rk-pcie fe150000.pcie: Missing *config* reg space
[    7.826219] rk-pcie fe150000.pcie: invalid resource
[    7.829204] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_a is not found!
[    7.829242] rkvdec2_init:1010: No niu aclk reset resource define
[    7.829272] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_h is not found!
[    7.829302] rkvdec2_init:1013: No niu hclk reset resource define
[    7.830973] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_a is not found!
[    7.831005] rkvdec2_init:1010: No niu aclk reset resource define
[    7.831034] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_h is not found!
[    7.831063] rkvdec2_init:1013: No niu hclk reset resource define
[    7.837549] mpp_iommu_probe:434: failed to get device node
[    7.837582] mpp_av1dec av1d-master: failed to attach iommu
[    7.957185] rk806 spi2.0: no sleep-setting state
[    7.957229] rk806 spi2.0: no reset-setting pinctrl state
[    7.957261] rk806 spi2.0: no dvs-setting pinctrl state
[    7.996977] rk806 spi2.1: no power-off pinctrl state
[    7.997018] rk806 spi2.1: no sleep-setting state
[    7.997048] rk806 spi2.1: no reset-setting pinctrl state
[    7.997080] rk806 spi2.1: no dvs-setting pinctrl state
[    8.270946] cw2017 2-0063: Failed to register power supply
[    8.293765] bq25700-charger 2-006b: Invalid or missing extcon dev1
作者:李梓涌  创建时间:2023-07-25 13:49
最后编辑:李梓涌  更新时间:2024-11-15 17:44