K230 SDK 常见问题解答(C)
1 TF boot failed with exit code 13
问题: TF卡启动报boot failed with exit code 13错误
答:原因如下 1.启动介质里面文件错误。2.启动管脚设置错误。
TF卡启动管脚设置特别说明: 两个启动管脚电平为高(需要拨到丝印的1和2,也就是ON的反方向)时才会从TF卡启动。
2 bootrom启动错误码
问题:bootrom 启动错误码含义是什么?
bootrom引导失败时会打印类似下面错误 boot failed with exit code 19,最后的数字是错误原因,常见错误含义如下
| 值 | 含义 |
|---|---|
| 13 | 启动介质里面文件错误 |
| 19 | 启动介质初始化失败,比如没有插sd卡等 |
| 17 | otp要求必需是安全镜像,但是介质里面文件是非安全镜像 |
3 spi nor 和 spi nand flash识别
问题: 怎么知道evb板上连接的是spi nor还是spi nand flash?
答:方法1:子板丝印不一样,丝印会有nor或nand标识。
方法2:linux启动log会有打印,比如连接spi nor时会有类似下面打印
[root@canaan ~ ]#dmesg | grep spi
[ 1.299989] spi spi0.0: setup mode 0, 8 bits/w, 100000000 Hz max --> 0
[ 1.306704] spi-nor spi0.0: gd25lx256e (32768 Kbytes)
[ 1.311786] 2 fixed-partitions partitions found on MTD device spi0.0
[ 1.318147] Creating 2 MTD partitions on "spi0.0":
4 perf 使用
问题:perf如何编译,支持那些硬件事件?
答:perf的时候可以使用raw事件,比如perf stat -e r12 ,perf工具编译命令如下:
cd src/little/linux/tools
make CROSS_COMPILE=riscv64-unknown-linux-gnu- ARCH=riscv perf V=1 WERROR=0
#目标文件是 perf/perf ,把这个文件复制到板子上就可以了。
特别说明:1.1以前版本进行如下修改
#src/little/linux/arch/riscv/boot/dts/kendryte/k230_evb.dtsi 添加如下内容
pmu_thead: pmu_thead {
interrupt-parent = <&cpu0_intc>;
interrupts = <17>;
compatible = "thead,c900_pmu";
};
#src/little/linux/arch/riscv/configs/k230_evb_defconfig 文件增加如下配置
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PERF_EVENTS=y
CONFIG_DEBUG_PERF_USE_VMALLOC=y
CONFIG_KUSER_HELPERS=y
CONFIG_DEBUG_INFO=y
CONFIG_FRAME_POINTER=y
[root@canaan ~ ]#perf list hw cache > a ;cat a
branch-instructions OR branches [Hardware event]
branch-misses [Hardware event]
bus-cycles [Hardware event]
cache-misses [Hardware event]
cache-references [Hardware event]
cpu-cycles OR cycles [Hardware event]
instructions [Hardware event]
ref-cycles [Hardware event]
stalled-cycles-backend OR idle-cycles-backend [Hardware event]
stalled-cycles-frontend OR idle-cycles-frontend [Hardware event]
L1-dcache-load-misses [Hardware cache event]
L1-dcache-loads [Hardware cache event]
L1-dcache-store-misses [Hardware cache event]
L1-dcache-stores [Hardware cache event]
L1-icache-load-misses [Hardware cache event]
L1-icache-loads [Hardware cache event]
LLC-load-misses [Hardware cache event]
LLC-loads [Hardware cache event]
LLC-store-misses [Hardware cache event]
LLC-stores [Hardware cache event]
dTLB-load-misses [Hardware cache event]
dTLB-loads [Hardware cache event]
dTLB-store-misses [Hardware cache event]
dTLB-stores [Hardware cache event]
iTLB-load-misses [Hardware cache event]
iTLB-loads [Hardware cache event]
[root@canaan ~ ]#
5大核运行vector linux
问题:大核如何运行带vector的linux?
答:请使用如下命令编译
make CONF=k230_canmv_only_linux_defconfig
#k230_canmv_only_linux_defconfig 对应的是带vector大核linux镜像
6 大核串口id
问题:怎么修改大核的串口id?
答:configs下面配置文件 CONFIG_RTT_CONSOLE_ID代表大核串口id,修改为正确的值就可以了。
7 uboot命令行
怎么编译可以进入uboot命令行的版本
答: configs下面配置文件 CONFIG_QUICK_BOOT代表快起,修改为CONFIG_QUICK_BOOT=n 就可以生成可进去uboot命令行版本。
8 慢启怎么变快启动
答:进入uboot命令行执行如下命令:
setenv quick_boot true;saveenv;reset;