How to compile an AWS FreeRTOS ESP32 project using VS Code?

Hello to all the FreeRTOS and AWS community. Congratulations for this great work.

Kindly, I am asking for support about how to compile AWS FreeRTOS ESP32 projects in VS Code.

I will explain first, all the details about how I’ve compiled, and successfully tested some demos using the ESP-IDF Command Prompt v4.2 of IDF, with the toolchain esp-idf-tools-setup-2.3.exe, Python 3.8.3, git version on Windows 7 Ultimate.

I have been able to compile via ESP-IDF Command Prompt examples from the AWS FreeRTOS Console, and freertos-aws-reference-integrations from Github.
In both cases, the version is Version 202012.00 with crosstool-ng-1.22.0-80-g6c4433a used in 5.2.0

The freertos-aws-reference-integrations for Espressif (and other vendors) on Github

The unzipped folder I place it on C:\esp-idf-v4.2 just for consistency, I keep it as my root folder :C:\esp-idf-v4.2\FreeRTOS

I modified one line of code on C:/users/username/.espressif/_idf_cmd_init.bat which makes possible to move back and forth to use the native idf v4.2 examples and demos from FreeRTOS just commenting that line.

For path configuration, I used the default one which is made from the esp-idf-tools-setup-2.3.exe installation.

And for FreeRTOS, I used the install.bat and export.bat present on C:\esp-idf-v4.2\FreeRTOS\vendors\espressif\esp-idf\install.bat and C:\esp-idf-v4.2\FreeRTOS\vendors\espressif\esp-idf\export

In order to execute the coreMQTT and ota examples, I double clicked the ESP-IDF Command Prompt cmd.exe (generated from toolchain installation), changed directories to FreeRTOS cd FreeRTOS and issued the next commands:

  1. coreMQTT demo

cmake -DVENDOR=espressif -DBOARD=esp32_devkitc -DCOMPILER=xtensa-esp32 -GNinja -S . -B demos/coreMQTT/build

python C:/esp-idf-v4.2/FreeRTOS/vendors/espressif/esp-idf/tools/ build -B demos/coreMQTT/build

python C:/esp-idf-v4.2/FreeRTOS/vendors/espressif/esp-idf/tools/ erase_flash flash monitor -p COM4 demos/coreMQTT/build

  1. ota demo
    cmake -DVENDOR=espressif -DBOARD=esp32_devkitc -DCOMPILER=xtensa-esp32 -GNinja -S . -B demos/ota/build

python C:/esp-idf-v4.2/FreeRTOS/vendors/espressif/esp-idf/tools/ build -B demos/ota/build

python C:/esp-idf-v4.2/FreeRTOS/vendors/espressif/esp-idf/tools/ erase_flash flash monitor -p COM4 -B demos/ota/build

All working quite good so far :laughing:

I want to achieve all that I did for AWS FreeRTOS on cli using VS code. I tested and flashed the simple_sniffer from IDF 4.2 example using VS code and worked flawlessly.

My issue is trying to do the same with any of the examples on demos folder on FreeRTOS. Probably I am missing some cross-compiling configurations? Some path issues?

My working configurations for VS code are here (the one I used for the simple_sniffer example)

The failing configurations for AWS FreeRTOS ESP32 for VS code are here.

I even checked the link using-visual-studio-code-for-freertos-development.html, but still I can’t make it work.

I would really appreciate your support on this. Thanks in advance.


Thanks for your interest in FreeRTOS and bringing this question to our attention. We are looking into your question and will get back to you once we have an update.

Hello @leegeth. Thanks a replying. Looking forward to seeing your updates. :smile:

Good morning dear @leegeth. Hope you and yours are doing great. A quick question, do you happen to have any update regarding this?. Thanks a lot.

Hello Yoimer,

I have posted a reply at How to build, compile and flash AWS FreeRTOS ESP32 on VS Code · Issue #3002 · aws/amazon-freertos · GitHub.