RV1103 Luckfox Pico使用SPI NAND Flash烧录镜像

官网指导文档: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线将开发板连接上电脑(先按住开发板的BOOT键,USB连接电脑,松开BOOT键)
在这里插入图片描述
烧录完成后参考官方指导试一下串口调试,烧录的系统是buildroot

登录账号:root
登录密码:luckfox

在这里插入图片描述

参考:

  1. 【RV1103】Luckfox Pico RV1103 开发记录
  2. 【RV1103】Luckfox Pico 构建系统分析
  3. 【RV1103】SD卡和无线WiFi同时使用
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LuckFox Pico是一款基于ARM架构的嵌入式开发板,它支持烧录Linux操作系统。下面是烧录Linux到LuckFox Pico的一般步骤: 1. 准备开发环境:首先,你需要安装交叉编译工具链和相关的开发工具,例如GCC编译器、Make工具等。 2. 获取Linux内核源代码:你可以从Linux内核官方网站或者其他适配了LuckFox Pico的开源项目中获取适用于该开发板的Linux内核源代码。 3. 配置内核:进入内核源代码目录,使用交叉编译工具链进行配置。你可以使用make menuconfig命令来选择适合LuckFox Pico的配置选项,例如选择正确的处理器架构、设备驱动等。 4. 编译内核:使用make命令进行内核编译。这个过程可能需要一些时间,取决于你的电脑性能和内核源代码的大小。 5. 生成根文件系统:除了内核,你还需要一个根文件系统来运行Linux。你可以选择使用已有的根文件系统,或者自己构建一个。根文件系统包含了Linux所需的各种库、工具和配置文件。 6. 烧录内核和根文件系统:将编译好的内核和根文件系统烧录LuckFox Pico的存储介质中,例如SD卡或者eMMC。你可以使用烧录工具,如dd命令或者专门的烧录软件来完成这个步骤。 7. 启动LuckFox Pico:将烧录好的存储介质插入LuckFox Pico,然后通过串口或者其他方式连接到开发板。启动开发板后,它将加载内核并运行Linux操作系统。 希望以上步骤对你有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值