From 1aaed0c29e92f5cb9484c7fae18b382c9f42bd94 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:31:18 -0500 Subject: [PATCH 1/8] expand instructions --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 93b53e1..a386a1b 100644 --- a/README.md +++ b/README.md @@ -5,23 +5,60 @@ ### Requirements - - xargo or cargo xbuild - - xtensa-esp32-elf toolchain must be in your `$PATH` - - esptool, if targeting the esp32 or esp8266 +#### llvm-xtensa +Please refer to the [llvm-xtensa](https://github.com/espressif/llvm-xtensa) project for authoratative instructions. + $ git clone https://github.com/espressif/llvm-xtensa + $ cd llvm-xtensa + $ mkdir build + $ cd build + $ cmake .. -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja" + $ make -First you will need to build `rustc` and `llvm` you can find rough instructions [here](https://gist.github.com/MabezDev/26e175790f84f2f2b0f9bca4e63275d1). +Calling make with an appropriate number of threads will speed the process considerably. Many use the guideline "number of cores + 1". For example, for a processor with 4 logical cores: + + $ make -j5 -## Starting a new project +#### rust-xtensa +Please refer to the [rust-xtensa](https://github.com/MabezDev/rust-xtensa) project for authoratative instructions. + $ git clone https://github.com/MabezDev/rust-xtensa + $ cd rust-xtensa + $ git checkout xtensa-target + $ ./configure --llvm-root=$HOME/llvm-xtensa/build + $ ./x.py build -`$ cargo generate --git https://github.com/MabezDev/xtensa-rust-quickstart` +#### xtensa-esp32-elf toolchain +Instructions can be found [on Espressif's web site](https://docs.espressif.com/projects/esp-idf/en/release-v3.0/get-started/linux-setup.html). -Requires cargo generate. +Download the archived toolchain file, and extract it to the directory of your choice. Then add that directory to your `$PATH`. For example: + $ mkdir ~/esp + $ tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz -C ~/esp + $ PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" -## Workflow +#### xargo or cargo xbuild + $ cargo install xargo -Update `setenv` to use your xtensa enabled rustc, then simply run `source setenv`. -From then on, you can just call `xargo build` or use the built in `flash` script to build and flash to the esp. +or + $ cargo install xbuild + +#### esptool + $ pip install esptool + +### Starting a new project + $ git clone https://github.com/MabezDev/xtensa-rust-quickstart + +### Workflow +Update `CUSTOM_RUSTC` in `setenv` to point to the version of rust you compiled earlier. + +Then load the environment variables with `source setenv` + +If you installed `xbuild` instead of `xargo`, you will need to update `flash` and `flash_release` accordingly. + +You should now be able to call xargo (or cargo xbuild) to build the project. You can also run the flash script to both build the project, and flash it to the ESP32 + +You may need to change the parameter `BLINKY_GPIO` +Adjustments to the chip's IO_MUX peripheral may be necessary, which will require familiarty with the ESP32 Technical Reference Manual +See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. ## Resources @@ -31,4 +68,4 @@ From then on, you can just call `xargo build` or use the built in `flash` script ## FAQ - `error: intermittent IO error while iterating directory` - try creating that directory -- `undefined reference to .L` see [this issue](https://github.com/MabezDev/xtensa-rust-quickstart/issues/1) \ No newline at end of file +- `undefined reference to .L` see [this issue](https://github.com/MabezDev/xtensa-rust-quickstart/issues/1) From 5e725418c0b70ea51a6c0c4a181f335b19bcc4f1 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:34:20 -0500 Subject: [PATCH 2/8] fixed formatting --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a386a1b..7344c71 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ #### llvm-xtensa Please refer to the [llvm-xtensa](https://github.com/espressif/llvm-xtensa) project for authoratative instructions. + $ git clone https://github.com/espressif/llvm-xtensa $ cd llvm-xtensa $ mkdir build @@ -14,12 +15,15 @@ Please refer to the [llvm-xtensa](https://github.com/espressif/llvm-xtensa) proj $ cmake .. -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja" $ make -Calling make with an appropriate number of threads will speed the process considerably. Many use the guideline "number of cores + 1". For example, for a processor with 4 logical cores: +Calling make with an appropriate number of threads will speed the process considerably. + +Many use the guideline `n + 1`, where `n` is the number of processor cores on your machine. For example, for a processor with 4 logical cores: $ make -j5 #### rust-xtensa Please refer to the [rust-xtensa](https://github.com/MabezDev/rust-xtensa) project for authoratative instructions. + $ git clone https://github.com/MabezDev/rust-xtensa $ cd rust-xtensa $ git checkout xtensa-target @@ -30,6 +34,7 @@ Please refer to the [rust-xtensa](https://github.com/MabezDev/rust-xtensa) proje Instructions can be found [on Espressif's web site](https://docs.espressif.com/projects/esp-idf/en/release-v3.0/get-started/linux-setup.html). Download the archived toolchain file, and extract it to the directory of your choice. Then add that directory to your `$PATH`. For example: + $ mkdir ~/esp $ tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz -C ~/esp $ PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" From bfeff7f54f622e70ac8029add66feb4467b813c8 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:36:08 -0500 Subject: [PATCH 3/8] updated formatting --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7344c71..c8e00f4 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,10 @@ If you installed `xbuild` instead of `xargo`, you will need to update `flash` an You should now be able to call xargo (or cargo xbuild) to build the project. You can also run the flash script to both build the project, and flash it to the ESP32 -You may need to change the parameter `BLINKY_GPIO` -Adjustments to the chip's IO_MUX peripheral may be necessary, which will require familiarty with the ESP32 Technical Reference Manual +You may need to change the parameter `BLINKY_GPIO`. + +Adjustments to the chip's IO_MUX peripheral may be necessary, which will require familiarty with the ESP32 Technical Reference Manual. + See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. ## Resources From 9df9c1d3e8c169a5c974bea36ec478095fcdd410 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:38:39 -0500 Subject: [PATCH 4/8] updated formatting --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c8e00f4..52d4b82 100644 --- a/README.md +++ b/README.md @@ -53,19 +53,13 @@ or $ git clone https://github.com/MabezDev/xtensa-rust-quickstart ### Workflow -Update `CUSTOM_RUSTC` in `setenv` to point to the version of rust you compiled earlier. - -Then load the environment variables with `source setenv` +Update `CUSTOM_RUSTC` in `setenv` to point to the version of rust you compiled earlier. Then load the environment variables with `source setenv`. If you installed `xbuild` instead of `xargo`, you will need to update `flash` and `flash_release` accordingly. You should now be able to call xargo (or cargo xbuild) to build the project. You can also run the flash script to both build the project, and flash it to the ESP32 -You may need to change the parameter `BLINKY_GPIO`. - -Adjustments to the chip's IO_MUX peripheral may be necessary, which will require familiarty with the ESP32 Technical Reference Manual. - -See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. +You will need to change the parameter `BLINKY_GPIO` to match your board's LED pin. Unfortunately, this may require adjustments to the chip's IO_MUX peripheral, which will require familiarty with the ESP32 Technical Reference Manual. See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. ## Resources From 5353d948960ce73c18a5472563c5228c32df789d Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:39:39 -0500 Subject: [PATCH 5/8] changed wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52d4b82..738c9b7 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ If you installed `xbuild` instead of `xargo`, you will need to update `flash` an You should now be able to call xargo (or cargo xbuild) to build the project. You can also run the flash script to both build the project, and flash it to the ESP32 -You will need to change the parameter `BLINKY_GPIO` to match your board's LED pin. Unfortunately, this may require adjustments to the chip's IO_MUX peripheral, which will require familiarty with the ESP32 Technical Reference Manual. See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. +You will need to change the parameter `BLINKY_GPIO` to match your board's LED pin. Unfortunately, this may require adjustments to the chip's IO_MUX peripheral, which will require consulting the ESP32 Technical Reference Manual. See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. ## Resources From df27a2795d04f33de0a090926c279be298b3b093 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:31:18 -0500 Subject: [PATCH 6/8] expand instructions --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 93b53e1..03d9d86 100644 --- a/README.md +++ b/README.md @@ -5,23 +5,63 @@ ### Requirements - - xargo or cargo xbuild - - xtensa-esp32-elf toolchain must be in your `$PATH` - - esptool, if targeting the esp32 or esp8266 +#### llvm-xtensa +Please refer to the [llvm-xtensa](https://github.com/espressif/llvm-xtensa) project for authoratative instructions. -First you will need to build `rustc` and `llvm` you can find rough instructions [here](https://gist.github.com/MabezDev/26e175790f84f2f2b0f9bca4e63275d1). + $ git clone https://github.com/espressif/llvm-xtensa + $ cd llvm-xtensa + $ mkdir build + $ cd build + $ cmake .. -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja" + $ make -## Starting a new project +Calling make with an appropriate number of threads will speed the process considerably. -`$ cargo generate --git https://github.com/MabezDev/xtensa-rust-quickstart` +Many use the guideline `n + 1`, where `n` is the number of processor cores on your machine. For example, for a processor with 4 logical cores: + + $ make -j5 -Requires cargo generate. +#### rust-xtensa +Please refer to the [rust-xtensa](https://github.com/MabezDev/rust-xtensa) project for authoratative instructions. -## Workflow +Assuming you built llvm-xtensa in your home directory: -Update `setenv` to use your xtensa enabled rustc, then simply run `source setenv`. -From then on, you can just call `xargo build` or use the built in `flash` script to build and flash to the esp. + $ git clone https://github.com/MabezDev/rust-xtensa + $ cd rust-xtensa + $ git checkout xtensa-target + $ ./configure --llvm-root=$HOME/llvm-xtensa/build + $ ./x.py build +#### xtensa-esp32-elf toolchain +Instructions can be found [on Espressif's web site](https://docs.espressif.com/projects/esp-idf/en/release-v3.0/get-started/linux-setup.html). + +Download the archived toolchain file, and extract it to the directory of your choice. Then add the toolchain's bin/ directory to your `$PATH`. For example: + + $ mkdir ~/esp + $ tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz -C ~/esp + $ PATH="$PATH:$HOME/esp/xtensa-esp32-elf/bin" + +#### xargo or cargo xbuild + $ cargo install xargo + +or + + $ cargo install xbuild + +#### esptool + $ pip install esptool + +### Starting a new project + $ git clone https://github.com/MabezDev/xtensa-rust-quickstart + +### Workflow +Update `CUSTOM_RUSTC` in `setenv` to point to the version of rust you compiled earlier. Then load the environment variables with `source setenv`. + +If you installed `xbuild` instead of `xargo`, you will need to update `flash` and `flash_release` accordingly. + +You should now be able to call xargo (or cargo xbuild) to build the project. You can also run the flash script to both build the project, and flash it to the ESP32 + +You will need to change the parameter `BLINKY_GPIO` to match your board's LED pin. Unfortunately, this may require adjustments to the chip's IO_MUX peripheral, which will require consulting the ESP32 Technical Reference Manual. See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. ## Resources @@ -31,4 +71,4 @@ From then on, you can just call `xargo build` or use the built in `flash` script ## FAQ - `error: intermittent IO error while iterating directory` - try creating that directory -- `undefined reference to .L` see [this issue](https://github.com/MabezDev/xtensa-rust-quickstart/issues/1) \ No newline at end of file +- `undefined reference to .L` see [this issue](https://github.com/MabezDev/xtensa-rust-quickstart/issues/1) From f7a93932504628846f8f6b05f45b574ce94dbeb7 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Mon, 27 Jan 2020 20:48:16 -0500 Subject: [PATCH 7/8] tweaked wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03d9d86..9296351 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ If you installed `xbuild` instead of `xargo`, you will need to update `flash` an You should now be able to call xargo (or cargo xbuild) to build the project. You can also run the flash script to both build the project, and flash it to the ESP32 -You will need to change the parameter `BLINKY_GPIO` to match your board's LED pin. Unfortunately, this may require adjustments to the chip's IO_MUX peripheral, which will require consulting the ESP32 Technical Reference Manual. See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. +You will need to change the parameter `BLINKY_GPIO` to match your board's LED pin. Unfortunately, this may require adjustments to the chip's IO_MUX peripheral, which will mean consulting the ESP32 Technical Reference Manual. See [this issue](https://github.com/MabezDev/idf2svd/issues/11) for more information. ## Resources From 543b9c70ba386d48c258641483c06133d578f530 Mon Sep 17 00:00:00 2001 From: Andrew Hepp Date: Thu, 30 Jan 2020 20:32:08 -0500 Subject: [PATCH 8/8] updated to point to current espressif llvm project --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9296351..8ba8409 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ ### Requirements #### llvm-xtensa -Please refer to the [llvm-xtensa](https://github.com/espressif/llvm-xtensa) project for authoratative instructions. +Please refer to [Espressif's llvm](https://github.com/espressif/llvm-project) project for authoratative instructions. - $ git clone https://github.com/espressif/llvm-xtensa - $ cd llvm-xtensa + $ git clone https://github.com/espressif/llvm-project + $ cd llvm-project/llvm $ mkdir build $ cd build $ cmake .. -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja" @@ -24,12 +24,12 @@ Many use the guideline `n + 1`, where `n` is the number of processor cores on yo #### rust-xtensa Please refer to the [rust-xtensa](https://github.com/MabezDev/rust-xtensa) project for authoratative instructions. -Assuming you built llvm-xtensa in your home directory: +Assuming you built llvm in your home directory: $ git clone https://github.com/MabezDev/rust-xtensa $ cd rust-xtensa $ git checkout xtensa-target - $ ./configure --llvm-root=$HOME/llvm-xtensa/build + $ ./configure --llvm-root=$HOME/llvm-project/llvm/build $ ./x.py build #### xtensa-esp32-elf toolchain