Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include ESP-Insights component for esp32 target #99

Merged
merged 3 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components)
set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components ${CMAKE_SOURCE_DIR}/components/esp-insights/components)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(arduino-lib-builder)
Expand Down
2 changes: 1 addition & 1 deletion configs/builds.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
},
{
"target": "esp32",
"features":["qio_ram"],
"features":["qio_ram","insights"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this would only work on ESP32?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have only added to esp32 target, since It is the only target I have tested, but I guess there won't be a problem to add it for the other SoC series. Should I create another PR for them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you add it to the others, we can accommodate the change in the next 2.0.6 release. Plus we would not need to limit the example to ESP32 only. Keep in mind that ESP32 support is already in Arduino master, so make sure you get it to worm in Arduino as well (there are some errors)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until the last days (296fda5#diff-7dc73c61faafeb3cfa84a00d17773425a77c0140f34d8248f8085b82c4dc97a3), the bootloader was created for every flash memory type and so on but now only the elf files are copied to arduino-esp32. Do you know where could I find now the bootloader used while compiling using PlatformIO?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for platformio is coming. Necessary changes are already merged in Arduino master, so I guess you will have the full support soon on PIO side as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I will check what are those changes regarding the bootloader generation, this ESP-Insights feature requires also running the esptool with --elf-sha256-offset flag and I made another PR to platformio/platform-espressif32#973 but it seems that it is not yet so clear if this will affect too the bootloader flash flags...
Thank you @me-no-dev!

"idf_libs":["qio","80m"],
"bootloaders":[
["qio","80m"],
Expand Down
27 changes: 27 additions & 0 deletions configs/defconfig.insights
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CONFIG_ESP_INSIGHTS_ENABLED=y
# CONFIG_ESP_INSIGHTS_DEBUG_ENABLED is not set
CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE=y
# CONFIG_ESP_INSIGHTS_TRANSPORT_MQTT is not set
CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS=y

CONFIG_DIAG_ENABLE_METRICS=y
CONFIG_DIAG_ENABLE_WIFI_METRICS=y
CONFIG_DIAG_ENABLE_HEAP_METRICS=y
CONFIG_DIAG_ENABLE_VARIABLES=y
CONFIG_DIAG_ENABLE_NETWORK_VARIABLES=y

CONFIG_ESP32_ENABLE_COREDUMP=y
CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y
CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y
CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32=y
CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64
CONFIG_ESP32_CORE_DUMP_STACK_SIZE=1024

CONFIG_MBEDTLS_DYNAMIC_BUFFER=y
CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y
CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y

CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
15 changes: 15 additions & 0 deletions tools/update-components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CAMERA_REPO_URL="https://github.com/espressif/esp32-camera.git"
DL_REPO_URL="https://github.com/espressif/esp-dl.git"
SR_REPO_URL="https://github.com/espressif/esp-sr.git"
RMAKER_REPO_URL="https://github.com/espressif/esp-rainmaker.git"
INSIGHTS_REPO_URL="https://github.com/espressif/esp-insights.git"
DSP_REPO_URL="https://github.com/espressif/esp-dsp.git"
LITTLEFS_REPO_URL="https://github.com/joltwallet/esp_littlefs.git"
TINYUSB_REPO_URL="https://github.com/hathach/tinyusb.git"
Expand Down Expand Up @@ -121,6 +122,20 @@ else
fi
if [ $? -ne 0 ]; then exit 1; fi

#
# CLONE/UPDATE ESP-INSIGHTS
#

if [ ! -d "$AR_COMPS/esp-insights" ]; then
git clone $INSIGHTS_REPO_URL "$AR_COMPS/esp-insights" && \
git -C "$AR_COMPS/esp-insights" submodule update --init --recursive
else
git -C "$AR_COMPS/esp-insights" fetch && \
git -C "$AR_COMPS/esp-insights" pull --ff-only && \
git -C "$AR_COMPS/esp-insights" submodule update --init --recursive
fi
if [ $? -ne 0 ]; then exit 1; fi

#
# CLONE/UPDATE ESP-DSP
#
Expand Down