mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-23 05:08:45 +00:00
[doc] update rst
This commit is contained in:
parent
3c3e85b504
commit
926235b949
15 changed files with 663 additions and 104 deletions
|
@ -1,7 +1,7 @@
|
|||
CMake 框架的使用
|
||||
==================
|
||||
|
||||
本节主要介绍如何使用 CMake 框架。bl_mcu_sdk 中为用户封装了以下函数接口,基本满足常用场景的使用。
|
||||
本节主要介绍如何使用 CMake 框架。BouffaloSDK 中为用户封装了以下函数接口,基本满足常用场景的使用。
|
||||
|
||||
.. list-table::
|
||||
:widths: 30 30
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
Bouffalo Lab DevCube 的使用
|
||||
=============================
|
||||
|
||||
本文档将简要介绍一下如何使用 Bouffalo Lab DevCube 集成开发工具烧写代码.
|
||||
.. caution:: BouffaloSDK 不再使用此工具,使用 SDK 自带的命令行烧录工具
|
||||
|
||||
Bouffalo Lab Dev Cube 工具可以从博流智能开发者社区下载适合您操作系统的版本,下载地址:`https://dev.bouffalolab.com/download <https://dev.bouffalolab.com/download>`_ 。没有注册开发者账号的用户,可以点击开发者入口,使用 ``guest`` 用户进入。
|
||||
本文档将简要介绍一下如何使用 Bouffalo Lab DevCube 集成开发工具烧写代码。
|
||||
|
||||
Bouffalo Lab Dev Cube 工具可以从博流智能开发者社区下载适合您操作系统的版本,下载地址: `https://dev.bouffalolab.com/download <https://dev.bouffalolab.com/download>`_ 。没有注册开发者账号的用户,可以点击开发者入口,使用 ``guest`` 用户进入。
|
||||
|
||||
下载完成后,解压后即可使用。
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ Build and Debug with Eclipse
|
|||
.. figure:: img/eclipse1.png
|
||||
:alt:
|
||||
|
||||
- 其余需要的环境参考 :ref:`windows_cmd`
|
||||
- 其余步骤参考 :ref:`windows_cmd`
|
||||
|
||||
- 解压 Eclipse 并双击打开 `Eclipse.exe`
|
||||
|
||||
|
|
84
docs/source/get_started/flash_prog.rst
Normal file
84
docs/source/get_started/flash_prog.rst
Normal file
|
@ -0,0 +1,84 @@
|
|||
.. _flash_prog_cfg:
|
||||
|
||||
Flash prog cfg.ini 的使用
|
||||
=================================
|
||||
|
||||
在用户执行 ``make flash`` 会调用 **bouffalo_flash_cube** 下的可执行文件,并根据 **Flash prog cfg.ini** 进行烧录,
|
||||
本节主要介绍一下 **Flash prog cfg.ini** 的语法。
|
||||
|
||||
常规 MCU 使用(不使用无线功能)
|
||||
---------------------------------
|
||||
|
||||
.. code-block:: ini
|
||||
:linenos:
|
||||
|
||||
[cfg]
|
||||
# 0: no erase, 1:programmed section erase, 2: chip erase
|
||||
erase = 1
|
||||
# skip mode set first para is skip addr, second para is skip len, multi-segment region with ; separated
|
||||
skip_mode = 0x0, 0x0
|
||||
# 0: not use isp mode, #1: isp mode
|
||||
boot2_isp_mode = 0
|
||||
|
||||
[firmware]
|
||||
filedir = ./build/build_out/xxx*_$(CHIPNAME).bin
|
||||
address = 0x0000
|
||||
|
||||
|
||||
- **cfg** 表示烧录时的一些配置,正常不需要改动
|
||||
- **firmware** 要烧录的应用固件,必须使用 **firmware** 名称。
|
||||
|
||||
- **filedir** 表示应用固件所在相对路径,正常来说是编译完后放在 `build/build_out` 目录。 ``_$(CHIPNAME).bin`` 是必须要的后缀,用于区分不同芯片。 ``xxx`` 表示应用固件名称,与 `CMakeLists.txt` 中 `project(xxx)` 中名称一致。 ``*`` 表示正则匹配,可用可不用。
|
||||
- **address** 必须使用 0 地址
|
||||
|
||||
|
||||
常规 IOT 使用(使用无线功能)
|
||||
---------------------------------
|
||||
|
||||
.. code-block:: ini
|
||||
:linenos:
|
||||
|
||||
[cfg]
|
||||
# 0: no erase, 1:programmed section erase, 2: chip erase
|
||||
erase = 1
|
||||
# skip mode set first para is skip addr, second para is skip len, multi-segment region with ; separated
|
||||
skip_mode = 0x0, 0x0
|
||||
# 0: not use isp mode, #1: isp mode
|
||||
boot2_isp_mode = 0
|
||||
|
||||
[firmware]
|
||||
filedir = ./build/build_out/xxx*_$(CHIPNAME).bin
|
||||
address = 0x10000
|
||||
|
||||
[boot2]
|
||||
filedir = ./build/build_out/boot2_*.bin
|
||||
address = 0x000000
|
||||
|
||||
[partition]
|
||||
filedir = ./build/build_out/partition*.bin
|
||||
address = 0xE000
|
||||
|
||||
[mfg]
|
||||
filedir = ./build/build_out/mfg*.bin
|
||||
address = 0x210000
|
||||
|
||||
- **cfg** 表示烧录时的一些配置,正常不需要改动
|
||||
- **firmware** 要烧录的应用固件,必须使用 **firmware** 名称。
|
||||
|
||||
- **filedir** 表示应用固件所在相对路径,正常来说是编译完后放在 `build/build_out` 目录。 ``_$(CHIPNAME).bin`` 是必须要的后缀,用于区分不同芯片。 ``xxx`` 表示应用固件名称,与 `CMakeLists.txt` 中 `project(xxx)` 中名称一致。
|
||||
- **address** 由 `partition_xxx.toml` 指定
|
||||
|
||||
- **boot2** 要烧录的 boot2 固件,必须使用 **boot2** 名称。
|
||||
|
||||
- **filedir** 表示 boot2 固件所在相对路径,正常来说是编译完后放在 `build/build_out` 目录。 **自动从 bsp/board/board_name/config 目录拷贝**。
|
||||
- **address** 必须使用 0 地址
|
||||
|
||||
- **partition** 要烧录的 partition 固件,必须使用 **partition** 名称。
|
||||
|
||||
- **filedir** 表示 partition 固件所在相对路径,正常来说是编译完后放在 `build/build_out` 目录。 **自动从 bsp/board/board_name/config 目录 partition_xxx.toml 转换成 bin 文件并拷贝**。
|
||||
- **address** 由 `partition_xxx.toml` 指定
|
||||
|
||||
- **mfg** 要烧录的 mfg 固件,必须使用 **mfg** 名称。
|
||||
|
||||
- **filedir** 表示 mfg 固件所在相对路径,正常来说是编译完后放在 `build/build_out` 目录。 **自动从 bsp/board/board_name/config 目录拷贝**。
|
||||
- **address** 由 `partition_xxx.toml` 指定
|
BIN
docs/source/get_started/img/repo.png
Normal file
BIN
docs/source/get_started/img/repo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
|
@ -2,7 +2,7 @@
|
|||
开发环境搭建
|
||||
=======================
|
||||
|
||||
BL MCU SDK 提供了以下几种开发环境,包含安装、编译、烧录和调试,选择一种适合你的即可。
|
||||
BouffaloSDK 提供了以下几种开发环境,包含环境搭建、编译、烧录和调试,选择一种适合你的即可。
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
|
|
@ -68,7 +68,7 @@ Build with Linux or WSL
|
|||
gcc version 10.2.0 (Xuantie-900 elf newlib gcc Toolchain V2.2.5 B-20220323)
|
||||
|
||||
|
||||
- 在 linux 中,有严格的权限限制,通常一个用户对应一个权限,所以如果提示下面信息,表示需要设置 cmake 权限。
|
||||
- 在 linux 中,有严格的权限限制,通常一个用户对应一个权限,所以如果提示下面信息,表示需要设置权限。因此,我们将使用到的工具都设置好权限即可
|
||||
|
||||
.. figure:: img/cmake_error.png
|
||||
:align: center
|
||||
|
@ -78,8 +78,10 @@ Build with Linux or WSL
|
|||
.. code-block:: bash
|
||||
:linenos:
|
||||
|
||||
$ cd bl_mcu_sdk
|
||||
$ sudo chmod +x tools/cmake/bin/cmake
|
||||
$ cd bouffalo_sdk
|
||||
$ chmod 777 +x tools/cmake/bin/cmake
|
||||
$ chmod 777 +x tools/bflb_tools/bflb_fw_post_proc/bflb_fw_post_proc
|
||||
$ chmod 777 +x tools/bflb_tools/bouffalo_flash_cube/BLFlashCommand
|
||||
|
||||
编译
|
||||
-------------
|
||||
|
@ -92,7 +94,7 @@ Build with Linux or WSL
|
|||
:linenos:
|
||||
|
||||
$ cd examples/helloworld
|
||||
$ make CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
$ make CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl602、bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
|
||||
- 使用 ninja 编译
|
||||
|
||||
|
@ -100,6 +102,14 @@ Build with Linux or WSL
|
|||
:linenos:
|
||||
|
||||
$ cd examples/helloworld
|
||||
$ make ninja CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
$ make ninja CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl602、bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
|
||||
.. note :: 如果使用 BL808 或者 BL606P,需要在上面基础上添加 CPU_ID=id ,id 可以为 m0 或者 d0
|
||||
.. note :: 如果使用 BL808 或者 BL606P,需要在上面基础上添加 CPU_ID=id ,id 可以为 m0 或者 d0
|
||||
|
||||
- 烧录
|
||||
|
||||
.. code-block:: bash
|
||||
:linenos:
|
||||
|
||||
$ cd examples/helloworld
|
||||
$ make flash CHIP=chip_name COMX=port_name ## port_name 为串口号名称,比如 linux 中/dev/ttyACMx,wsl 中对应使用 /dev/ttySx
|
||||
|
|
39
docs/source/get_started/repo.rst
Normal file
39
docs/source/get_started/repo.rst
Normal file
|
@ -0,0 +1,39 @@
|
|||
Repo 的使用
|
||||
=======================
|
||||
|
||||
Repo 是谷歌用 Python 脚本写的调用 git 的一个脚本,可以实现管理多个 git 库,简单的几行命令便可以拉取很多仓库的代码。
|
||||
|
||||
安装
|
||||
--------
|
||||
|
||||
- 下载 `repo <https://github.com/bouffalolab/repo>`_ 。
|
||||
|
||||
- windows 下将 `repo.exe` 文件(在 win 目录中)所在的路径配置到系统环境变量。
|
||||
|
||||
.. figure:: img/repo.png
|
||||
:alt:
|
||||
|
||||
- Linux 下执行以下命令。
|
||||
|
||||
.. code-block:: bash
|
||||
:linenos:
|
||||
|
||||
cd repo/linux
|
||||
chmod +x repo
|
||||
mv repo /usr/bin/repo
|
||||
|
||||
下载代码
|
||||
----------
|
||||
|
||||
- 获取 SDK (只包含 BL616/BL618 版本)
|
||||
|
||||
.. code-block:: bash
|
||||
:linenos:
|
||||
|
||||
repo init -u https://gerrit.bouffalolab.com/bouffalo/manifest/bouffalo_sdk -b master -m bl616-public.xml
|
||||
|
||||
|
||||
同步代码
|
||||
----------
|
||||
|
||||
后续只需要使用 ``repo sync`` 即可同步代码。
|
|
@ -18,7 +18,8 @@ Build with Windows CMD
|
|||
$ cd d
|
||||
$ git clone git@gitee.com:bouffalolab/toolchain_gcc_t-head_windows.git
|
||||
|
||||
- 将 make、ninja、下载的 risc-v 工具链路径配置到系统环境变量中, 其中 make 和 ninja 工具位于 `bl_mcu_sdk/tools` 目录下。
|
||||
- 将 make、ninja、下载的 risc-v 工具链路径配置到系统环境变量中, 其中 make 和 ninja 工具位于 `bouffalo_sdk/tools` 目录下。
|
||||
- windows 11 配置完以后需要重启电脑才生效。
|
||||
|
||||
.. figure:: img/windows_path.png
|
||||
:alt:
|
||||
|
@ -72,7 +73,7 @@ Build with Windows CMD
|
|||
:linenos:
|
||||
|
||||
$ cd .\examples\helloworld\
|
||||
$ make CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
$ make CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl602、bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
|
||||
- 使用 ninja 编译
|
||||
|
||||
|
@ -80,6 +81,14 @@ Build with Windows CMD
|
|||
:linenos:
|
||||
|
||||
$ cd .\examples\helloworld\
|
||||
$ make ninja CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
$ make ninja CHIP=chip_name BOARD=board_name ## chip_name 为芯片型号,可以填写 bl602、bl702、bl616、bl808、bl606p, board_name 为开发板名称,详见 bsp/board 目录
|
||||
|
||||
.. note :: 如果使用 BL808 或者 BL606P,需要在上面基础上添加 CPU_ID=id ,id 可以为 m0 或者 d0
|
||||
.. note :: 如果使用 BL808 或者 BL606P,需要在上面基础上添加 CPU_ID=id ,id 可以为 m0 或者 d0
|
||||
|
||||
- 烧录
|
||||
|
||||
.. code-block:: bash
|
||||
:linenos:
|
||||
|
||||
$ cd examples/helloworld
|
||||
$ make flash CHIP=chip_name COMX=port_name ## port_name 为串口号名称,比如 COM5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue