官网指导文档:https://wiki.luckfox.com/zh/Luckfox-Pico/Luckfox-Pico-RV1103/Luckfox-Pico-SDK
由于RV1103_Luckfox_Pico默认是使用sd卡烧录镜像的,但是给他焊了个spi nand flash,不用sd卡。
首先查看下flash信息
制作spi nand flash镜像的操作如下:
1) 使用linux系统,下载sdk
git clone https://gitee.com/LuckfoxTECH/luckfox-pico.git
2) 在目录luckfox-pico/project/cfg/BoardConfig_IPC
下新建一个BoardConfig-SPI_NAND-Buildroot-RV1103_Luckfox_Pico_Pro-IPC.mk
文件
将BoardConfig-SD_CARD-Buildroot-RV1103_Luckfox_Pico-IPC.mk
的内容复制到BoardConfig-SPI_NAND-Buildroot-RV1103_Luckfox_Pico_Pro-IPC.mk
中,然后修改下面五处
#!/bin/bash
#################################################
# Board Config
#################################################
# Target CHIP
export RK_CHIP=rv1106
# app config
export RK_APP_TYPE=RKIPC_RV1103
# Config CMA size in environment
export RK_BOOTARGS_CMA_SIZE="24M"
# Kernel dts
export RK_KERNEL_DTS=rv1103g-luckfox-pico-pro.dts
#################################################
# BOOT_MEDIUM
#################################################
# Target boot medium: emmc/spi_nor/spi_nand
export RK_BOOT_MEDIUM=spi_nand
# Uboot defconfig fragment
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-sfc.config
# specify post.sh for delete/overlay files
# export RK_PRE_BUILD_OEM_SCRIPT=rv1103-spi_nor-post.sh
# config partition in environment
# RK_PARTITION_CMD_IN_ENV format:
# <partdef>[,<partdef>]
# <partdef> := <size>[@<offset>](part-name)
# Note:
# If the first partition offset is not 0x0, it must be added. Otherwise, it needn't adding.
export RK_PARTITION_CMD_IN_ENV="256K(env),256K@256K(idblock),512K(uboot),4M(boot),30M(oem),10M(userdata),210M(rootfs)"
# config partition's filesystem type (squashfs is readonly)
# emmc: squashfs/ext4
# nand: squashfs/ubifs
# spi nor: squashfs/jffs2
# RK_PARTITION_FS_TYPE_CFG format:
# AAAA:/BBBB/CCCC@ext4
# AAAA ----------> partition name
# /BBBB/CCCC ----> partition mount point
# ext4 ----------> partition filesystem type
export RK_PARTITION_FS_TYPE_CFG=rootfs@IGNORE@ubifs,userdata@/userdata@ubifs,oem@/oem@ubifs
# config filesystem compress (Just for squashfs or ubifs)
# squashfs: lz4/lzo/lzma/xz/gzip, default xz
# ubifs: lzo/zlib, default lzo
# export RK_SQUASHFS_COMP=xz
# export RK_UBIFS_COMP=lzo
#################################################
# TARGET_ROOTFS
#################################################
# Target rootfs : ubuntu(only sd_card)/buildroot/busybox
export LF_TARGET_ROOTFS=buildroot
# Buildroot defconfig
export RK_BUILDROOT_DEFCONFIG=luckfox_pico_defconfig
#################################################
# Defconfig
#################################################
# Target arch
export RK_ARCH=arm
# Target Toolchain Cross Compile
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
#misc image
export RK_MISC=wipe_all-misc.img
# Uboot defconfig
export RK_UBOOT_DEFCONFIG=luckfox_rv1106_uboot_defconfig
# Kernel defconfig
export RK_KERNEL_DEFCONFIG=luckfox_rv1106_linux_defconfig
# Config sensor IQ files
# RK_CAMERA_SENSOR_IQFILES format:
# "iqfile1 iqfile2 iqfile3 ..."
# ./build.sh media and copy <SDK root dir>/output/out/media_out/isp_iqfiles/$RK_CAMERA_SENSOR_IQFILES
export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json"
#export RK_CAMERA_SENSOR_IQFILES="sc4336_OT01_40IRC_F16.json sc3336_CMK-OT2119-PC1_30IRC-F16.json sc530ai_CMK-OT2115-PC1_30IRC-F16.json"
# Config sensor lens CAC calibrattion bin files
export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16"
#export RK_CAMERA_SENSOR_CAC_BIN="CAC_sc4336_OT01_40IRC_F16 CAC_sc530ai_CMK-OT2115-PC1_30IRC-F16"
# build ipc web backend
# export RK_APP_IPCWEB_BACKEND=y
# enable install app to oem partition
export RK_BUILD_APP_TO_OEM_PARTITION=y
# enable rockchip test
export RK_ENABLE_ROCKCHIP_TEST=y
3)在目录luckfox-pico/sysdrv/source/kernel/arch/arm/boot/dts
下复制一份rv1103g-luckfox-pico.dts
并命名为rv1103g-luckfox-pico-pro.dts
cp rv1103g-luckfox-pico.dts rv1103g-luckfox-pico-pro.dts
修改两处
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2022 Rockchip Electronics Co., Ltd.
*/
/dts-v1/;
#include "rv1103.dtsi"
#include "rv1106-evb.dtsi"
#include "rv1103-luckfox-pico-ipc.dtsi"
/ {
model = "Luckfox Pico Pro";
compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1103";
};
&sfc {
status = "okay";
flash@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <75000000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <1>;
};
};
/**********SDMMC**********/
&sdmmc {
max-frequency = <50000000>;
no-sdio;
no-mmc;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
status = "okay";
};
/**********ETH**********/
&gmac {
status = "disabled";
};
/**********USB**********/
&usbdrd_dwc3 {
status = "okay";
dr_mode = "peripheral";
};
/**********SPI**********/
/* SPI0_M0 */
&spi0 {
status = "disabled";
spidev@0 {
spi-max-frequency = <50000000>;
};
fbtft@0 {
spi-max-frequency = <50000000>;
};
};
/**********I2C**********/
/* I2C3_M1 */
&i2c3 {
status = "disabled";
clock-frequency = <100000>;
};
/**********UART**********/
/* UART3_M1 */
&uart3 {
status = "disabled";
};
/* UART4_M1 */
&uart4 {
status = "disabled";
};
/**********PWM**********/
/* PWM1_M0 */
&pwm1 {
status = "disabled";
};
4)编译镜像
# 选择参考板级
RV1103/luckfox-pico$ ./build.sh lunch
You're building on Linux
Lunch menu...pick the Luckfox Pico hardware version:
选择 Luckfox Pico 硬件版本:
[0] RV1103_Luckfox_Pico
[1] RV1103_Luckfox_Pico_Mini_A
[2] RV1103_Luckfox_Pico_Mini_B
[3] RV1103_Luckfox_Pico_Plus
[4] RV1106_Luckfox_Pico_Pro_Max
[5] RV1106_Luckfox_Pico_Ultra
[6] RV1106_Luckfox_Pico_Ultra_W
[7] custom
Which would you like? [0~7][default:0]: 7
----------------------------------------------------------------
...
----------------------------------------------------------------
16. BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1103_Luckfox_Pico_Pro-IPC.mk
boot medium(启动介质): SPI_NAND
system version(系统版本): Buildroot
hardware version(硬件版本): RV1103_Luckfox_Pico_Pro
applicaton(应用场景): IPC
----------------------------------------------------------------
...
----------------------------------------------------------------
Which would you like? [default:0]: 16
[build.sh:info] Lunching for Default BoardConfig_IPC/BoardConfig-SPI_NAND-Buildroot-RV1103_Luckfox_Pico_Pro-IPC.mk boards...
[build.sh:info] Running build_select_board succeeded.
# 一键自动编译
RV1103/luckfox-pico$ ./build.sh
要很久时间
5)使用SPI NAND Flash 烧录镜像
将luckfox-pico/output
目录下的image文件夹全部复制到windows系统电脑上,然后打开SocToolKit工具
使用USB线将开发板连接上电脑
烧录完成后参考官方指导试一下串口调试,烧录的系统是buildroot
登录账号:root
登录密码:luckfox
参考:
- 【RV1103】Luckfox Pico RV1103 开发记录
- 【RV1103】Luckfox Pico 构建系统分析
- 【RV1103】SD卡和无线WiFi同时使用