]> granicus.if.org Git - esp-idf/commitdiff
translated some parts in get-started section to zh_CN
authormorris <maoshengrong@espressif.com>
Thu, 16 Aug 2018 02:31:04 +0000 (10:31 +0800)
committerRoland Dobai <dobai.roland@gmail.com>
Thu, 23 Aug 2018 06:28:57 +0000 (08:28 +0200)
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
docs/zh_CN/get-started/linux-setup-scratch.rst
docs/zh_CN/get-started/linux-setup.rst
docs/zh_CN/get-started/macos-setup-scratch.rst
docs/zh_CN/get-started/macos-setup.rst

index 85497278b1a30ed0deda74e8935f3d7c201b3f9f..338566bc1ea129d30c7cb473dcc05aa22e7b0b1b 100644 (file)
@@ -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:
 
index be9ac0158b41d95436b6da9abc0c431f01ffd81b..2308587523f471b1dcf51f612a13bbb7daf74c15 100644 (file)
@@ -1 +1,70 @@
-.. include:: ../../en/get-started/linux-setup-scratch.rst
\ No newline at end of file
+**********************************
+从零开始设置 Linux 环境下的工具链
+**********************************
+
+除了直接从 Espressif 官网下载二进制格式的工具链,下面将再介绍一种可替代的办法。如果想要快速设置二进制工具链而不是手动从源码编译,请做好备份,并前往 :doc:`Linux 环境下的设置 <linux-setup>` 章节。
+
+
+安装必要的工具
+==============
+
+要想使用 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 软件包 <get-started-get-packages>` 章节,通过 ``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 下设置环境变量的标准方法 <setup-linux-toolchain-add-it-to-path>` 中的介绍,将工具链添加到 ``PATH`` 中。
+
+
+下一步
+======
+
+继续设置开发环境,请前往 :ref:`获取 ESP-IDF <get-started-get-esp-idf>` 章节。
index 500f248ee75696dbbbd32a125726194bc9efa36b..337470fd5bb914ed71139f5779f59fcc3c5b399c 100644 (file)
@@ -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 软件包 <get-started-get-packages>` 章节,通过 ``pip`` 工具来安装支持的版本。
+
 工具链的设置
 ===============
 
index f80efb8067d2f41d2c2840b2eed5356cccac22a3..5b0ab044c5915352ce455c9abad5fcd76c55169f 100644 (file)
@@ -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 软件包 <get-started-get-packages>`。
+
+从源代码编译工具链
+==================
+
+- 安装依赖:
+
+  - 安装 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 下设置环境变量的标准方法 <setup-macos-toolchain-add-it-to-path>` 中的介绍,将工具链添加到 ``PATH`` 中。
+
+
+下一步
+======
+
+继续设置开发环境,请前往 :ref:`获取 ESP-IDF <get-started-get-esp-idf>` 章节。
index 18c325303b5a474d289263becd9d208729522547..4e82123326905dfa63ed5f72338c609a53384206 100644 (file)
 
     sudo easy_install pip
 
-- 安装 pyserial::
-
-    sudo pip install pyserial
+.. note::
 
+    ``pip`` 稍后将用于安装 :ref:`必要的 Python 软件包 <get-started-get-packages>`。
 
 安装工具链
 ===============