俺长期从事linux内核和bsp开发,2021年一直口水D1哪吒开发板不过一直没舍得买,这次买了Lichee_RV_DOCK。开箱图就不贴了,烧Tina系统的img,用usb串口转接连EXTIO的GND、TX、RX引脚,串口可获得shell。下面做些官方wiki中https://wiki.sipeed.com/hardware/zh/lichee/RV/RV.html没有的小实验:
1.用户按键
在hdmi口边上下有两个键,一是RST,另一个即user按键
root@MaixLinux:/mnt/SDCARD# ./evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: sunxi-keyboard
/dev/input/event1: audiocodec sunxi Audio Jack
/dev/input/event2: fts_ts
Select the device event number [0-2]: 0
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "sunxi-keyboard"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 28 (KEY_ENTER)
Event code 114 (KEY_VOLUMEDOWN)
Event code 139 (KEY_MENU)
Event code 172 (KEY_HOMEPAGE)
Event code 352 (KEY_OK)
Properties:
Testing ... (interrupt to exit)
Event: time 6994.130779, type 1 (EV_KEY), code 352 (KEY_OK), value 1
Event: time 6994.130779, -------------- SYN_REPORT ------------
Event: time 6994.219394, type 1 (EV_KEY), code 352 (KEY_OK), value 0
Event: time 6994.219394, -------------- SYN_REPORT ------------
所以此用户按键默认键码是KEY_OK
2. rtc
root@MaixLinux:~# cat /sys/class/rtc/rtc0/time && sleep 10 && cat /sys/class/rtc/rtc0/time
01:58:24
01:58:33
root@MaixLinux:/mnt/SDCARD# ./rtctest
RTC Driver Test Example.
Counting 5 update (1/sec) interrupts from reading /dev/rtc0: 1 2 3 4 5
Again, from using select(2) on /dev/rtc: 1 2 3 4 5
Current RTC date/time is 1-1-1970, 01:52:04.
Alarm time now set to 01:52:09.
Waiting 5 seconds for alarm... okay. Alarm rang.
*** Test complete ***
3.watchdog
因watchdog被procd进程占用,故暂未测试wdt的功能,等用buildroot构建一个简单系统后可测
4.芯片里的温度sensor
root@MaixLinux:~# cat /sys/class/thermal/thermal_zone0/temp
30820
单位按linux惯例应该是毫摄氏度,所以这里报告温度是30.82度
5. sdcard和sdio的一些基本参数
root@MaixLinux:~# cat /sys/kernel/debug/mmc0/ios
clock: 50000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)
root@MaixLinux:~# cat /sys/kernel/debug/mmc1/ios
clock: 50000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)
所以sdcard也好,用于wifi的sdio也好,都是HS模式,时钟最高到50MHZ,工作电压3.3V,sd总线4位宽。
6. 各clock/pll基本情况
root@MaixLinux:~# cat /sys/kernel/debug/clk/clk_summary
...
pll-ddr0 2 2 0 1584000000 0 0 50
000
dram-clk 0 0 0 1584000000 0 0 50
000
...
pll-cpux 0 0 0 1008000000 0 0 50
000
riscv 0 0 0 1008000000 0 0 50
000
riscv-axi 0 0 0 504000000 0 0 50
000
pll-cpux-div 0 0 0 1008000000 0 0 50
000
...
这个列表好长,只把感兴趣的部分贴出。这表明那颗riscv cpu跑在1008MHZ频率下,DDR基础频率1584MHZ
注:evtest和rtctest是自己编译的程序,系统未自带。
离线
d1的sdk有点庞大,光下载下来都有10来个G了,编译完都15~20G,虚拟机有点顶不住,不知道里面是塞了些什么
离线