From a4dcee25d0fcfea98bb2c3c50c5b49051d26f167 Mon Sep 17 00:00:00 2001 From: Ryan Tolboom Date: Mon, 1 Nov 2021 17:25:59 -0400 Subject: [PATCH 1/2] more docs on building arduino-esp32 --- .../other/esp32-arduino-build-notes.md | 59 +++++++++++++------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/website/docs/software/other/esp32-arduino-build-notes.md b/website/docs/software/other/esp32-arduino-build-notes.md index 44d3debd..f35c6a86 100644 --- a/website/docs/software/other/esp32-arduino-build-notes.md +++ b/website/docs/software/other/esp32-arduino-build-notes.md @@ -1,33 +1,56 @@ --- -id: esp32-arduino-build-notes -title: esp32-arduino build instructions +id: esp32-arduino-build +title: esp32-arduino Build Instructions sidebar_label: Building esp32-arduino --- -We build our own custom version of esp32-arduino, in order to get some fixes we've made but haven't yet been merged in master. +For ESP32 boards, we use our own [custom version of arduino-esp32 core](https://github.com/meshtastic/arduino-esp32). You can find the version used in the [`platform_packages argument` in `platformio.ini`](https://github.com/meshtastic/Meshtastic-device/blob/51646f28eccf0de461ecac7d771e1a39ef33ff43/platformio.ini#L119-L120) in the [Meshtastic-device repo](https://github.com/meshtastic/Meshtastic-device). It is built using a [modified `esp32-arduino-lib-builder`](https://github.com/meshtastic/esp32-arduino-lib-builder) which pulls the correct repos for some modified libraries. This allows for some fixes we've made that haven't yet been merged in master. -These are a set of currently unformatted notes on how to build and install them. Most developers should not care about this, because -you'll automatically get our fixed libraries. +Most developers should not care about this, because you'll automatically get our fixed libraries. However, if you would like to tweak the core options this documentation describes how to do it in Linux: + +1. [Install ESP32 Arduino Lib Builder](https://github.com/meshtastic/esp32-arduino-lib-builder/blob/master/README.md): + +```console +sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache +sudo pip install --upgrade pip +git clone https://github.com/meshtastic/esp32-arduino-lib-builder +cd esp32-arduino-lib-builder +``` +2. Install esp-idf (needed if you want to `make menuconfig`, `build.sh` will install it automatically if needed): ```bash - //last EDF release in arduino is: https://github.com/espressif/arduino-esp32/commit/1977370e6fc069e93ffd8818798fbfda27ae7d99
- //IDF release/v3.3 46b12a560 - //IDF release/v3.3 367c3c09c - //https://docs.espressif.com/projects/esp-idf/en/release-v3.3/get-started/linux-setup.html - python /home/kevinh/development/meshtastic/ - cp -a out/tools/sdk/* components/arduino/tools/sdk - cp -ar components/arduino/* ~/.platformio/packages/framework-arduinoespressif32 +./tools/install-esp-idf.sh +``` - /// @src-fba9d33740f719f712e9f8b07da6ea13/ +3. Run menuconfig and change options as needed: - or +```bash +make IDF_PATH=$(pwd)/esp-idf menuconfig +``` +4. [Patch the Azure_IoT library](https://github.com/VSChina/ESP32_AzureIoT_Arduino/pull/15): + +```bash +cd components/arduino/libraries/AzureIoT +wget https://patch-diff.githubusercontent.com/raw/VSChina/ESP32_AzureIoT_Arduino/pull/15.patch +patch -p1 < 15.patch +cd ../../../../ +``` + +5. Build esp32-arduino: + +```bash +./build.sh +``` + +6. Copy files into the platformio framework: + +```bash cp -ar out/tools/sdk/* ~/.platformio/packages/framework-arduinoespressif32/tools/sdk - ``` -How to flash new bootloader - +7. Flash a new bootloader if needed: + ```bash -esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 /home/kevinh/development/meshtastic/esp32-arduino-lib-builder/build/bootloader/bootloader.bin +esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port your_port --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 build/bootloader/bootloader.bin ``` From 9d8b762dc6202baa9fcaf68b810812a8437faaa9 Mon Sep 17 00:00:00 2001 From: Ryan Tolboom Date: Tue, 2 Nov 2021 10:47:44 -0400 Subject: [PATCH 2/2] updated esp32-arduino build instructions --- ...ino-build-notes.md => esp32-arduino-build.md} | 16 ++++++++-------- website/sidebars.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) rename website/docs/software/other/{esp32-arduino-build-notes.md => esp32-arduino-build.md} (59%) diff --git a/website/docs/software/other/esp32-arduino-build-notes.md b/website/docs/software/other/esp32-arduino-build.md similarity index 59% rename from website/docs/software/other/esp32-arduino-build-notes.md rename to website/docs/software/other/esp32-arduino-build.md index f35c6a86..e9b9aba9 100644 --- a/website/docs/software/other/esp32-arduino-build-notes.md +++ b/website/docs/software/other/esp32-arduino-build.md @@ -4,11 +4,11 @@ title: esp32-arduino Build Instructions sidebar_label: Building esp32-arduino --- -For ESP32 boards, we use our own [custom version of arduino-esp32 core](https://github.com/meshtastic/arduino-esp32). You can find the version used in the [`platform_packages argument` in `platformio.ini`](https://github.com/meshtastic/Meshtastic-device/blob/51646f28eccf0de461ecac7d771e1a39ef33ff43/platformio.ini#L119-L120) in the [Meshtastic-device repo](https://github.com/meshtastic/Meshtastic-device). It is built using a [modified `esp32-arduino-lib-builder`](https://github.com/meshtastic/esp32-arduino-lib-builder) which pulls the correct repos for some modified libraries. This allows for some fixes we've made that haven't yet been merged in master. +For ESP32 boards, we use our own [custom version of arduino-esp32 core](https://github.com/meshtastic/arduino-esp32). You can find the version used in the [platform_packages argument in platformio.ini](https://github.com/meshtastic/Meshtastic-device/blob/51646f28eccf0de461ecac7d771e1a39ef33ff43/platformio.ini#L119-L120) in the [Meshtastic-device repo](https://github.com/meshtastic/Meshtastic-device). It is built using a [modified esp32-arduino-lib-builder](https://github.com/meshtastic/esp32-arduino-lib-builder) which pulls the correct repos for some modified libraries. This allows for some fixes we've made that haven't yet been merged in master. Most developers should not care about this, because you'll automatically get our fixed libraries. However, if you would like to tweak the core options this documentation describes how to do it in Linux: -1. [Install ESP32 Arduino Lib Builder](https://github.com/meshtastic/esp32-arduino-lib-builder/blob/master/README.md): +[Install ESP32 Arduino Lib Builder](https://github.com/meshtastic/esp32-arduino-lib-builder/blob/master/README.md): ```console sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache @@ -16,19 +16,19 @@ sudo pip install --upgrade pip git clone https://github.com/meshtastic/esp32-arduino-lib-builder cd esp32-arduino-lib-builder ``` -2. Install esp-idf (needed if you want to `make menuconfig`, `build.sh` will install it automatically if needed): +Install esp-idf (needed if you want to `make menuconfig`, `build.sh` will install it automatically if needed): ```bash ./tools/install-esp-idf.sh ``` -3. Run menuconfig and change options as needed: +Run menuconfig and change options as needed: ```bash make IDF_PATH=$(pwd)/esp-idf menuconfig ``` -4. [Patch the Azure_IoT library](https://github.com/VSChina/ESP32_AzureIoT_Arduino/pull/15): +[Patch the Azure_IoT library](https://github.com/VSChina/ESP32_AzureIoT_Arduino/pull/15): ```bash cd components/arduino/libraries/AzureIoT @@ -37,19 +37,19 @@ patch -p1 < 15.patch cd ../../../../ ``` -5. Build esp32-arduino: +Build esp32-arduino: ```bash ./build.sh ``` -6. Copy files into the platformio framework: +Copy sdk files into the platformio framework: ```bash cp -ar out/tools/sdk/* ~/.platformio/packages/framework-arduinoespressif32/tools/sdk ``` -7. Flash a new bootloader if needed: +Flash the new bootloader if needed: ```bash esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port your_port --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 build/bootloader/bootloader.bin diff --git a/website/sidebars.js b/website/sidebars.js index 57f66e2c..cf32e278 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -97,7 +97,7 @@ module.exports = { "software/other/nrf52-TODO", "software/other/mqtt", "software/other/install-OSX", - "software/other/esp32-arduino-build-notes", + "software/other/esp32-arduino-build", "software/other/build-instructions", "software/other/ant", ],