cmake.txt Kconfig

This commit is contained in:
ok-home
2023-10-09 20:19:04 +07:00
parent 79f680bc25
commit bb44667475
5 changed files with 40 additions and 30 deletions

View File

@@ -8,18 +8,16 @@ set( priv_includedir
private_include
)
set(require
""
)
set( priv_require
esp_http_server
app_update
esp_encrypted_img
esp_http_server
mbedtls
)
set( embed_file
source/ota_ws_update.html
)
set( embed_txt_file
""
)
if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
@@ -30,9 +28,15 @@ if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
list(APPEND priv_includedir
esp_encrypted_img/include
)
if(CONFIG_OTA_PRE_ENCRYPTED_RSA_KEY_ON_COMPONENT_LOCATION)
list(APPEND embed_txt_file
rsa_key/private.pem
${COMPONENT_DIR}/${CONFIG_OTA_PRE_ENCRYPTED_RSA_KEY_DIRECTORY}/private.pem
)
else()
list(APPEND embed_txt_file
${project_dir}/${CONFIG_OTA_PRE_ENCRYPTED_RSA_KEY_DIRECTORY}/private.pem
)
endif()
else()
list(APPEND srcs
source/ota_ws_update_esp.c
@@ -57,11 +61,13 @@ if(CONFIG_OTA_PRE_ENCRYPTED_MODE)
#openssl genrsa -out rsa_key/private.pem 3072
# for rsa_key on components dir
if(CONFIG_OTA_PRE_ENCRYPTED_RSA_KEY_ON_COMPONENT_LOCATION)
# for rsa_key on components project_dir
create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
${COMPONENT_DIR}/rsa_key/private.pem ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}_secure.bin app)
${COMPONENT_DIR}/${CONFIG_OTA_PRE_ENCRYPTED_RSA_KEY_DIRECTORY}/private.pem ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}_secure.bin app)
else()
# for rsa_key on project dir
#create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
# ${project_dir}/rsa_key/private.pem ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}_secure.bin app)
create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
${project_dir}/${CONFIG_OTA_PRE_ENCRYPTED_RSA_KEY_DIRECTORY}/private.pem ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}_secure.bin app)
endif()
endif()

View File

@@ -1,4 +1,4 @@
menu "OTA WS UPDATE"
menu "OTA websocket update"
config OTA_DEFAULT_URI
string "OTA page URI"
@@ -24,4 +24,20 @@ menu "OTA WS UPDATE"
help
Ota pre-encrypted mode.
choice OTA_PRE_ENCRYPTED_RSA_KEY_LOCATION
depends on OTA_PRE_ENCRYPTED_MODE
prompt "RSA key directory"
default OTA_PRE_ENCRYPTED_RSA_KEY_ON_PROJECT_LOCATION
config OTA_PRE_ENCRYPTED_RSA_KEY_ON_PROJECT_LOCATION
bool "PROJECT_DIR"
config OTA_PRE_ENCRYPTED_RSA_KEY_ON_COMPONENT_LOCATION
bool "COMPONENT_DIR"
endchoice
config OTA_PRE_ENCRYPTED_RSA_KEY_DIRECTORY
depends on OTA_PRE_ENCRYPTED_MODE
string "Ota pre-encrypted RSA key directory"
default "rsa_key"
endmenu

View File

@@ -1,3 +0,0 @@
2023-10-05 19:44:46,943 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STARTED
2023-10-05 19:44:46,944 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_READY2CONNECT
2023-10-05 19:45:24,371 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STOPPED

View File

@@ -1,15 +1,9 @@
dependencies:
espressif/esp_encrypted_img:
component_hash: d2cbae51c946ec66bbf0e62d2b406aa6c92c0c97d7be7c32fb6ca541a36d20de
source:
service_url: https://api.components.espressif.com/
type: service
version: 2.2.0
idf:
component_hash: null
source:
type: idf
version: 5.2.0
manifest_hash: 0ee5924d580a0ce00333564716b4649c3118e31ddbcaf0fc6cd6071b000406ab
manifest_hash: 2ac596d0d5a708817329b21531cbf3574c7c8daaf36dca979b5dd32a78fc2857
target: esp32s3
version: 1.0.0

View File

@@ -9,14 +9,11 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_event.h"
//#include "esp_event.h"
#include "esp_log.h"
#include "esp_ota_ops.h"
#include "esp_wifi.h"
//#include "esp_wifi.h"
#include "esp_http_server.h"
// #include <esp_log.h>
#include "nvs_wifi_connect.h"
#include "ota_ws_update.h"