🥛

Milk-V Duoの起動ログをシリアルコンソールで見てみよう!

2024/08/04に公開

はじめまして。普段はTypescriptでWebアプリのサーバーサイドを書いています。

今回は、以前から興味があったRISC-V評価ボードであるMilk-V Duoを動かし、起動ログをシリアルコンソールから見られるようにしたので、その過程を共有したいと思います。

私はRISC-Vに関してなんの知見もないですが、RISC-V協会のTシャツを持っています。
よろしくお願いいたします。

環境と用意するもの

PCはM1のMacBook Airです。
加えて以下を用意しました。

  • Milk-V Duo
    • Linuxが動作するRISC-V評価ボードです。
    • メモリ64MB版なら税込1420円くらい、256MB版なら税込2300円くらいで買えます(2024年8月現在)。
  • 適当なUSBシリアル変換モジュール
    • シリアルコンソールからMilk-V Duoのログを見るために必要です。ご家庭にあるやつで大丈夫です。
    • 私はFT232RQを使いました。
  • ブレッドボード
  • ジャンパーワイヤー
    • 後述の拡張ボードを使ったため、メス-オスのものを選びました。
  • はんだ付けに必要なもの一式
  • [任意]Milk-V Duo USB&Ethernet IOB
    • Milk-V Duoと接続することで、USBのポートやLANポートを拡張できるやつです。なくても良いです。

まずは普通に動かしてみる

公式ドキュメントに基づいて進めます。
流れは以下の通りです。

  1. ここから公式の起動イメージをダウンロード
  2. 起動イメージをSDカードに書き込むためのソフトをダウンロード(balenaEtcherRufusなど)
  3. 2.のアプリで起動イメージをマイクロSDカードに書き込む
  4. マイクロSDカードをMilk-V Duoに差し込む
  5. PCとケーブルで繋いでMilk-V Duoを起動

青いランプが点滅し始めたら起動成功です。

PCからシリアルコンソールで起動ログを見る

PCからシリアルコンソールで起動ログを見るためには、Milk-V Duoから送られてくるシリアル信号をUSB信号に変換した上でPCに送ってあげる必要があります。
こんなイメージ。

上を元にして、Milk-V DuoとFT232RQに付属のピンをはんだ付けして回路を組みました。

FT232RQ ケーブル色 Milk-V Duo
GND オレンジ GND
TX RX
RX TX

写真では拡張ボードを使っていますが、使っていない場合はMilk-V Duo側のTXをTX+、RXをRX+に読み替えてください。

それでは起動ログを確認してみます。
まず、USBシリアル変換デバイスの名前をチェックします

$ ls /dev/tty.usb*
crw-rw-rw-  1 root  wheel  0x9000006 Aug  4 03:00 /dev/tty.usbserial-3

デバイスの名前は/dev/tty.usbserial-3であることが分かりました。(この名前は環境によって異なります)
ではいよいよシリアルコンソールです。まずは以下を実行します。

$ screen /dev/tty.usbserial-3 115200

画面がクリアされるので、Milk-V Duoに給電しているケーブルを抜き差しして再起動してみてください。
すると...

起動ログが出ました!

ログの全文
C.SCS/0/0.WD.URPL.SDI/25000000/6000000.BS/SD.PS.SD/0x0/0x1000/0x1000/0.PE.BS.SD/0x1000/0x8400/0x8400/0.BE.J.
FSBL Jb2829:g34fb84e88:2024-05-28T20:45:24+08:00
st_on_reason=d0000
st_off_reason=0
P2S/0x1000/0xc00a400.
SD/0x9400/0x1000/0x1000/0.P2E.
DPS/0xa400/0x2000.
SD/0xa400/0x2000/0x2000/0.DPE.
cv181x DDR init.
ddr_param[0]=0x78075562.
pkg_type=5
D1_3_2
DDR3-2G-QFN
Data rate=1866.
DDR BIST PASS
PLLS.
PLLE.
C2S/0xc400/0x8fe00000/0x3600.
[R2TE:. 0/0x3600/0x3600/0.RSC.
1M.S8/904x2f5a60]0P/r0ex 8s0y0s0t0e0m0 0i/n0ixt1 bd0o0n0e.

