|
23 | 23 | * 5.8.1. [Configuration for FTP server](#configuration-for-ftp-server) |
24 | 24 | * 6. [Building firmware](#building-firmware) |
25 | 25 | * 6.1. [PlatformIO](#platformio) |
26 | | - * 6.1.1. [TODO: Setup notes](#todo:-setup-notes) |
| 26 | + * 6.1.1. [TODO: Setup notes](#platformio-setup-notes) |
27 | 27 | * 6.2. [SmartThings device SDK build environment](#smartthings-device-sdk-build-environment) |
28 | 28 | * 6.2.1. [Setup build environment](#setup-build-environment) |
29 | 29 | * 6.2.2. [Configure the project](#configure-the-project) |
@@ -734,31 +734,52 @@ Examples: |
734 | 734 |
|
735 | 735 | ## 6. <a name='building-firmware'></a>Building firmware |
736 | 736 | ### 6.1. <a name='platformio'></a>PlatformIO |
737 | | -#### 6.1.1. <a name='todo:-setup-notes'></a>TODO: Setup notes |
| 737 | +#### 6.1.1. <a name='platformio-setup-notes'></a>Open the project and use the platformio UI inside of vscode to build and flash. Select esp32dev or esp32-poe-iso tree and select Build to compile. |
738 | 738 | ### 6.2. <a name='smartthings-device-sdk-build-environment'></a>SmartThings device SDK build environment |
739 | 739 | #### 6.2.1. <a name='setup-build-environment'></a>Setup build environment |
740 | | -- Follow the instructions in the [SmartThings SDK for Direct connected devices for C](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref) project for setting up a build environment. Confirm you can build the switch_example before continuing. |
741 | | -- Select the esp32 build environment. Branch v1.4 seems to be the current active branch and uses espidf v4.0.1-317-g50b3e2c81. |
| 740 | +- Based on the instructions in the [SmartThings SDK for Direct connected devices for C](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref) for setting up a build environment and [This community post](https://community.smartthings.com/t/how-to-build-direct-connected-devices/204055) to build the code inside of the stsdk c-ref build environment. |
742 | 741 | ``` |
| 742 | +# Make the root esp folder. |
| 743 | +cd ~ |
| 744 | +mkdir esp |
| 745 | +
|
| 746 | +# Install the xtensa esp32 compiler |
743 | 747 | cd ~/esp |
744 | | - git clone https://github.com/SmartThingsCommunity/st-device-sdk-c-ref.git -b release/v1.4 |
745 | | - cd st-device-sdk-c-ref |
746 | | -./setup.py esp32 |
747 | | -``` |
| 748 | +wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz |
| 749 | +tar -xvf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz |
748 | 750 |
|
749 | | -- Place the contents of this his project in ```st-device-sdk-c-ref/apps/esp32/``` |
| 751 | +# Get and install esp-idf toolchain v4.3.2 |
| 752 | +cd ~/esp |
| 753 | +git clone -b v4.3.2 --recursive https://github.com/espressif/esp-idf.git |
| 754 | +cd ~/esp/esp-idf |
| 755 | +./install.sh |
750 | 756 |
|
751 | | -#### 6.2.2. <a name='configure-the-project'></a>Configure the project |
| 757 | +# Install st-device-sdk-c-ref master branch currently v1.7.5. |
| 758 | +cd ~/esp |
| 759 | +git clone https://github.com/SmartThingsCommunity/st-device-sdk-c-ref.git |
| 760 | +cd st-device-sdk-c-ref |
| 761 | +python setup.py esp32 |
752 | 762 |
|
| 763 | +## At the end will be prompted to set the environment for building by sourcing the exports.sh file created during setup of stsdk c-ref. |
| 764 | +. ./export.sh |
| 765 | +
|
| 766 | +# Link our external AlarmDecoder-IoT project into the apps folder for st-device-sdk-c-ref. |
| 767 | +ln -s ~/Code/AlarmDecoder-IoT ~/esp/st-device-sdk-c-ref/apps/esp32 |
| 768 | +``` |
| 769 | + |
| 770 | +#### 6.2.2. <a name='configure-the-project'></a>Configure the project |
| 771 | +Run menu config and enable/disable components. Each module will consume code space and memory so test with the ```top``` command to be sure resources are not being exausted. |
753 | 772 | ``` |
754 | | -./build.sh esp32 AlarmDecoder-IoT menuconfig |
| 773 | +cd ~/esp/st-device-sdk-c-ref |
| 774 | +./build.py esp32 AlarmDecoder-IoT menuconfig |
755 | 775 | ``` |
756 | 776 |
|
757 | 777 | #### 6.2.3. <a name='build,-flash,-and-run'></a>Build, Flash, and Run |
758 | 778 |
|
759 | 779 | Build the project and flash it to the board, then run monitor tool to view serial output: |
760 | 780 |
|
761 | 781 | ``` |
| 782 | +cd ~/esp/st-device-sdk-c-ref |
762 | 783 | ./build.sh esp32 AlarmDecoder-IoT build flash monitor -p /dev/ttyUSB0 |
763 | 784 | ``` |
764 | 785 |
|
|
0 commit comments