From 1a799009706de9bd9bd8d307a7526963a42d82a7 Mon Sep 17 00:00:00 2001 From: morris Date: Thu, 16 Aug 2018 10:31:04 +0800 Subject: [PATCH] translated some parts in get-started section to zh_CN 1. "install required python packages" in docs/zh_CN/get-started/index.rst 2. docs/zh_CN/get-started/linux-setup-scratch.rst 3. docs/zh_CN/get-started/linux-setup.rst 4. docs/zh_CN/get-started/macos-setup-scratch.rst 5. docs/zh_CN/get-started/macos-setup.rst --- docs/zh_CN/get-started/index.rst | 14 +++- .../zh_CN/get-started/linux-setup-scratch.rst | 71 ++++++++++++++++++- docs/zh_CN/get-started/linux-setup.rst | 5 ++ .../zh_CN/get-started/macos-setup-scratch.rst | 67 ++++++++++++++++- docs/zh_CN/get-started/macos-setup.rst | 5 +- 5 files changed, 155 insertions(+), 7 deletions(-) diff --git a/docs/zh_CN/get-started/index.rst b/docs/zh_CN/get-started/index.rst index 85497278b1..338566bc1e 100644 --- a/docs/zh_CN/get-started/index.rst +++ b/docs/zh_CN/get-started/index.rst @@ -135,10 +135,20 @@ ESP32 是一套 Wi-Fi (2.4 GHz) 和蓝牙 (4.2) 双模解决方案,集成了 .. _get-started-get-packages: -Install the Required Python Packages +安装依赖的 Python 软件包 ==================================== -TODO +ESP-IDF 所依赖的 Python 软件包位于 ``$IDF_PATH/requirements.txt`` 文件中,您可以通过运行以下命令来安装它们: + +.. code:: bash + + sudo pip install -r $IDF_PATH/requirements.txt + +如果您没有系统的管理员权限,那么可以使用如下命令来将软件包安装到用户目录中: + +.. code:: bash + + pip install --user -r $IDF_PATH/requirements.txt .. _get-started-start-project: diff --git a/docs/zh_CN/get-started/linux-setup-scratch.rst b/docs/zh_CN/get-started/linux-setup-scratch.rst index be9ac0158b..2308587523 100644 --- a/docs/zh_CN/get-started/linux-setup-scratch.rst +++ b/docs/zh_CN/get-started/linux-setup-scratch.rst @@ -1 +1,70 @@ -.. include:: ../../en/get-started/linux-setup-scratch.rst \ No newline at end of file +********************************** +从零开始设置 Linux 环境下的工具链 +********************************** + +除了直接从 Espressif 官网下载二进制格式的工具链,下面将再介绍一种可替代的办法。如果想要快速设置二进制工具链而不是手动从源码编译,请做好备份,并前往 :doc:`Linux 环境下的设置 ` 章节。 + + +安装必要的工具 +============== + +要想使用 ESP-IDF 进行编译,您需要获取以下软件包: + +- Ubuntu 和 Debian:: + + sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial + +- Arch:: + + sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial + +.. note:: + + 一些旧的(2014年之前)Linux 发行版中使用的 ``pyserial`` 版本可能是 2.x , ESP-IDF并不支持。 + 在这种情况下,请参考 :ref:`安装依赖的 Python 软件包 ` 章节,通过 ``pip`` 工具来安装支持的版本。 + +从源代码编译工具链 +================== + +- 安装依赖: + + - CentOS 7:: + + sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool + + - Ubuntu pre-16.04:: + + sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool + + - Ubuntu 16.04:: + + sudo apt-get install gawk gperf grep gettext python python-dev automake bison flex texinfo help2man libtool libtool-bin + + - Debian 9:: + + sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool libtool-bin + + - Arch:: + + TODO + +下载 ``crosstool-NG`` 然后编译:: + + cd ~/esp + git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git + cd crosstool-NG + ./bootstrap && ./configure --enable-local && make install + +编译工具链:: + + ./ct-ng xtensa-esp32-elf + ./ct-ng build + chmod -R u+w builds/xtensa-esp32-elf + +编译得到的工具链会被保存到 ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``。根据 :ref:`Linux 下设置环境变量的标准方法 ` 中的介绍,将工具链添加到 ``PATH`` 中。 + + +下一步 +====== + +继续设置开发环境,请前往 :ref:`获取 ESP-IDF ` 章节。 diff --git a/docs/zh_CN/get-started/linux-setup.rst b/docs/zh_CN/get-started/linux-setup.rst index 500f248ee7..337470fd5b 100644 --- a/docs/zh_CN/get-started/linux-setup.rst +++ b/docs/zh_CN/get-started/linux-setup.rst @@ -20,6 +20,11 @@ Linux 平台工具链的标准设置 sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial +.. note:: + + 一些旧的(2014年之前)Linux 发行版中使用的 ``pyserial`` 版本可能是 2.x , ESP-IDF并不支持。 + 在这种情况下,请参考 :ref:`安装依赖的 Python 软件包 ` 章节,通过 ``pip`` 工具来安装支持的版本。 + 工具链的设置 =============== diff --git a/docs/zh_CN/get-started/macos-setup-scratch.rst b/docs/zh_CN/get-started/macos-setup-scratch.rst index f80efb8067..5b0ab044c5 100644 --- a/docs/zh_CN/get-started/macos-setup-scratch.rst +++ b/docs/zh_CN/get-started/macos-setup-scratch.rst @@ -1 +1,66 @@ -.. include:: ../../en/get-started/macos-setup-scratch.rst \ No newline at end of file +********************************** +从零开始设置 Mac OS 环境下的工具链 +********************************** + +安装必要的工具 +===================== + +- 安装 pip:: + + sudo easy_install pip + +.. note:: + + ``pip`` 稍后将用于安装 :ref:`必要的 Python 软件包 `。 + +从源代码编译工具链 +================== + +- 安装依赖: + + - 安装 MacPorts_ 或者 homebrew_ 包管理器。MacPorts 需要安装完整的 XCode 软件,但是 homebrew 只需要安装 XCode 命令行工具即可。 + + .. _homebrew: https://brew.sh/ + .. _MacPorts: https://www.macports.org/install.php + + - 对于 MacPorts:: + + sudo port install gsed gawk binutils gperf grep gettext wget libtool autoconf automake + + - 对于 homebrew:: + + brew install gnu-sed gawk binutils gperftools gettext wget help2man libtool autoconf automake + +创建大小写敏感的文件系统镜像:: + + hdiutil create ~/esp/crosstool.dmg -volname "ctng" -size 10g -fs "Case-sensitive HFS+" + +挂载:: + + hdiutil mount ~/esp/crosstool.dmg + +创建指向你工作目录的符号链接:: + + cd ~/esp + ln -s /Volumes/ctng crosstool-NG + +下载 ``crosstool-NG`` 然后编译:: + + cd ~/esp + git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git + cd crosstool-NG + ./bootstrap && ./configure --enable-local && make install + +编译工具链:: + + ./ct-ng xtensa-esp32-elf + ./ct-ng build + chmod -R u+w builds/xtensa-esp32-elf + +编译得到的工具链会被保存到 ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``。根据 :ref:`Mac OS 下设置环境变量的标准方法 ` 中的介绍,将工具链添加到 ``PATH`` 中。 + + +下一步 +====== + +继续设置开发环境,请前往 :ref:`获取 ESP-IDF ` 章节。 diff --git a/docs/zh_CN/get-started/macos-setup.rst b/docs/zh_CN/get-started/macos-setup.rst index 18c325303b..4e82123326 100644 --- a/docs/zh_CN/get-started/macos-setup.rst +++ b/docs/zh_CN/get-started/macos-setup.rst @@ -10,10 +10,9 @@ sudo easy_install pip -- 安装 pyserial:: - - sudo pip install pyserial +.. note:: + ``pip`` 稍后将用于安装 :ref:`必要的 Python 软件包 `。 安装工具链 =============== -- 2.40.0