Skip to content

Commit 9ca78ed

Browse files
committed
Update build docs.
1 parent a206d6e commit 9ca78ed

2 files changed

Lines changed: 34 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ Changes:
4444
### Change log
4545
- [ ] SM FTPD: Does not build with stsdk.
4646
- [ ] SM CORE: Testing modules build. All built even mqtt? Ok... I did not expect that. Needs testing.
47+
- [X] SM CORE: Update README.md docs on building project including stsdk and platformio.
4748
- [X] SM CORE: Add fixes for stsdk code that I have been sitting on. Mostly just CDECL stuff.
4849
- [X] SM CORE: Fix CMakeList.txt to fetch SimpleIni from github and include it for stsdk building.
49-
- [X] SM CORE: Travis build platform io project test.
50+
- [X] SM CORE: Travis build platformio project test.
5051
- [X] SM CORE: Fix sdkconfig.defaults was missing critical bits. Better organized now and "should" build same exact same firmware as in release.
5152
- [X] SM CORE: Fix missing compile flag ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH
5253
- [X] SM TWILIO: Improve error handling and response data validation.

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* 5.8.1. [Configuration for FTP server](#configuration-for-ftp-server)
2424
* 6. [Building firmware](#building-firmware)
2525
* 6.1. [PlatformIO](#platformio)
26-
* 6.1.1. [TODO: Setup notes](#todo:-setup-notes)
26+
* 6.1.1. [TODO: Setup notes](#platformio-setup-notes)
2727
* 6.2. [SmartThings device SDK build environment](#smartthings-device-sdk-build-environment)
2828
* 6.2.1. [Setup build environment](#setup-build-environment)
2929
* 6.2.2. [Configure the project](#configure-the-project)
@@ -734,31 +734,52 @@ Examples:
734734

735735
## 6. <a name='building-firmware'></a>Building firmware
736736
### 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.
738738
### 6.2. <a name='smartthings-device-sdk-build-environment'></a>SmartThings device SDK build environment
739739
#### 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.
742741
```
742+
# Make the root esp folder.
743+
cd ~
744+
mkdir esp
745+
746+
# Install the xtensa esp32 compiler
743747
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
748750
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
750756
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
752762
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.
753772
```
754-
./build.sh esp32 AlarmDecoder-IoT menuconfig
773+
cd ~/esp/st-device-sdk-c-ref
774+
./build.py esp32 AlarmDecoder-IoT menuconfig
755775
```
756776

757777
#### 6.2.3. <a name='build,-flash,-and-run'></a>Build, Flash, and Run
758778

759779
Build the project and flash it to the board, then run monitor tool to view serial output:
760780

761781
```
782+
cd ~/esp/st-device-sdk-c-ref
762783
./build.sh esp32 AlarmDecoder-IoT build flash monitor -p /dev/ttyUSB0
763784
```
764785

0 commit comments

Comments
 (0)