生成固件
每一块开发板可以对应一个工程,工程的代码存放于 target/ic/ 目录下。 关于代码结构的详细说明,可查看准备代码。
在进行工程编译前,可以使用已有的工程,也可以建一个给开发板使用的独立工程。
选择已有工程
-
主控: D21x、D13x、D21x
-
系统:RT-Thread、FreeRTOS
-
存储:SPINAND、SPINOR、eMMC
工程名称 |
存储 |
封装 |
Memory |
屏幕 |
其它功能 |
|
---|---|---|---|---|---|---|
d12x_demo68-nand |
SPINAND |
QFN68 |
PSRAM |
RGB888 |
RS485, RS232, UART, SDIO WIFI, TFCARD |
|
d12x_demo68-nor |
SPINOR |
QFN68 |
PSRAM |
RGB |
RS485, RS232, UART, SDIO WIFI, TFCARD |
|
d12x_hmi-nor |
SPINOR |
QFN68 |
PSRAM |
RGB |
JART, TFCARD |
|
d13x_demo88-nand |
SPINAND |
QFN88 |
PSRAM |
LVDS |
RTP/CTP, UART, RTC, SDCARD, DMIC |
|
d13x_kunlunpi88-nor |
SPINOR |
QFN88 |
PSRAM |
RGB565 |
CTP, SDCARD, DVP, RS485 |
|
d21x_demo128-nand |
SPI NAND |
QFN128 |
128M ddr3 |
LVDS |
CTP, MAC, CAN, SDCARD, USB |
|
g73x_demo100-nor |
SPINOR |
QFN100 |
SRAM |
QSPI |
CTP, 2xGMAC, SDCARD, WiFi, 2xUSB, RS485 |
建立新工程
- 使用 add-board 命令创建新板子对应的工程。该命令会参考某一个已经存在的工程建立一个全新命名的工程,
参考工程的选择依然需要按照存储、屏幕和封装的优先级进行。
scons --add-board
-
从芯片列表中选择板子使用的芯片,例如选择 2: D21x:
Chip list: 0: d12x 1: d13x 2: d21x 3: g73x Select chip for new board(number): 2 d21x
-
根据 SDK 已有板级配置选择需要参考的配置。
参考已有配置时,按照芯片型号、存储的类型、Pin 脚数量进行选择。
Reference defconfig:(Create new board base on selected defconfig): 0: d21x_d215-demo88-nand_rt-thread_helloworld_defconfig 1: d21x_d215-demo88-nor_rt-thread_helloworld_defconfig 2: d21x_demo100-nor_rt-thread_helloworld_defconfig 3: d21x_demo128-nand_rt-thread_helloworld_defconfig Select reference defconfig for new board(number): 3 d21x_demo128-nand_rt-thread_helloworld_defconfig
-
输入板级配置的名称,使用中划线隔开词语,且添加 flash 类型,比如 nand/nor。
Input new board's name: custom-board-nand custom-board-nand
-
点击回车使用默认的应用名称,也可以输入其他名字后点击回车。
Input new app's name: (default helloworld) helloworld
-
输入厂商名称,串口调试终端可以看到厂商名称:
Input manufacturer's name: custom custom Copy D:\03_code\luban-lite_v1r1r1\luban-lite\target\configs\d21x_demo128-nand_rt-thread_helloworld_defconfig to D:\03_code\luban-lite_v1r1r1\luban-lite\target\configs\d21x_custom-board-nand_rt-thread_helloworld_defconfig Copy D:\03_code\luban-lite_v1r1r1\luban-lite\target\configs\d21x_demo128-nand_baremetal_bootloader_defconfig to D:\03_code\luban-lite_v1r1r1\luban-lite\target\configs\d21x_custom-board-nand_baremetal_bootloader_defconfig Copy D:\03_code\luban-lite_v1r1r1\luban-lite\target\d21x\demo128-nand to D:\03_code\luban-lite_v1r1r1\luban-lite\target\d21x\custom-board-nand Add board custom-board-nand for custom succeed!
-
选择合适的工程后,可以使用以下命令编译工程:
-
列出当前所有的工程默认配置:
list
输出结果示例如下:list scons: Reading SConscript files ... Built-in configs: 0. d12x_demo68-nand_rt-thread_helloworld 1. d12x_demo68-nor_rt-thread_helloworld 2. d12x_hmi-nor_rt-thread_helloworld 3. d13x_demo68-nor_rt-thread_helloworld 4. d13x_demo88-nand_rt-thread_helloworld 5. d13x_demo88-nor_rt-thread_helloworld 6. d13x_hspi100-nor_rt-thread_helloworld 7. d13x_kunlunpi88-nor_rt-thread_helloworld 8. d21x_custom-board-nand_rt-thread_helloworld //新生成的配置 9. d21x_d215-demo88-nand_rt-thread_helloworld 10. d21x_d215-demo88-nor_rt-thread_helloworld 11. d21x_demo100-nor_rt-thread_helloworld 12. d21x_demo128-nand_rt-thread_helloworld 13. g73x_demo100-nor_rt-thread_helloworld 14. g73x_demo68-nor_rt-thread_helloworld 15. g73x_scan_rt-thread_helloworld
-
加载应用其中一条工程配置:
lunch <配置编号>
比如应用第八个配置:lunch 8
scons: Reading SConscript files ... Load config from target\configs\d21x_custom-board-nand_rt-thread_helloworld_defconfig
-
准备工作完成后即可顺利编译出固件。