diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 6768dd1..fe07e9f 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] + board: [esp32, esp32-nopsram, esp32-s3, esp32-s3-nopsram, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] build: [release] env: BOARD: ${{ matrix.board }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c4e935..26d708e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] + board: [esp32, esp32-nopsram, esp32-s3, esp32-s3-nopsram, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] build: [release] env: BOARD: ${{ matrix.board }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ae6e08b..f5a1a33 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] + board: [esp32, esp32-nopsram, esp32-s3, esp32-s3-nopsram, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] build: [release] env: BOARD: ${{ matrix.board }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcb795b..82bba62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] + board: [esp32, esp32-nopsram, esp32-s3, esp32-s3-nopsram, esp32-s3-oct, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-solo1, esp32-gl-s10, esp32-p4] build: [release] env: BOARD: ${{ matrix.board }} diff --git a/boards/nuki-esp32-s3-nopsram.json b/boards/nuki-esp32-s3-nopsram.json new file mode 100644 index 0000000..6dba8fb --- /dev/null +++ b/boards/nuki-esp32-s3-nopsram.json @@ -0,0 +1,50 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32s3_out.ld" + }, + "core": "esp32", + "extra_flags": [ + "-DARDUINO_ESP32S3_DEV", + "-DARDUINO_USB_MODE=1", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [ + [ + "0x303A", + "0x1001" + ] + ], + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "default_tool": "esp-builtin", + "onboard_tools": [ + "esp-builtin" + ], + "openocd_target": "esp32s3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32-S3 (NO PSRAM)", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html", + "vendor": "Espressif" +} diff --git a/boards/nuki-esp32dev-nopsram.json b/boards/nuki-esp32dev-nopsram.json new file mode 100644 index 0000000..2b46cd9 --- /dev/null +++ b/boards/nuki-esp32dev-nopsram.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_DEV", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif ESP32 Dev Module", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://en.wikipedia.org/wiki/ESP32", + "vendor": "AI Thinker" +} diff --git a/pio_package_post.py b/pio_package_post.py index 4f8538b..eaf03e8 100644 --- a/pio_package_post.py +++ b/pio_package_post.py @@ -13,6 +13,10 @@ def get_board_name(env): board = 'esp32gls10' elif env.get('BOARD') == 'nuki-esp32-s3-oct': board = 'esp32s3oct' + elif env.get('BOARD') == 'nuki-esp32-s3-nopsram': + board = 'esp32s3nopsram' + elif env.get('BOARD') == 'nuki-esp32dev-nopsram': + board = 'esp32nopsram' return board def create_target_dir(env): diff --git a/platformio.ini b/platformio.ini index 34fca70..808c99c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -77,11 +77,22 @@ build_flags = -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE -DNUKI_HUB_HTTPS_SERVER +[env:esp32-nopsram] +board = nuki-esp32dev-nopsram +board_build.cmake_extra_args = + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32-nopsram" +extra_scripts = + pre:pio_package_pre.py + post:pio_package_post.py +build_flags = + ${env.build_flags} + -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE + [env:esp32-gl-s10] extends = env:esp32 board = nuki-esp32gls10 board_build.cmake_extra_args = - -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32;sdkconfig.gls10.defaults" + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32;sdkconfig.defaults.gls10" build_flags = ${env:esp32.build_flags} -DNUKI_TARGET_GL_S10=y @@ -101,6 +112,12 @@ board = nuki-esp32-s3 board_build.cmake_extra_args = -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32-s3" +[env:esp32-s3-nopsram] +extends = env:esp32 +board = nuki-esp32-s3-nopsram +board_build.cmake_extra_args = + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32-s3-nopsram" + [env:esp32-s3-oct] extends = env:esp32 board = nuki-esp32-s3-oct @@ -170,11 +187,21 @@ build_flags = -DDEBUG_NUKIHUB -DNUKI_HUB_HTTPS_SERVER +[env:esp32-nopsram_dbg] +extends = env:esp32-nopsram +custom_build = debug +board_build.cmake_extra_args = + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32-nopsram" +build_flags = + ${env.build_flags} + -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG + -DDEBUG_NUKIHUB + [env:esp32-gl-s10_dbg] extends = env:esp32-gl-s10 custom_build = debug board_build.cmake_extra_args = - -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32;sdkconfig.gls10.defaults" + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32;sdkconfig.defaults.gls10" build_flags = ${env:esp32_dbg.build_flags} -DNUKI_TARGET_GL_S10=y @@ -227,6 +254,14 @@ board_build.cmake_extra_args = build_flags = ${env:esp32_dbg.build_flags} +[env:esp32-s3-nopsram_dbg] +extends = env:esp32-s3-nopsram +custom_build = debug +board_build.cmake_extra_args = + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32-s3-nopsram" +build_flags = + ${env:esp32-nopsram_dbg.build_flags} + [env:esp32-s3-oct_dbg] extends = env:esp32-s3-oct custom_build = debug diff --git a/resources/how-to-flash.txt b/resources/how-to-flash.txt index 44dddbc..8f601d5 100644 --- a/resources/how-to-flash.txt +++ b/resources/how-to-flash.txt @@ -29,12 +29,19 @@ e000 boot_app0.bin 10000 nuki_hub_esp32.bin 270000 nuki_hub_updater_esp32.bin +ESP32-NOPSRAM +e000 boot_app0.bin +1000 nuki_hub_bootloader_esp32nopsram.bin +8000 nuki_hub_partitions_esp32nopsram.bin +10000 nuki_hub_esp32nopsram.bin +270000 nuki_hub_updater_esp32nopsram.bin + ESP32-GL-S10 e000 boot_app0.bin -1000 nuki_hub_bootloader_esp32.bin -8000 nuki_hub_partitions_esp32.bin -10000 nuki_hub_esp32.bin -270000 nuki_hub_updater_esp32.bin +1000 nuki_hub_bootloader_esp32gls10.bin +8000 nuki_hub_partitions_esp32gls10.bin +10000 nuki_hub_esp32gls10.bin +270000 nuki_hub_updater_esp32gls10.bin ESP32-S3 e000 boot_app0.bin @@ -43,6 +50,13 @@ e000 boot_app0.bin 10000 nuki_hub_esp32s3.bin 270000 nuki_hub_updater_esp32s3.bin +ESP32-S3-NOPSRAM +e000 boot_app0.bin +0 nuki_hub_bootloader_esp32s3nopsram.bin +8000 nuki_hub_partitions_esp32s3nopsram.bin +10000 nuki_hub_esp32s3nopsram.bin +270000 nuki_hub_updater_esp32s3nopsram.bin + ESP32-S3-OCT e000 boot_app0.bin 0 nuki_hub_bootloader_esp32s3oct.bin @@ -87,10 +101,10 @@ e000 boot_app0.bin ESP32-SOLO1 e000 boot_app0.bin -1000 nuki_hub_bootloader_esp32-solo1.bin -8000 nuki_hub_partitions_esp32-solo1.bin -10000 nuki_hub_esp32-solo1.bin -270000 nuki_hub_updater_esp32-solo1.bin +1000 nuki_hub_bootloader_esp32solo1.bin +8000 nuki_hub_partitions_esp32solo1.bin +10000 nuki_hub_esp32solo1.bin +270000 nuki_hub_updater_esp32solo1.bin Make sure the checkmarks for all files are enabled. @@ -108,14 +122,22 @@ As an alternative to the Download Tools, you can also use the esptool from the E esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x1000 nuki_hub_bootloader_esp32.bin 0x10000 nuki_hub_esp32.bin 0x270000 nuki_hub_updater_esp32.bin 0x8000 nuki_hub_partitions_esp32.bin +## ESP32-NOPSRAM + +esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x1000 nuki_hub_bootloader_esp32nopsram.bin 0x10000 nuki_hub_esp32nopsram.bin 0x270000 nuki_hub_updater_esp32nopsram.bin 0x8000 nuki_hub_partitions_esp32nopsram.bin + ## ESP32-GL-S10 -esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x1000 nuki_hub_bootloader_esp32.bin 0x10000 nuki_hub_esp32.bin 0x270000 nuki_hub_updater_esp32.bin 0x8000 nuki_hub_partitions_esp32.bin +esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x1000 nuki_hub_bootloader_esp32gls10.bin 0x10000 nuki_hub_esp32gls10.bin 0x270000 nuki_hub_updater_esp32gls10.bin 0x8000 nuki_hub_partitions_esp32gls10.bin ## ESP32-S3 esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x0 nuki_hub_bootloader_esp32s3.bin 0x10000 nuki_hub_esp32s3.bin 0x270000 nuki_hub_updater_esp32s3.bin 0x8000 nuki_hub_partitions_esp32s3.bin +## ESP32-S3-NOPSRAM + +esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x0 nuki_hub_bootloader_esp32s3nopsram.bin 0x10000 nuki_hub_esp32s3nopsram.bin 0x270000 nuki_hub_updater_esp32s3nopsram.bin 0x8000 nuki_hub_partitions_esp32s3nopsram.bin + ## ESP32-S3-OCT esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x0 nuki_hub_bootloader_esp32s3oct.bin 0x10000 nuki_hub_esp32s3oct.bin 0x270000 nuki_hub_updater_esp32s3oct.bin 0x8000 nuki_hub_partitions_esp32s3oct.bin @@ -142,6 +164,6 @@ esptool.py --chip esp32p4 --port /dev/ttyUSB0 --baud 921600 --before default_res ## ESP32-SOLO1 -esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x1000 nuki_hub_bootloader_esp32-solo1.bin 0x10000 nuki_hub_esp32-solo1.bin 0x270000 nuki_hub_updater_esp32-solo1.bin 0x8000 nuki_hub_partitions_esp32-solo1.bin +esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x1000 nuki_hub_bootloader_esp32solo1.bin 0x10000 nuki_hub_esp32solo1.bin 0x270000 nuki_hub_updater_esp32solo1.bin 0x8000 nuki_hub_partitions_esp32solo1.bin Adjust the serial device and path to the binaries if necessary. \ No newline at end of file diff --git a/sdkconfig.defaults.esp32-nopsram b/sdkconfig.defaults.esp32-nopsram new file mode 100644 index 0000000..92f4d3b --- /dev/null +++ b/sdkconfig.defaults.esp32-nopsram @@ -0,0 +1 @@ +CONFIG_SPIRAM=n \ No newline at end of file diff --git a/sdkconfig.defaults.esp32-s3-nopsram b/sdkconfig.defaults.esp32-s3-nopsram new file mode 100644 index 0000000..92f4d3b --- /dev/null +++ b/sdkconfig.defaults.esp32-s3-nopsram @@ -0,0 +1 @@ +CONFIG_SPIRAM=n \ No newline at end of file diff --git a/sdkconfig.gls10.defaults b/sdkconfig.defaults.gls10 similarity index 100% rename from sdkconfig.gls10.defaults rename to sdkconfig.defaults.gls10 diff --git a/src/Config.h b/src/Config.h index a2bf009..ff3b052 100644 --- a/src/Config.h +++ b/src/Config.h @@ -56,9 +56,11 @@ #define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3oct.bin" #define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3nopsram.bin" #define NUKI_HUB_HW (char*)"ESP32-S3 (Octal PSRAM)" #define BOOT_BUTTON_GPIO (gpio_num_t)0 -#else +#elif defined(CONFIG_SPIRAM) #define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3.bin" #define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32s3.bin" @@ -73,8 +75,29 @@ #define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3.bin" #define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3oct.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3oct.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3nopsram.bin" #define NUKI_HUB_HW (char*)"ESP32-S3" #define BOOT_BUTTON_GPIO (gpio_num_t)0 +#else +#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3nopsram.bin" +#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32s3nopsram.bin" +#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32s3nopsram.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_updater_esp32s3nopsram.bin" +#define GITHUB_BETA_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32s3nopsram.bin" +#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32s3nopsram.bin" +#define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3nopsram.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3oct.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3oct.bin" +#define NUKI_HUB_HW (char*)"ESP32-S3 (No PSRAM)" +#define BOOT_BUTTON_GPIO (gpio_num_t)0 #endif #elif defined(CONFIG_IDF_TARGET_ESP32C5) #define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32c5.bin" @@ -123,7 +146,7 @@ #define BOOT_BUTTON_GPIO (gpio_num_t)9 #else #if defined(CONFIG_FREERTOS_UNICORE) -#define GITHUB_LATEST_RELEASE_BINARY_URL "https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32-solo1.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32-solo1.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32-solo1.bin" #define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32-solo1.bin" #define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32-solo1.bin" @@ -138,24 +161,26 @@ #define NUKI_HUB_HW (char*)"ESP32-SOLO1" #define BOOT_BUTTON_GPIO (gpio_num_t)0 #elif defined(NUKI_TARGET_GL_S10) -#define GITHUB_LATEST_RELEASE_BINARY_URL "https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32-gl-s10.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32gls10.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32gls10.bin" -#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32-gl-s10.bin" +#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32gls10.bin" #define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32gls10.bin" -#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32-gl-s10.bin" +#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32gls10.bin" #define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32gls10.bin" -#define GITHUB_LATEST_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_esp32-gl-s10.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_esp32gls10.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_updater_esp32gls10.bin" -#define GITHUB_BETA_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_esp32-gl-s10.bin" +#define GITHUB_BETA_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_esp32gls10.bin" #define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32gls10.bin" -#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32-gl-s10.bin" +#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32gls10.bin" #define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32gls10.bin" #define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32nopsram.bin" #define NUKI_HUB_HW (char*)"ESP32-GL-S10" #define BOOT_BUTTON_GPIO (gpio_num_t)0 -#else -#define GITHUB_LATEST_RELEASE_BINARY_URL "https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32.bin" +#elif defined(CONFIG_SPIRAM) +#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32.bin" #define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32.bin" #define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32.bin" #define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32.bin" @@ -167,10 +192,31 @@ #define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32.bin" #define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32.bin" #define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32.bin" -#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32-gl-s10.bin" -#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32gls10.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32gls10.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32nopsram.bin" #define NUKI_HUB_HW (char*)"ESP32" #define BOOT_BUTTON_GPIO (gpio_num_t)0 +#else +#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32nopsram.bin" +#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32nopsram.bin" +#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32nopsram.bin" +#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32nopsram.bin" +#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32nopsram.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_esp32nopsram.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_updater_esp32nopsram.bin" +#define GITHUB_BETA_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_esp32nopsram.bin" +#define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32nopsram.bin" +#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32nopsram.bin" +#define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32nopsram.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32.bin" +#define GITHUB_LATEST_RELEASE_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32gls10.bin" +#define GITHUB_LATEST_UPDATER_BINARY_URL_OTHER2 (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32gls10.bin" +#define NUKI_HUB_HW (char*)"ESP32 (No PSRAM)" +#define BOOT_BUTTON_GPIO (gpio_num_t)0 #endif #endif diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index 4576b46..8dec350 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -7,7 +7,7 @@ #include "FS.h" #include "SPIFFS.h" #include "esp_random.h" -#ifdef CONFIG_SOC_SPIRAM_SUPPORTED +#if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) #include "esp_psram.h" #endif #ifdef NUKI_HUB_HTTPS_SERVER @@ -1634,7 +1634,7 @@ esp_err_t WebCfgServer::buildOtaHtml(PsychicRequest *request, PsychicResponse* r response.print("
"); response.print(""); response.print(""); - #if defined(CONFIG_IDF_TARGET_ESP32S3) + #if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) if(esp_psram_get_size() <= 0) { response.print(""); @@ -5937,7 +5937,7 @@ esp_err_t WebCfgServer::buildInfoHtml(PsychicRequest *request, PsychicResponse* response.print(ESP.getFreeHeap()); response.print("\nTotal internal heap: "); response.print(ESP.getHeapSize()); - #ifdef CONFIG_SOC_SPIRAM_SUPPORTED + #if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) if(esp_psram_get_size() > 0) { response.print("\nPSRAM Available: Yes"); diff --git a/src/idf_component.yml b/src/idf_component.yml index 308ab67..80d9dba 100644 --- a/src/idf_component.yml +++ b/src/idf_component.yml @@ -1,6 +1,6 @@ dependencies: # Required IDF version - idf: ">=5.2" + idf: ">=5.5" esp-nimble-cpp: git: https://github.com/h2zero/esp-nimble-cpp.git diff --git a/src/main.cpp b/src/main.cpp index fcd6c10..86efc9b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,7 @@ bool nuki_hub_https_server_enabled = true; #else bool nuki_hub_https_server_enabled = false; #endif -#ifdef CONFIG_SOC_SPIRAM_SUPPORTED +#if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) #include "esp_psram.h" #endif @@ -625,7 +625,7 @@ void nukiTask(void *pvParameters) { if (preferences->getBool(preference_mqtt_ssl_enabled, false)) { - #ifdef CONFIG_SOC_SPIRAM_SUPPORTED + #if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) if (esp_psram_get_size() <= 0) { Log->println("Waiting 20 seconds to start BLE because of MQTT SSL"); @@ -1040,7 +1040,7 @@ void logCoreDump() void setup() { - #ifdef CONFIG_SOC_SPIRAM_SUPPORTED + #if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) #ifndef FORCE_NUKI_HUB_HTTPS_SERVER if(esp_psram_get_size() <= 0) { diff --git a/src/networkDevices/EthernetDevice.cpp b/src/networkDevices/EthernetDevice.cpp index 83ae97a..9319b95 100644 --- a/src/networkDevices/EthernetDevice.cpp +++ b/src/networkDevices/EthernetDevice.cpp @@ -101,7 +101,11 @@ void EthernetDevice::initialize() // https://github.com/arendst/Tasmota/commit/f8fbe153000591727e40b5007e0de78c33833131 // https://github.com/arendst/Tasmota/commit/f8fbe153000591727e40b5007e0de78c33833131#diff-32fc0eefbf488dd507b3bef52189bbe37158737aba6f96fe98a8746dc5021955R417 uint32_t pkg_version = bootloader_common_get_chip_ver_pkg(); + #if defined(CONFIG_SOC_SPIRAM_SUPPORTED) && defined(CONFIG_SPIRAM) if(esp_psram_get_size() <= 0 && pkg_version <= 3) + #else + if(pkg_version <= 3) + #endif { esp_gpio_revoke(0xFFFFFFFFFFFFFFFF); } diff --git a/updater/pio_package_post.py b/updater/pio_package_post.py index 2bb6416..5f757a4 100644 --- a/updater/pio_package_post.py +++ b/updater/pio_package_post.py @@ -12,6 +12,10 @@ def get_board_name(env): board = 'esp32gls10' elif env.get('BOARD') == 'nuki-esp32-s3-oct': board = 'esp32s3oct' + elif env.get('BOARD') == 'nuki-esp32-s3-nopsram': + board = 'esp32s3nopsram' + elif env.get('BOARD') == 'nuki-esp32dev-nopsram': + board = 'esp32nopsram' return board def create_target_dir(env): diff --git a/updater/platformio.ini b/updater/platformio.ini index 014c1f4..5325cbf 100644 --- a/updater/platformio.ini +++ b/updater/platformio.ini @@ -70,11 +70,21 @@ build_flags = ${env.build_flags} -DNUKI_HUB_HTTPS_SERVER +[env:updater_esp32-nopsram] +board = nuki-esp32dev-nopsram +extra_scripts = + pre:pio_package_pre.py + post:pio_package_post.py +board_build.cmake_extra_args = + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32-nopsram" +build_flags = + ${env.build_flags} + [env:updater_esp32-gl-s10] extends = env:updater_esp32 board = nuki-esp32gls10 board_build.cmake_extra_args = - -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32;sdkconfig.gls10.defaults" + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32;sdkconfig.defaults.gls10" build_flags = ${env:updater_esp32.build_flags} -DNUKI_TARGET_GL_S10=y @@ -91,6 +101,12 @@ board = nuki-esp32-s3 board_build.cmake_extra_args = -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32-s3" +[env:updater_esp32-s3-nopsram] +extends = env:updater_esp32-nopsram +board = nuki-esp32-s3-nopsram +board_build.cmake_extra_args = + -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32-s3-nopsram" + [env:updater_esp32-s3-oct] extends = env:updater_esp32 board = nuki-esp32-s3-oct diff --git a/updater/sdkconfig.defaults.esp32-nopsram b/updater/sdkconfig.defaults.esp32-nopsram new file mode 100644 index 0000000..92f4d3b --- /dev/null +++ b/updater/sdkconfig.defaults.esp32-nopsram @@ -0,0 +1 @@ +CONFIG_SPIRAM=n \ No newline at end of file diff --git a/updater/sdkconfig.defaults.esp32-s3-nopsram b/updater/sdkconfig.defaults.esp32-s3-nopsram new file mode 100644 index 0000000..92f4d3b --- /dev/null +++ b/updater/sdkconfig.defaults.esp32-s3-nopsram @@ -0,0 +1 @@ +CONFIG_SPIRAM=n \ No newline at end of file diff --git a/updater/sdkconfig.gls10.defaults b/updater/sdkconfig.defaults.gls10 similarity index 100% rename from updater/sdkconfig.gls10.defaults rename to updater/sdkconfig.defaults.gls10 diff --git a/updater/src/idf_component.yml b/updater/src/idf_component.yml index 2bf3442..52f8774 100644 --- a/updater/src/idf_component.yml +++ b/updater/src/idf_component.yml @@ -1,9 +1,9 @@ dependencies: # Required IDF version - idf: ">=5.2" + idf: ">=5.5" espressif/esp_hosted: - version: "*" + version: 2.0.10 rules: - if: "target in [esp32p4]"