RT: [1.900577]CVIRTOS Build Date:May 28 2024  (Time :20:45:24)
RT: [1.906491]Post system init done
RT: [1.909806]create cvi task
RT: [1.912628][cvi_spinlock_init] succeess
RT: [1.916526]prvCmdQuRunTask run
SD/0xfa00/0x1b000/0x1b000/0.ME.
L2/0x2aa00.
SD/0x2aa00/0x200/0x200/0.L2/0x414d3342/0xcafeb3a5/0x80200000/0x37600/0x37600
COMP/1.
SD/0x2aa00/0x37600/0x37600/0.DCP/0x80200020/0x1000000/0x81900020/0x37600/1.
DCP/0x73f43/0.
Loader_2nd loaded.
Use internal 32k
Jump to monitor at 0x80000000.
OPENSBI: next_addr=0x80200020 arg1=0x80080000
OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Milk-V Duo256M
Platform Features         : mfdeleg
Platform HART Count       : 1
Platform IPI Device       : clint
Platform Timer Device     : clint
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform SysReset Device  : ---
Firmware Base             : 0x80000000
Firmware Size             : 132 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000074000000-0x000000007400ffff (I)
Domain0 Region01          : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200020
Domain0 Next Arg1         : 0x0000000080080000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcvsux
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 38
Boot HART MHPM Count      : 8
Boot HART MHPM Count      : 8
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109


U-Boot 2021.10 (May 28 2024 - 20:45:16 +0800) cvitek_cv181x

DRAM:  254 MiB
gd->relocaddr=0x8b0c8000. offset=0xaec8000
MMC:   cv-sd@4310000: 0
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:
Warning: ethernet@4070000 (eth0) using random MAC address - 1e:71:57:b1:b4:22
eth0: ethernet@4070000
Hit any key to stop autoboot:  0
Boot from SD ...
switch to partitions #0, OK
mmc0 is current device
3114300 bytes read in 139 ms (21.4 MiB/s)
## Loading kernel from FIT Image at 81800000 ...
   Using 'config-cv1812cp_milkv_duo256m_sd' configuration
   Trying 'kernel-1' kernel subimage
     Description:  cvitek kernel
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x818000d8
     Data Size:    3091961 Bytes = 2.9 MiB
     Architecture: RISC-V
     OS:           Linux
     Load Address: 0x80200000
     Entry Point:  0x80200000
     Hash algo:    crc32
     Hash value:   77f07f91
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81800000 ...
   Using 'config-cv1812cp_milkv_duo256m_sd' configuration
   Trying 'fdt-cv1812cp_milkv_duo256m_sd' fdt subimage
     Description:  cvitek device tree - cv1812cp_milkv_duo256m_sd
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x81af2ff0
     Data Size:    20443 Bytes = 20 KiB
     Architecture: RISC-V
     Hash algo:    sha256
     Hash value:   d494f8d8d9244d5235147054abbe6ea6282d4fd6922e109fd2c806a800f9a7e7
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x81af2ff0
   Uncompressing Kernel Image
   Decompressing 6955520 bytes used 1115ms
   Loading Device Tree to 000000008a778000, end 000000008a77ffda ... OK

Starting kernel ...

