Amazon FreeRTOS and ESP32 - Few questions on new project creation

Namaste Forum Member,

I’ve downloaded the FreeRTOS Device Software from the below Amazon AWS link after logging into my AWS account.
https://console.aws.amazon.com/iot/home?region=us-east-1#/software/freertos

Details of the downloaded FreeRTOS Device Software are as below:

  1. Configuration: ConnecttoAWSIoT-ESP32-DevKitC
  2. Hardware platform: ESP32-DevKitC
  3. FreeRTOS Version: 202002.00

I could compile and build the aws_demos project and generate the aws_demos.bin file. The output of the ninja command is shared below.

========== Log starts ==========

G:\ConnecttoAWSIoT-ESP32-DevKitC-1588646008689\FreeRTOS\build>ninja
0/2 Re-checking globbed directories…
31/820 Building C object CMakeFiles/afr_ota.dir/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c.obj
In file included from …/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c:38:0:
…/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c: In function ‘prvSendCallbackEvent’:
…/libraries/freertos_plus/aws/ota/include/aws_iot_ota_agent.h:56:65: warning: unused variable ‘OTA_METHOD_NAME’ https://forums.aws.amazon.com/
#define DEFINE_OTA_METHOD_NAME( name ) static const char OTA_METHOD_NAME[] = name;


Skipping the complete build log

51/55 Linking C static library esp-idf\bootloader_support\libbootloader_support.a
52/55 Generating idf_component_bootloader_support.sections_info
53/55 Building C object CMakeFiles/bootloader.elf.dir/dummy_main_src.c.obj
54/55 Linking C executable bootloader.elf
55/55 Generating bootloader.bin
esptool.py v2.8-dev
626/820 Building C object esp-idf/nimble/CMakeFiles/idf_component_nimble.dir/nimble/nimble/host/src/ble_sm.c.obj
…/vendors/espressif/esp-idf/components/nimble/nimble/nimble/host/src/ble_sm.c: In function ‘ble_sm_pairing_req’:
…/vendors/espressif/esp-idf/components/nimble/nimble/nimble/host/src/ble_sm.c:831:9: warning: unused variable ‘rc’ https://forums.aws.amazon.com/
int rc;
^
815/820 Building C object CMakeFiles/aws_demos.dir/demos/ble/aws_ble_gatt_server_demo.c.obj
…/demos/ble/aws_ble_gatt_server_demo.c:275:19: warning: ‘vGattDemoSvcHook’ defined but not used https://forums.aws.amazon.com/
static BaseType_t vGattDemoSvcHook( void )
^
820/820 Generating aws_demos.bin
esptool.py v2.8-dev

G:\ConnecttoAWSIoT-ESP32-DevKitC-1588646008689\FreeRTOS\build>

========== Log ends ==========

The aws_demos project is a project created for demonstration of all the AWS features supported; libraries of the like BLE Management, MQTT, OTA Updates, etc.

Question 1:
For creating a new project, do I need to create another project folder (Example: “myProject01”) in the same folder where the “aws_demos” folder resides i.e., the “…\FreeRTOS\vendors\espressif\boards\esp32” folder? In this case, there would be a lot many CMakeLists.txt files (inside multiple folders of the parent “FreeRTOS” folder), inside which I need to make “file-path” changes to point to the “myProject01” folder instead of the “aws_demos” folder. Is this correct or is there any better way for compiling and building a new project?

Question 2:
How do I get project specific compilation and build, considering multiple projects inside the “…\FreeRTOS\vendors\espressif\boards\esp32” folder. For example, there could be multiple projects inside the below esp32 folder, as below.
a) …\FreeRTOS\vendors\espressif\boards\esp32\aws_demos - Existing demo project
b) …\FreeRTOS\vendors\espressif\boards\esp32\myProject01 - My first application project
c) …\FreeRTOS\vendors\espressif\boards\esp32\myProject02 - My second application project
d) …\FreeRTOS\vendors\espressif\boards\esp32\myProject03 - My third application project
For example, I might need to compile “myProject01” and “myProject02” projects separately or, only one of them.

Question 3:
Does the current Amazon FreeRTOS and ESP32 framework/ architecture mandate to create new projects inside the below path?
"…\FreeRTOS\vendors\espressif\boards\esp32"

Thanks | Regards,
Dipen

  1. When creating a new project, you should use the top-level demos folder. You can copy a CMakeLists.txt file from an existing demo similar to what your project will contain and add any other necessary dependencies from there.
  2. The projects directory is really for board-specific project files rather than any application-related code. Application-related code should go to the top-level demos folder.
  3. Answered above.

Feel free to reach out if you have additional questions.

Namaste @abrinao,

Thank you for your reply.

Yes, I have created a new project folder adjacent to the existing demos folder and, am working on the same.

Thanks | Regards,
Dipen