Edit online

目录和代码结构

Luban SDK 目录结构总览如下:
aic1602 $ tree -L 2
├── application     // 存放APP代码
│   ├── baremetal
├── bsp // 存放BSP代码,和RT-Thread原生的bsp目录功能相同
│   ├── artinchip // ArtInChip SoC内部的driver、hal以及最小系统sys代码
│   ├── common    // 公共头文件
│   ├── peripheral       // 一些外设模块的驱动
│   ├── examples_bare    // 各模块在裸机环境的示例代码
│   └── examples         // 各模块在RTOS环境的示例代码
│       ├── test-alarm
│       ├── test-audio
│       ├── test-can
│       ├── test-dma
│       ├── test-qspi
│       ├── test-touch
│       └── test-uart
├── doc // Luban-Lite SDK的介绍文档
│   ├── luban-lite_driver_development_guid.md  // 设备驱动开发指南
│   ├── luban-lite_sdk_design.md // SDK设计说明
│   ├── luban-lite_user_guid_linux.md // Linux环境的用户使用说明
│   └── luban-lite_user_guid_windows.md // Windows环境的用户使用说明
├── win_env.bat // 启动RT-Thread的env工具,用于Windows环境的开发
├── win_cmd.bat // 启动CMD.exe,用于Windows环境的开发
├── kernel // 存放各种RTOS内核
│   ├── common
│   ├── freertos
│   └── rt-thread
├── output // SDK的编译输出
├── packages // 组件包
│   ├── artinchip // ArtInChip开发的组件包
│   └── third-party // 第三方的组件包
├── target // 方案(板)级的代码和配置
│   ├── configs // 整个方案的SDK配置文件
│   └── d21x // d21x 芯片对应的板级代码(见子目录)
│      ├── demo100-nand
│      ├── per2-nand
│      └── per2-nor
├── toolchain // 解压后的工具链存放目录
└── tools // 一些工具
    ├── onestep.sh  // ArtInChip开发的OneStep命令行增强工具
    └── toolchain // 工具链的压缩包
以下是部分目录结构详细说明:
  1. application:存放应用和各种示例
    ├── baremetal           //baremetal 裸机
    │   ├── bootloader      //系统的引导加载程序
    │   └── helloworld      //系统示例
    └── os
        └── helloworld      //系统示例
  2. bsp:SoC 的核心,封装了该 SoC 的所有接口和驱动
    ├── artinchip
    │   ├── drv                 //驱动
    │   ├── hal                 //硬件抽象
    │   ├── include
    │   ├── SConscript
    │   └── sys                 //最小系统
    ├── common
    │   ├── include
    │   └── SConscript
    ├── Kconfig
    ├── peripheral              //三方外设驱动封装
    │   ├── Kconfig
    │   ├── SConscript
    │   ├── touch               //触控
    │   └── wireless            //无线
    └── SConscript
  3. doc:遵从 RT-Thread 原始建议使用 Markdown 编写的 SDK 的简单设计和使用文档。

  4. package:组件包,包括 ArtInChip 开发的组件和 三方组件,支持从 RT-Thread online 下载。
    ├── artinchip           //ArtInChip 开发
    │   ├── Kconfig
    │   ├── mpp
    │   └── SConscript
    ├── Kconfig
    ├── SConscript
    └── third-party         //三方组件
        ├── bonnie
        ├── cherryusb
        ├── cpu_usage
        ├── Kconfig
        ├── littlefs
        ├── lvgl
        ├── lwip
        ├── mklittlefs
        ├── ramdisk
        ├── SConscript
        └── uffs
  5. target:存储方案(开发板)的配置信息。
    1. configs。文件示例如下:

      cat d21x_demo88-nor_baremetal_helloworld_defconfig
      CONFIG_SOC_THEAD_SMART=y
      # CONFIG_QEMU_RUN is not set
      CONFIG_PRJ_CUSTOM_LDS=""
      CONFIG_AIC_CHIP_D21X=y
      CONFIG_CACHE_LINE_SIZE=64
      CONFIG_AIC_CMU_DRV=y
      CONFIG_AIC_CMU_DRV_V10=y
      CONFIG_AIC_CMU_DRV_VER="10"
    2. d21x

      ├── demo100-nand
      │   ├── board.c
      │   ├── include
      │   ├── Kconfig.board
      │   ├── pack
      │   ├── pinmux.c
      │   ├── SConscript
      │   └── sys_clk.c
      ├── demo100-nor
      ├── demo88-nand
      ├── demo88-nor
  6. toolchain:原始为空目录,用于存放解压后的工具链。

  7. tools:用于存放一些常用工具
    • onestep.sh : Linux 上使用的 onestep 脚本

    • env : 环境搭建和运行需要的三方工具

    • script: 编译和打包固件需要的脚本

    • toolchain: 工具链包

      • Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1-20220906.tar.gz : Linux 工具链

      • Xuantie-900-gcc-elf-newlib-mingw-V2.6.1-20220906.tar.gz : Windows 工具链