Edit online

切换存储类型

Read time: 8 minute(s)

Luban-Lite 编译的固件所占内存较小,一般采用 SPI NOR 进行存储,因此 Luban-Lite 默认采用 SPI NOR 存储方案。本节介绍如何将 Luban-Lite 的默认存储方案切换为 SPI NAND 或 eMMC 存储设备。关于详细的存储配置说明和流程,可查看

如需切换存储设备,需要清理现有的存储配置,并配置所需存储对应的 BootLoader 和 OS 参数。

Edit online

清理 SPI NOR 配置

Read time: 8 minute(s)

清理 BootLoader 配置

  1. 在 SDK 根目录下执行下列命令之一,进入 BootLoader 的配置界面:
    • bm 命令

    • scons –apply-def=dxxx_xxx-nor_baremetal_bootloaderscons –menuconfig

  2. 清理下列 BootLoader 的配置参数:
    Board options  --->
        [ ] SPI0 Devices: SPINOR  ----
    Drivers options  --->
        Peripheral  --->
            [ ] SPINOR Driver SFUD: Serial Flash Universal Driver  ----
        Drivers examples  --->
                    [ ] Enable MTD driver test command
    Bootloader options  --->
        Commands  --->
            [ ] spinor
            [ ] nor boot
        [*] Upgrading  --->
            [ ]   Write to NOR support
        Drivers  --->
            [ ] SPI NOR boot support

清理 OS 配置

  1. 在 SDK 根目录下执行下列命令之一,进入 OS 的配置界面:
    • me 命令

    • scons –apply-def=dxxx_xxx-nor_rt-thread_helloworldscons –menuconfig

  2. 清理下列 OS 的配置参数:
    Board options  --->
        [ ] SPI0 Devices: SPINOR  ----
    Rt-Thread options  --->
        RT-Thread Components  --->
            [ ] FAL: flash abstraction layer  ----
            Device Drivers  --->
                [ ] Using MTD Nor Flash device drivers
                [ ]   Using SFUD(Serial Flash Universal Driver)
    Local packages options  --->
        Third-party packages options  --->
            [ ] Littlefs: A high-integrity embedded file system  ----
    Drivers options  --->
        Peripheral  --->
            [ ] SPINOR Driver SFUD: Serial Flash Universal Driver  ----
Edit online

配置新存储设备

Read time: 8 minute(s)

根据所需切换的存储设备类型,配置对应的 BootLoaderOS 参数。

Edit online

配置 BootLoader

Read time: 8 minute(s)

本节介绍不同存储介质类型的 BootLoader 配置步骤。

配置 SPI NOR BootLoader

  1. 在 SDK 根目录下执行下列命令之一,进入 BootLoader 的配置界面:
    • bm 命令

    • scons –apply-def=dxxx_xxx-nor_baremetal_bootloaderscons –menuconfig

  2. 打开 SPI NOR 设备:
    Board options  --->
        [*] SPI0 Devices: SPINOR  ----
  3. 打开 SPI NOR 驱动选项:
    Drivers options  --->
        Peripheral  --->
            [*] SPINOR Driver SFUD: Serial Flash Universal Driver  ----
        Drivers examples  --->
                    [*] Enable MTD driver test command
    注: BootLoader 和 SPL 分区一般都比较小,如开启过多的 SPI NAND 型号,会导致存储容易越界,建议仅打开需要用到的型号。
  4. 打开 BootLoader 相关参数:
    Bootloader options  --->
        Commands  --->
            [*] spinor
            [*] nor boot
        [*] Upgrading  --->
            [*]   Write to NOR support
        Drivers  --->
            [*] SPI NOR boot support

配置 SPI NAND BootLoader

  1. 在 SDK 根目录下执行下列命令之一,进入 BootLoader 的配置界面:
    • bm 命令

    • scons –apply-def=dxxx_xxx-nor_baremetal_bootloaderscons –menuconfig

  2. 打开 SPI NAND 设备:
    Board options  --->
        [*] SPI0 Devices: SPINAND  --->
  3. 打开 SPI NAND 驱动选项:
    Drivers options  --->
        Peripheral  --->
            [*]   Support Winbond SPI NAND (NEW)        //根据 SPINAND 厂商使能配置,如华邦等
            [*] Aic NFTL support
            [*]   Aic NFTL use lib
    注: BootLoader 和 SPL 分区一般都比较小,如开启过多的 SPI NAND 型号,会导致存储容易越界,建议仅打开需要用到的型号。
  4. 打开 BootLoader 相关参数:
    Bootloader options  --->
        Drivers  --->
            [*] SPI NAND boot support
        [*] Upgrading  --->
            [*]   Write to NAND support
        Commands  --->
            [*] nand boot
            [*] spinand