[    0.000000] Linux version 5.10.4-tag- (root@06883d61fb65) (riscv64-unknown-linux-musl-gcc (Xuantie-900 linux-5.10.4 musl gcc Toolchain V2.6.1 B-20220906) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 PREEMPT Tue May 28 20:45:31 CST 2024
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Ion: Ion memory setup at 0x000000008b300000 size 75 MiB
[    0.000000] OF: reserved mem: initialized node ion, compatible id ion-region
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x000000008fdfffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000008fdfffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000008fdfffff]
[    0.000000] On node 0 totalpages: 65024
[    0.000000]   DMA32 zone: 889 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 65024 pages, LIFO batch:15
[    0.000000] SBI specification v0.3 detected
[    0.000000] SBI implementation ID=0x1 Version=0x9
[    0.000000] SBI v0.2 TIME extension detected
[    0.000000] SBI v0.2 IPI extension detected
[    0.000000] SBI v0.2 RFENCE extension detected
[    0.000000] riscv: ISA extensions acdfimsuv
[    0.000000] riscv: ELF capabilities acdfimv
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64135
[    0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait rw console=ttyS0,115200 earlycon=sbi riscv.fwsz=0x80000 loglevel=9
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 169888K/260096K available (4208K kernel code, 505K rwdata, 1864K rodata, 148K init, 202K bss, 90208K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@70000000: mapped 101 interrupts with 1 handlers for 2 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x2e0/0x41c with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x5c40939b5, max_idle_ns: 440795202646 ns
[    0.000008] sched_clock: 64 bits at 25MHz, resolution 40ns, wraps every 4398046511100ns
[    0.008406] Calibrating delay loop (skipped), value calculated using timer frequency.. 50.00 BogoMIPS (lpj=100000)
[    0.019123] pid_max: default: 4096 minimum: 301
[    0.024014] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.031422] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.040853] ASID allocator initialised with 65536 entries
[    0.046524] rcu: Hierarchical SRCU implementation.
[    0.051905] EFI services will not be available.
[    0.056928] devtmpfs: initialized
[    0.066003] early_time_log: do_initcalls: 5328466us
[    0.071620] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.081656] futex hash table entries: 16 (order: -4, 384 bytes, linear)
[    0.088619] pinctrl core: initialized pinctrl subsystem
[    0.094464] NET: Registered protocol family 16
[    0.099456] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.106759] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.115569] thermal_sys: Registered thermal governor 'step_wise'
[    0.130545] OF: /gpio@03020000/gpio-controller@0: could not find phandle
[    0.143752] OF: /gpio@03021000/gpio-controller@1: could not find phandle
[    0.150739] OF: /gpio@03022000/gpio-controller@2: could not find phandle
[    0.157728] OF: /gpio@03023000/gpio-controller@3: could not find phandle
[    0.164714] OF: /gpio@05021000/gpio-controller@4: could not find phandle
[    0.173435] clk reset: nr_reset=64 resource_size=8
[    0.178953] get audio clk=24576000
[    0.182480] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 24576000
[    0.205059] dw_dmac 4330000.dma: CVITEK DMA Controller, 8 channels, probe done!
[    0.213462] SCSI subsystem initialized
[    0.217748] usbcore: registered new interface driver usbfs
[    0.223497] usbcore: registered new interface driver hub
[    0.229045] usbcore: registered new device driver usb
[    0.236008] Ion: ion_parse_dt_heap_common: id 0 type 2 name carveout align 1000
[    0.244072] Ion: rmem_ion_device_init: heap carveout base 0x000000008b300000 size 0x0000000004b00000 dev (____ptrval____)
[    0.255373] ion_carveout_heap_create, size=0x4b00000
[    0.260674] cvi_get_rtos_ion_size, rtos ion_size get:0x1600000
[    0.266650] ion_carveout_heap_create, size(exclusion of rtos_ion_size)=0x3500000
[    0.489377] platform carveout: [ion] add heap id 0, type 2, base 0x8b300000, size 0x4b00000
[    0.498322] Advanced Linux Sound Architecture Driver Initialized.
[    0.505790] clocksource: Switched to clocksource riscv_clocksource
[    0.514034] NET: Registered protocol family 2
[    0.519479] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.528162] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.536162] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.543602] TCP: Hash tables configured (established 2048 bind 2048)
[    0.550335] UDP hash table entries: 128 (order: 0, 4096 bytes, linear)
[    0.557081] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes, linear)
[    0.564513] NET: Registered protocol family 1
[    0.569516] RPC: Registered named UNIX socket transport module.
[    0.575627] RPC: Registered udp transport module.
[    0.580500] RPC: Registered tcp transport module.
[    0.585422] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.594566] Initialise system trusted keyrings
[    0.599378] workingset: timestamp_bits=62 max_order=16 bucket_order=0
[    0.613575] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.620538] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.627629] Key type asymmetric registered
[    0.631829] Asymmetric key parser 'x509' registered
[    0.642362] cvi_rtos_cmdqu_init
[    0.645771] cvi_rtos_cmdqu_probe start ---
[    0.649979] name=1900000.rtos_cmdqu
[    0.653836] res-reg: start: 0x1900000, end: 0x1900fff, virt-addr(ffffffd00573f000).
[    0.661712] RTOS_CMDQU_INIT
[    0.664644] mbox_reg=(____ptrval____)
[    0.668492] mbox_done_reg=(____ptrval____)
[    0.672792] mailbox_context=(____ptrval____)
[    0.677301] cvi_rtos_cmdqu_probe DONE
[    0.681247] cvi_rtos_cmdqu_init done
[    0.684908] [cvi_spinlock_init] success
[    0.689096] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
[    0.697378] printk: console [ttyS0] disabled
[    0.710935] printk: console [ttyS0] enabledx4140000 (irq = 15, base_baud = 1562500) is a 16550A
[    0.710935] printk: console [ttyS0] enabled
[    0.719516] printk: bootconsole [sbi0] disabled
[    0.719516] printk: bootconsole [sbi0] disabled
[    0.729668] 4150000.serial: ttyS1 at MMIO 0x4150000 (irq = 16, base_baud = 1562500) is a 16550A
[    0.739464] 4160000.serial: ttyS2 at MMIO 0x4160000 (irq = 17, base_baud = 1562500) is a 16550A
[    0.749295] 4170000.serial: ttyS3 at MMIO 0x4170000 (irq = 18, base_baud = 1562500) is a 16550A
[    0.763210] libphy: Fixed MDIO Bus: probed
[    0.767991] bm-dwmac 4070000.ethernet: IRQ eth_wake_irq not found
[    0.774341] bm-dwmac 4070000.ethernet: IRQ eth_lpi not found
[    0.780310] bm-dwmac 4070000.ethernet: Hash table entries set to unexpected value 0
[    0.788363] bm-dwmac 4070000.ethernet: no reset control found
[    0.794544] bm-dwmac 4070000.ethernet: User ID: 0x10, Synopsys ID: 0x37
[    0.801445] bm-dwmac 4070000.ethernet: 	DWMAC1000
[    0.806341] bm-dwmac 4070000.ethernet: DMA HW capability register supported
[    0.813559] bm-dwmac 4070000.ethernet: RX Checksum Offload Engine supported
[    0.820778] bm-dwmac 4070000.ethernet: COE Type 2
[    0.825665] bm-dwmac 4070000.ethernet: TX Checksum insertion supported
[    0.832434] bm-dwmac 4070000.ethernet: Normal descriptors
[    0.838038] bm-dwmac 4070000.ethernet: Ring mode enabled
[    0.843553] bm-dwmac 4070000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    0.851312] bm-dwmac 4070000.ethernet: device MAC address 1e:71:57:b1:b4:22
[    0.882626] libphy: stmmac: probed
[    0.886355] CVITEK CV182XA stmmac-0:00: attached PHY driver [CVITEK CV182XA] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)
[    0.897428] CVITEK CV182XA stmmac-0:01: attached PHY driver [CVITEK CV182XA] (mii_bus:phy_addr=stmmac-0:01, irq=POLL)
[    0.909673] bm-dwmac 4070000.ethernet: Cannot get clk_500m_eth!
[    0.915892] bm-dwmac 4070000.ethernet: Cannot get gate_clk_axi4!
[    0.923195] dwc2 4340000.usb: axi clk installed
[    0.927963] dwc2 4340000.usb: apb clk installed
[    0.932694] dwc2 4340000.usb: 125m clk installed
[    0.937499] dwc2 4340000.usb: 33k clk installed
[    0.942210] dwc2 4340000.usb: 12m clk installed
[    0.947001] dwc2 4340000.usb: EPs: 8, dedicated fifos, 3072 entries in SPRAM
[    0.954806] dwc2 4340000.usb: DWC OTG Controller
[    0.959660] dwc2 4340000.usb: new USB bus registered, assigned bus number 1
[    0.966916] dwc2 4340000.usb: irq 37, io mem 0x04340000
[    0.973159] hub 1-0:1.0: USB hub found
[    0.977155] hub 1-0:1.0: 1 port detected
[    0.982388] usbcore: registered new interface driver usb-storage
[    0.989093] mousedev: PS/2 mouse device common for all mice
[    0.995154] i2c /dev entries driver
[    1.000412] sdhci: Secure Digital Host Controller Interface driver
[    1.006861] sdhci: Copyright(c) Pierre Ossman
[    1.011391] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.017512] cvi:sdhci_cvi_probe
[    1.065806] mmc0: SDHCI controller on 4310000.cv-sd [4310000.cv-sd] using ADMA 64-bit
[    1.073962] cvi_proc_init cvi_host 0x(____ptrval____)
[    1.079861] usbcore: registered new interface driver usbhid
[    1.089806] usbhid: USB HID core driver
[    1.095004] usbcore: registered new interface driver snd-usb-audio
[    1.102325] cvitek-i2s 4100000.i2s: cvi_i2s_probe
[    1.114227] cvitek-i2s 4130000.i2s: cvi_i2s_probe
[    1.119809] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[    1.126886] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[    1.135411] cvitekaadc 300a100.adc: cvitekaadc_probe
[    1.146357] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac
[    1.153689] cvitekadac 300a000.dac: cvitekadac_probe
[    1.159132] cvitekadac_probe gpio_is_valid mute_pin_l
[    1.165002] NET: Registered protocol family 17
[    1.169935] Loading compiled-in X.509 certificates
[    1.207069] i2c_designware 4010000.i2c: running with gpio recovery mode! scl,sda
[    1.222518] i2c_designware 4020000.i2c: running with gpio recovery mode! scl,sda
[    1.230242] mmc0: new high speed SDXC card at address 59b4
[    1.236609] i2c_designware 4030000.i2c: running with gpio recovery mode! scl,sda
[    1.245032] mmcblk0: mmc0:59b4 SD    116 GiB
[    1.250804] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[    1.257940] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[    1.267483]  mmcblk0: p1 p2
[    1.276003] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac
[    1.288412] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.299075] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.306123] cfg80211: failed to load regulatory.db
[    1.311259] ALSA device list:
[    1.314706] dw-apb-uart 4140000.serial: forbid DMA for kernel console
[    1.349710] random: fast init done
[    1.851221] EXT4-fs (mmcblk0p2): recovery complete
[    1.859263] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.867714] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.875996] devtmpfs: mounted
[    1.879243] Freeing unused kernel memory: 148K
[    1.883861] Kernel memory protection not selected by kernel config.
[    1.890376] Run /sbin/init as init process
[    1.894637]   with arguments:
[    1.897708]     /sbin/init
[    1.900528]   with environment:
[    1.903798]     HOME=/
[    1.906262]     TERM=linux
[    1.909064] early_time_log: run_init_process: 7171534us
[    1.968605] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: [    2.359736] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting network: OK
Starting dhcpcd...
dhcpcd-9.4.0 starting
[    2.454795] random: dhcpcd: uninitialized urandom read (112 bytes read)
DUID 00:01:00:01:c7:92:bc:82:62:3f:b5:06:d8:86
dhcp_vendor: Invalid argument
forked to background, child pid [    2.563551] bm-dwmac 4070000.ethernet eth0: PHY [stmmac-0:00] driver [CVITEK CV182XA] (irq=POLL)
139
Bad system call
Starting ntpd: [    2.585877] dwmac1000: Master AXI performs any burst length
[    2.592233] bm-dwmac 4070000.ethernet eth0: No Safety Features support found
[    2.600574] bm-dwmac 4070000.ethernet eth0: IEEE 1588-2002 Timestamp supported
[    2.609362] bm-dwmac 4070000.ethernet eth0: configuring for phy/rmii link mode
OK
Starting dropbear sshd: OK
Starting dnsmasq: [    7.760674] random: dnsmasq: uninitialized urandom read (128 bytes read)
[    7.767790] random: dnsmasq: uninitialized urandom read (48 bytes read)
OK
init mpp system...
[    7.800081] cv181x_sys: bad vermagic: kernel tainted.
[    7.805354] Disabling lock debugging due to kernel taint
[    7.811204] cv181x_sys: loading out-of-tree module taints kernel.
[    7.833931] res-reg: start: 0xa0c8000, end: 0xa0c801f, virt-addr(ffffffd00409e000).
[    7.842267] CVITEK CHIP ID = 18
[    7.856728] cif a0c2000.cif: cam0 clk installed
[    7.861535] cif a0c2000.cif: cam1 clk installed
[    7.866636] cif a0c2000.cif: vip_sys_2 clk installed
[    7.872046] cif a0c2000.cif: clk_mipimpll clk installed (____ptrval____)
[    7.879239] cif a0c2000.cif: clk_disppll clk installed (____ptrval____)
[    7.886339] cif a0c2000.cif: clk_fpll clk installed (____ptrval____)
[    7.893164] cif a0c2000.cif: (0) res-reg: start: 0xa0c2000, end: 0xa0c3fff.
[    7.900598] cif a0c2000.cif:  virt-addr((____ptrval____))
[    7.906426] cif a0c2000.cif: (1) res-reg: start: 0xa0d0000, end: 0xa0d0fff.
[    7.913889] cif a0c2000.cif:  virt-addr((____ptrval____))
[    7.919718] cif a0c2000.cif: (2) res-reg: start: 0xa0c4000, end: 0xa0c5fff.
[    7.927147] cif a0c2000.cif:  virt-addr((____ptrval____))
[    7.933006] cif a0c2000.cif: (3) res-reg: start: 0xa0c6000, end: 0xa0c7fff.
[    7.940443] cif a0c2000.cif:  virt-addr((____ptrval____))
[    7.946271] cif a0c2000.cif: (4) res-reg: start: 0x3001c30, end: 0x3001c5f.
[    7.953701] cif a0c2000.cif:  virt-addr((____ptrval____))
[    7.959543] cif a0c2000.cif: no pad_ctrl for cif
[    7.964627] cif a0c2000.cif: request irq-26 as cif-irq0
[    7.970345] cif a0c2000.cif: request irq-27 as cif-irq1
[    7.976029] cif a0c2000.cif: rst_pin = 433, pol = 1
[    7.987680] snsr_i2c snsr_i2c: i2c:-------hook 1
[    7.992690] snsr_i2c snsr_i2c: i2c:-------hook 2
[    7.998079] snsr_i2c snsr_i2c: i2c:-------hook 3
[    8.044481] vi_core_probe:203(): res-reg: start: 0xa000000, end: 0xa07ffff, virt-addr(ffffffd004180000).
[    8.054396] vi_core_probe:216(): irq(28) for isp get from platform driver.
[    8.062403] vi_tuning_buf_setup:253(): tuning fe_addr[0]=0x81b7f490, be_addr[0]=0x81b77290, post_addr[0]=0x81b60000
[    8.073573] vi_tuning_buf_setup:253(): tuning fe_addr[1]=0x8207f490, be_addr[1]=0x82077290, post_addr[1]=0x82060000
[    8.084678] vi_tuning_buf_setup:253(): tuning fe_addr[2]=0x8209f490, be_addr[2]=0x82097290, post_addr[2]=0x82080000
[    8.095739] sync_task_init:177(): sync_task_init vi_pipe 0
[    8.101648] sync_task_init:177(): sync_task_init vi_pipe 1
[    8.107548] sync_task_init:177(): sync_task_init vi_pipe 2
[    8.113892] vi_core_probe:252(): isp registered as cvi-vi
[    8.166785] cvi_dwa_probe:487(): done with rc(0).
[    8.207602] cv181x-cooling cv181x_cooling: elems of dev-freqs=6
[    8.213918] cv181x-cooling cv181x_cooling: dev_freqs[0]: 850000000 500000000
[    8.221600] cv181x-cooling cv181x_cooling: dev_freqs[1]: 425000000 375000000
[    8.229154] cv181x-cooling cv181x_cooling: dev_freqs[2]: 425000000 300000000
[    8.236783] cv181x-cooling cv181x_cooling: Cooling device registered: cv181x_cooling
[    8.269407] jpu ctrl reg pa = 0xb030000, va = (____ptrval____), size = 256
[    8.276977] end jpu_init result = 0x0
[    8.382821] cvi_vc_drv_init result = 0x0
[    8.449702] sh (180): drop_caches: 3
Starting app...

[root@milkv-duo]~#

なお、同じくシリアル通信でコマンドを送ることもできます。

まとめ

RISC-V評価ボードであるMilk-V Duoを動かし、起動ログをシリアルコンソールから見られるようにしました。
ついでにシリアル通信でコマンドを送ることもできます。

今回は公式の起動イメージを使いましたが、自作のプログラムを実際に起動して動作確認!みたいなこともできるようになります。
やる気と時間があれば、RISC-V上で動くオレオレOSみたいなものを作って遊べそうですね。

今回は以上です。
ここまで読んでいただきありがとうございました!

Discussion