# esp32 amazon freertos

**URL:** <https://forums.freertos.org/t/esp32-amazon-freertos/8945>\
**Category:** AWS\
**Created:** [September 18, 2019, 9:32am UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945 "2019-09-18T09:32:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 18, 2019, 9:32am UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945/1 "2019-09-18T09:32:43Z")

</div>

**[tcpipchip](https://forums.aws.amazon.com/profile.jspa?userID=492594)** wrote on September 18, 2019:

Good morning team  
I am writing a book about Alexa + lambda + mqtt and i will use the amazon freertos on esp32 to be the endpoint.  
I followed the steps described in  
[https://docs.aws.amazon.com/en\_pv/freertos/latest/userguide/getting\_started\_espressif.html](https://docs.aws.amazon.com/en_pv/freertos/latest/userguide/getting_started_espressif.html)  
I got to sucess to create the thing.  
But my problem is how to compile using the CMake, looks that the documentarion is poor in that point.  
I already have the git of freertos and toolchain installed. I guess that the esp-idf already copied during freertos git.  
sboxes@osboxes:~/esp$ ls  
amazon-freertos xtensa-esp32-elf

osboxes@osboxes:~/esp/amazon-freertos$ cmake -DAFR\_TOOLCHAIN\_PATH=’/home/osboxes/esp/xtensa-esp32-elf/bin’ -DVENDOR=espressif -DBOARD=esp32\_wrover\_kit -DCOMPILER=xtensa-esp32 -S . -B /home/osboxes/esp/amazon-freertos/vendors/espressif/boards/esp32  
CMake Warning at PreLoad.cmake:34 (message):  
CMAKE\_TOOLCHAIN\_FILE is already defined to toolchain\_file.cmake, you need  
to delete cache and reconfigure if you want to switch compiler.

CMake Error at /usr/share/cmake-3.13/Modules/CMakeDetermineSystem.cmake:100 (message):  
Could not find toolchain file: /path/to/toolchain\_file.cmake  
Call Stack (most recent call first):  
CMakeLists.txt:8 (project)

CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE\_MAKE\_PROGRAM is not set. You probably need to select a different build tool.  
CMake Error: CMAKE\_C\_COMPILER not set, after EnableLanguage  
CMake Error: CMAKE\_CXX\_COMPILER not set, after EnableLanguage  
– Configuring incomplete, errors occurred!  
osboxes@osboxes:~/esp/amazon-freertos$

Can you help me with steps now how to compile with CMake?

Thanks!

Edited by: tcpipchip on Sep 18, 2019 2:32 AM

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [September 18, 2019, 6:37pm UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945/2 "2019-09-18T18:37:26Z")

</div>

**[Gaurav-Aggarwal-AWS](https://forums.aws.amazon.com/profile.jspa?userID=447386)** wrote on September 18, 2019:

Would you please try adding ‘/home/osboxes/esp/xtensa-esp32-elf/bin’ to your PATH, so that you do not need to specify AFR\_TOOLCHAIN\_PATH:

```auto

export PATH=$PATH:/home/osboxes/esp/xtensa-esp32-elf/bin

```

Also, try building in a separate directory. Below are the commands I used to build and these work for me:

1. Directory contents (similar as you):

```auto

aggarg@ud6fb67faac6558:~/workplace/tmp/esp$ ls
amazon-freertos xtensa-esp32-elf

```

1. Build Commands:

```auto

cd amazon-freertos/
mkdir build
cmake -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 -S . -B build/
cd build/
make all -j4

```

Which cmake version are you using?

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 19, 2019, 3:21pm UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945/3 "2019-09-19T15:21:01Z")

</div>

**[tcpipchip](https://forums.aws.amazon.com/profile.jspa?userID=492594)** wrote on September 19, 2019:

Gaurav-Aggarwal

Thank you so much! Looks now that compiles!!!  
.  
.  
.  
.  
target microcontroller:  
vendor: Espressif  
board: ESP-WROVER-KIT  
description: Development board produced by Espressif that has support for  
LCD, MicroSD card, and USB JTAG interface. It comes in two  
variants either with ESP-WROOM-32 or ESP32-WROVER module.  
family: ESP32  
data ram size: 520KB  
program memory size: 4MB

Host platform:  
OS: Linux-5.0.0-13-generic  
Toolchain: xtensa-esp32  
Toolchain path: /home/osboxes/esp/xtensa-esp32-elf  
CMake generator: Unix Makefiles

# Amazon FreeRTOS modules: Modules to build: ble, ble\_wifi\_provisioning, common, crypto, defender, dev\_mode\_key\_provisioning, freertos\_plus\_tcp, greengrass, https, kernel, mqtt, ota, pkcs11, pkcs11\_implementation, platform, secure\_sockets, serializer, shadow, tls, wifi Enabled by user: ble, ble\_wifi\_provisioning, defender, greengrass, https, mqtt, ota, pkcs11, pkcs11\_implementation, platform, secure\_sockets, shadow, wifi Enabled by dependency: ble\_hal, common, crypto, demo\_base, dev\_mode\_key\_provisioning, freertos, freertos\_plus\_tcp, kernel, pkcs11\_mbedtls, secure\_sockets\_freertos\_plus\_tcp, serializer, tls, utils 3rdparty dependencies: http-parser, jsmn, mbedtls, pkcs11, tinycbor Available demos: demo\_ble, demo\_ble\_numeric\_comparison, demo\_defender, demo\_greengrass\_connectivity, demo\_https, demo\_mqtt, demo\_ota, demo\_shadow, demo\_tcp, demo\_wifi\_provisioning Available tests:

– Configuring done  
– Generating done  
– Build files have been written to: /home/osboxes/esp/amazon-freertos/build

make all -j4  
compiled all 🙂

# THANK YOU SO MUCH! I will verify now if runs on a U-BLOX NINA W102, flash with 2Mb.

Do you know wich models (ESP32) runs the rtos, will need really 4Mb ?  
and about  
cd amazon-freertos/  
mkdir build  
cmake -DVENDOR=espressif -DBOARD=esp32\_wrover\_kit -DCOMPILER=xtensa-esp32 -S . -B build/  
cd build/  
make all -j4

How can i ask to compile other example ?

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [September 19, 2019, 7:22pm UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945/4 "2019-09-19T19:22:37Z")

</div>

**[Gaurav-Aggarwal-AWS](https://forums.aws.amazon.com/profile.jspa?userID=447386)** wrote on September 19, 2019:

The currently supported ESP boards with Amazon FreeRTOS are ESP32-DevKitC and the ESP-WROVER-KIT as mentioned here: [https://docs.aws.amazon.com/freertos/latest/userguide/getting\_started\_espressif.html](https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html)

The following hash defines are available in the config file  
/vendors/espressif/boards/esp32/aws\_demos/config\_files/aws\_demo\_config.h:

```auto

CONFIG_MQTT_DEMO_ENABLED
CONFIG_SHADOW_DEMO_ENABLED
CONFIG_GREENGRASS_DISCOVERY_DEMO_ENABLED
CONFIG_TCP_ECHO_CLIENT_DEMO_ENABLED
CONFIG_DEFENDER_DEMO_ENABLED
CONFIG_OTA_UPDATE_DEMO_ENABLED
CONFIG_BLE_GATT_SERVER_DEMO_ENABLED
CONFIG_HTTPS_SYNC_DOWNLOAD_DEMO_ENABLED
CONFIG_HTTPS_ASYNC_DOWNLOAD_DEMO_ENABLED

```

Please define the corresponding macro to enable a demo and remove the MQTT one. For example, currently your config file will have:

```auto

#define CONFIG_MQTT_DEMO_ENABLED

```

Change it to the following to enable shadow demo:

```auto

#define CONFIG_SHADOW_DEMO_ENABLED

```

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 21, 2019, 1:21pm UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945/5 "2019-09-21T13:21:03Z")

</div>

**[tcpipchip](https://forums.aws.amazon.com/profile.jspa?userID=492594)** wrote on September 21, 2019:

Thank you so much!

Do you know wich CSV partition file open during compile ?

I want to change to port to U-BLOX NINA W102 using the following csv

partitions\_singleapp.csv

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [September 22, 2019, 7:26pm UTC](https://forums.freertos.org/t/esp32-amazon-freertos/8945/6 "2019-09-22T19:26:39Z")

</div>

**[Gaurav-Aggarwal-AWS](https://forums.aws.amazon.com/profile.jspa?userID=447386)** wrote on September 22, 2019:

I am not sure about that and this seems something specific to Espressif. The best would be to post a question to Espressif on GitHub: [https://github.com/espressif/esp-idf](https://github.com/espressif/esp-idf)

Thanks.
