Amazon FreeRTOS and ESP32 - Few questions on new project creation

dipen@1337lab.io
Posts: 12
Joined: Wed Jan 29, 2020 8:45 am

Amazon FreeRTOS and ESP32 - Few questions on new project creation

Postby dipen@1337lab.io » Sat May 23, 2020 1:43 pm

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 ... e/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 path? 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

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: Amazon FreeRTOS and ESP32 - Few questions on new project creation

Postby chegewara » Sun May 24, 2020 11:10 am

dipen@1337lab.io wrote: 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 path? 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?
I did few projects with AFR, but i never been trying to compile few projects inside the same AWSFreeRTOS folder. Looking at folders structure it should be possible to keep projects as siblings aws_demos:
https://github.com/aws/amazon-freertos/ ... ards/esp32

This way you should be able to keep sdkconfig, partitions.csv separate for each project.
dipen@1337lab.io wrote: 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.
Those projects should be considered as separate projects and compiled only one at time.
dipen@1337lab.io wrote: 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\"
Yes and no.
Yes, because it is how AFR is structured. No, thanks to esp-idf structure. In esp-idf you can use components, and in this case we can consider AFR as component. Here you can find all or almost all you need to start with AFR as esp-idf component:
https://github.com/aws/amazon-freertos/issues/832
https://github.com/aws/amazon-freertos/issues/1652

and personally i like to start with cloning this repository:
https://github.com/tgsong/amazon-freertos-examples

dipen@1337lab.io
Posts: 12
Joined: Wed Jan 29, 2020 8:45 am

Re: Amazon FreeRTOS and ESP32 - Few questions on new project creation

Postby dipen@1337lab.io » Fri Jun 12, 2020 2:57 pm

Namaste chegewara,

Sorry for this delayed reply.

Thank you very much for your inputs on my queries and, the additional useful links provided.

I'm happy to share that I have been able to create and build a simple Blink LED project using Amazon FreeRTOS on the ESP32 DevKitC board. Feels nice to see the LED blinking. :D

In the world of Embedded Systems, the Blink LED project is the Hello World !! equivalent of pure software projects.

Thanks | Regards,
Dipen

Who is online

Users browsing this forum: No registered users and 40 guests