SPINAND Driver library 中会列示不同品牌的存储芯片,如 Dosilicon 和 Macronix,确保选中相应的驱动支持:
-*- SPINAND Driver library
[*]   Support Dosilicon SPI NAND
[*]   Support Etron SPI NAND
[*]   Support Micron SPI NAND
[*]   Support Macronix SPI NAND
[*]   Support Winbond SPI NAND
[*]   Support GigaDevice SPI NAND
[*]   Support Toshiba SPI NAND
[*]   Support Foresee SPI NAND
[*]   Support Xtx SPI NAND
[*]   Support Zetta SPI NAND
[ ]   Support Zbit SPI NAND
[ ]   Support ESMT SPI NAND
[ ]   Support UMTEK SPI NAND
[ ]   Support QUANXING SPI NAND

配置 eMMC BootLoader

  1. 在 SDK 根目录下执行下列命令之一,进入 BootLoader 的配置界面:
    • bm 命令

    • scons –apply-def=dxxx_xxx-nor_baremetal_bootloaderscons –menuconfig

  2. 打开 eMMC 设备:
    Board options  --->
        [*] Using SDMC0
  3. 打开 BootLoader 相关参数:
    Bootloader options  --->
        Commands  --->
            [*] mmc boot
  4. 关闭 DE 进度条:
    Board options  --->
        [ ] Using Wireless LAN  ----
        [ ] Using Display Engine (DE)   //EMMC 需要关闭进度条
Edit online

配置 OS

Read time: 8 minute(s)

打开 OS 的配置界面,依次打开如下配置。

配置 SPI NOR OS

  1. 在 SDK 根目录下执行下列命令之一,进入 OS 的配置界面:
    • me 命令

    • scons –apply-def=dxxx_xxx-nor_rt-thread_helloworldscons –menuconfig

  2. 打开 SPI NOR 设备:
    Board options  --->
        [*] SPI0 Devices: SPINOR  --->
  3. 打开 Rt-Thread 中的驱动选项:
    Rt-Thread options  --->
        RT-Thread Components  --->
            [*] FAL: flash abstraction layer  ----
            Device Drivers  --->
                [*] Using MTD Nor Flash device drivers
                [*]   Using SFUD(Serial Flash Universal Driver)
  4. 打开 SPI NOR 的驱动选项:
    Drivers options  --->
        Peripheral  --->
            [*] SPINOR Driver SFUD: Serial Flash Universal Driver  ----

配置 SPI NAND OS

  1. 在 SDK 根目录下执行下列命令之一,进入 OS 的配置界面:
    • me 命令

    • scons –apply-def=dxxx_xxx-nor_rt-thread_helloworldscons –menuconfig

  2. 打开 SPI NAND 设备:
    Board options  --->
        [*] SPI0 Devices: SPINAND  --->
  3. 配置 FAT 文件系统:
    Application options  --->
    	[*] Using File System Image 1  --->
    	    --- Using File System Image 1
    		Select File System Type (FATFS)  --->
    	        (data/) Data Directory
    	        (data.fatfs) Image Name
  4. 打开 SPI NAND 的驱动选项:
    Drivers options  --->
        Peripheral  --->
            [*]   Support Winbond SPI NAND (NEW)        //根据 SPINAND 厂商使能配置,如华邦等
            [*] Aic NFTL support
            [*]   Aic NFTL use lib
SPINAND Driver library 中会列示不同品牌的存储芯片,如 Dosilicon 和 Macronix,确保选中相应的驱动支持:
-*- SPINAND Driver library
[*]   Support Dosilicon SPI NAND
[*]   Support Etron SPI NAND
[*]   Support Micron SPI NAND
[*]   Support Macronix SPI NAND
[*]   Support Winbond SPI NAND
[*]   Support GigaDevice SPI NAND
[*]   Support Toshiba SPI NAND
[*]   Support Foresee SPI NAND
[*]   Support Xtx SPI NAND
[*]   Support Zetta SPI NAND
[ ]   Support Zbit SPI NAND
[ ]   Support ESMT SPI NAND
[ ]   Support UMTEK SPI NAND
[ ]   Support QUANXING SPI NAND

配置 eMMC OS

  1. 在 SDK 根目录下执行下列命令之一,进入 OS 的配置界面:
    • me 命令

    • scons –apply-def=dxxx_xxx-nor_rt-thread_helloworldscons –menuconfig

  2. 打开 eMMC 设备:
    Board options  --->
        [*] Using SDMC0