April 24, 2021 - Reading time: 9 minutes
Get access to the serial console on a Hantek oscilloscope. I'm doing this on a DSO2C10, but the process is the same on all the scopes in this range.
First we need to find the UART interface. The main processor is an Allwinner F1C200s, based on the ARM9 architecture. Fortunately the datasheet is available, and on page 14 we find something like this:
GPIOE
PE0 | GPIO | ... | UART0_RX |
PE1 | GPIO | ... | UART0_TX |
Checking the pinout on page 20 tells us we're looking for pins 48 (TX) and 49 (RX).
Looking at the mainboard from the back, the processor is on the right side near the ribbon cable. The pins we want are the 4th and 5th on the "top" side of the chip.
Don't be fooled by the pads marked TXD and RXD. They are connected to pins 63 and 64, which have something to do with touch panel input according to the datasheet. Since this device doesn't have a touch panel I don't know what they're up to, other than confusing me.
Now we need a convenient place to tap into those lines. You could solder straight to the legs of the IC of course, but that pitch is a bit tight for me. If we trace the lines down to L14, there are a pair of vias we can use. I used 30 gauge solid-core wire.
Note: Alternatively, there's a pair of empty footprints near the USB connect, marked R49 and R51. See 4th image.
We need some sort of serial interface. I'm using a Bus Pirate because it's what I have lying around, but any will do. Of course we need to connect the wires to our interface, just remember RX -> TX, and TX -> RX. Ground can be connected anywhere convenient, like the chassis.
Connect to the serial interface with your favourite terminal software, I'm currently using MobaXterm. For the Bus Pirate the settings are 115200bps, 8N1, no flow control.
Once connected, press enter and you should see a prompt like "HiZ>". Type m to set the mode. Highlighted lines are my input.
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
10. PIC
11. DIO
x. exit(without change)
(1)>3
Set serial port speed: (bps)
1. 300
2. 1200
3. 2400
4. 4800
5. 9600
6. 19200
7. 38400
8. 57600
9. 115200
10. BRG raw value
(1)>9
Data bits and parity:
1. 8, NONE *default
2. 8, EVEN
3. 8, ODD
4. 9, NONE
(1)>1
Stop bits:
1. 1 *default
2. 2
(1)>1
Receive polarity:
1. Idle 1 *default
2. Idle 0
(1)>1
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)>1
Clutch disengaged!!!
To finish setup, start up the power supplies with command 'W'
Ready
UART>P
Pull-up resistors ON
Warning: no voltage on Vpullup pin
UART>W
POWER SUPPLIES ON
Clutch engaged!!!
UART>(1)
UART bridge
Reset to exit
Are you sure? y
Once that's done, we can power up the scope and cross our fingers.
Serial output on boot:
U-Boot SPL 2018.01 (Sep 12 2020 - 11:53:07)
DRAM: 64 MiB
Trying to boot from sunxi SPI
U-Boot 2018.01 (Sep 12 2020 - 11:53:07 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 64 MiB
show_dram_config:82ea5bc0, 82ea7ee8, 0, 82fc8000
******************************
SPI-NAND: W25N01GV is found size: 128MB.
*** Warning - bad CRC, using default environment
cfg_video_init:in:e59ff014
Setting up a 800x480 lcd console (overscan 0x0)
SPI-NAND: W25N01GV is found size: 128MB.
sunxi_lcdc_backlight_enable_user pwm 80
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
SPI-NAND: W25N01GV is found size: 128MB.
SPI-NAND: 3145728 bytes @ 0xf00000 Read: OK
SPI-NAND: 20480 bytes @ 0xd00000 Read: OK
## Booting kernel from Legacy Image at 80500000 ...
Image Name: Linux-5.2.0-licheepi-nano
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2940968 Bytes = 2.8 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Kernel Image ... OK
Loading Device Tree to 816fa000, end 816ffb8c ... OK
add fb mem rsv ok, 83f44000, bc000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.2.0-licheepi-nano (root@ubuntu) (gcc version 5.4.0 (Buildroot 2017.02.5)) #120 Wed Oct 14 11:14:41 CST 2020
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: earlyprintk console=ttyS0,115200 ubi.mtd=4 ubi.fm_autoconvert=1 root=ubi0:rootfs rw rootfstype=ubifs
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 54500K/65536K available (5120K kernel code, 181K rwdata, 1928K rodata, 1024K init, 207K bss, 11036K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x254/0x430 with crng_init=0
[ 0.000048] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000126] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000707] Console: colour dummy device 80x30
[ 0.000799] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070249] pid_max: default: 32768 minimum: 301
[ 0.070700] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070741] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072434] CPU: Testing write buffer coherency: ok
[ 0.074440] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076718] devtmpfs: initialized
[ 0.085144] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.085202] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.085501] pinctrl core: initialized pinctrl subsystem
[ 0.087581] NET: Registered protocol family 16
[ 0.089131] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.091398] cpuidle: using governor menu
[ 0.126597] SCSI subsystem initialized
[ 0.127014] usbcore: registered new interface driver usbfs
[ 0.127195] usbcore: registered new interface driver hub
[ 0.127390] usbcore: registered new device driver usb
[ 0.130063] clocksource: Switched to clocksource timer
[ 0.160029] NET: Registered protocol family 1
[ 0.161231] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.163721] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.180743] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.195634] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.198043] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[ 0.209385] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.214075] printk: console [ttyS0] disabled
[ 0.234341] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 25, base_baud = 6250000) is a 16550A
[ 0.520290] printk: console [ttyS0] enabled
[ 0.547082] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 26, base_baud = 6250000) is a 16550A
[ 0.568682] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.582549] loop: module loaded
[ 0.586668] SCSI Media Changer driver v0.25
[ 0.595012] spi-nand spi0.0: Winbond SPI NAND was found.
[ 0.600480] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[ 0.609133] 6 fixed-partitions partitions found on MTD device spi0.0
[ 0.615584] Creating 6 MTD partitions on "spi0.0":
[ 0.620469] 0x000000000000-0x000000300000 : "boot"
[ 0.631299] random: fast init done
[ 0.642690] 0x000000300000-0x000000d00000 : "cache"
[ 0.684999] 0x000000d00000-0x000000f00000 : "dtb"
[ 0.700294] 0x000000f00000-0x000001500000 : "kernel"
[ 0.729103] 0x000001500000-0x000006400000 : "rootfs"
[ 1.003773] 0x000006400000-0x000008000000 : "data"
[ 1.102622] random: crng init done
[ 1.113918] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.120588] ehci-platform: EHCI generic platform driver
[ 1.126185] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.132510] ohci-platform: OHCI generic platform driver
[ 1.138211] usbcore: registered new interface driver usb-storage
[ 1.145410] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.157414] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.163340] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.173524] hub 1-0:1.0: USB hub found
[ 1.177431] hub 1-0:1.0: 1 port detected
[ 1.184132] i2c /dev entries driver
[ 1.192615] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.201518] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.208092] NET: Registered protocol family 17
[ 1.227368] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled
[ 1.237939] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc06e92d4)
[ 1.247000] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc06e7f2c)
[ 1.254822] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.261487] [drm] No driver support for vblank timestamp query.
[ 1.268723] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 1.276683] panel_simple_get_fixed_modes:4119
[ 1.284654] sun4i-drm display-engine: __drm_fb_helper_initial_config_and_unlock:c3ec4570, 631b38dd, 768000, 503903ba
[ 1.511955] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[ 1.520226] ubi0: default fastmap pool size: 30
[ 1.524773] ubi0: default fastmap WL pool size: 15
[ 1.529608] ubi0: attaching mtd4
[ 1.830872] ubi0: attached by fastmap
[ 1.834615] ubi0: fastmap pool size: 30
[ 1.838450] ubi0: fastmap WL pool size: 15
[ 1.866619] ubi0: attached mtd4 (name "rootfs", size 79 MiB)
[ 1.872469] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1.879336] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 1.886196] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1.893189] ubi0: good PEBs: 632, bad PEBs: 0, corrupted PEBs: 0
[ 1.899185] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 1.906452] ubi0: max/mean erase counter: 11/2, WL threshold: 4096, image sequence number: 0
[ 1.914910] ubi0: available PEBs: 0, total reserved PEBs: 632, PEBs reserved for bad PEB handling: 20
[ 1.924764] vcc3v0: disabling
[ 1.927753] vcc5v0: disabling
[ 1.931115] ubi0: background thread "ubi_bgt0d" started, PID 36
[ 1.950705] UBIFS (ubi0:0): Mounting in unauthenticated mode
[ 1.959142] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 37
[ 2.066315] UBIFS (ubi0:0): recovery needed
[ 2.355384] UBIFS (ubi0:0): recovery completed
[ 2.360246] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[ 2.367647] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 2.377650] UBIFS (ubi0:0): FS size: 74407936 bytes (70 MiB, 586 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[ 2.388114] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[ 2.394016] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 4742F53D-A372-47B1-A487-8782781792C5, small LPT model
[ 2.416260] VFS: Mounted root (ubifs filesystem) on device 0:14.
[ 2.427982] devtmpfs: mounted
[ 2.436157] Freeing unused kernel memory: 1024K
[ 2.440889] Run /sbin/init as init process
Starting mdev...
System Normal start ...
Welcome to phoenix
phoenix login: anolis_picture_width:21 picture!=NULL failed.
anolis_picture_width:21 picture!=NULL failed.
anolis_picture_width:21 picture!=NULL failed.
anolis_picture_width:21 picture!=NULL failed.
anolis_picture_width:21 picture!=NULL failed.
util_thread_start_with_sched_priority:thread 0xa15a18 is running
[ 6.846122] spi_fpga_tn652: loading out-of-tree module taints kernel.
[ 8.214170] input: afg3050_kbd as /devices/platform/soc/1c27000.i2c/i2c-0/0-0037/input/input0
mount usb done!
CN2104029002853
[ 8.532975] Mass Storage Function, version: 2009/09/11
[ 8.538142] LUN: removable file: (no medium)
[ 8.600932] dual speed tmc: IN/ep1in, OUT/ep1out, INTep2in/
[ 8.606785] phy phy-1c13400.phy.0: Changing dr_mode to 1
util_thread_start_with_sched_priority:thread 0xa1b0f8 is running
dso_acq_control:1:store_depth 4000, extra_len 64,acq_all_nm_for_read 4064,acq_dot_nm_of_timerange 4000,sample_rate = 1250000.000000
Starting system message bus: done
dbus session addr is unix:path=/var/run/dbus/system_bus_socket,guid=6d586beb7f361c511cfe5b600000000c
dbus is valid and addr is unix:path=/var/run/dbus/system_bus_socket,guid=6d586beb7f361c511cfe5b600000000c
[ 13.480670] usbcore: registered new interface driver USBTMC
insmod: can't insert '/dso/etc/tp-adc.ko': No such file or directory
-----------
now type "root", press enter
Enter root and you're in.
root
login[49]: root login on 'console'
unix:path=/var/run/dbus/system_bus_socket,guid=771c917f37a4ef82aed89b8d0000000c
#
Datasheets:
Datasheet for the F1C200s.