diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml
index fdd84244b..b8311829b 100644
--- a/.github/workflows/build-release.yaml
+++ b/.github/workflows/build-release.yaml
@@ -41,7 +41,7 @@ jobs:
plat:
- esp32cam
- xiao-esp32s3-sense
-
+ - freenove-esp32s3-n16r8
steps:
- name: Checkout branch
if: ${{ ! needs.prepare-release.outputs.release_created }}
@@ -178,6 +178,7 @@ jobs:
plat:
- esp32cam
- xiao-esp32s3-sense
+ - freenove-esp32s3-n16r8
# Sets permissions of the GITHUB_TOKEN to allow downloading artifacts
permissions:
diff --git a/README.md b/README.md
index 74fb974b4..14ca480e3 100644
--- a/README.md
+++ b/README.md
@@ -38,10 +38,18 @@ As a result, you get the digitized value of your meter. There are several option
## Supported Hardware
-| Board Type | SOC | Firmware Release | Remarks
-|:--- |:--- |:--- |:---
-| [ESP32-CAM](http://www.ai-thinker.com/pro_view-24.html) | ESP32 | All | - Only boards with >4MB RAM are supported
- Beware of inferior quality Chinese clones
-| [XIAO ESP32 Sense](https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html) | ESP32S3 | $\ge$ v17.0.0 |- No onboard illumination: Separate illumination (PWM controlable LED / Intelligent LED) necessary
- Running quite hot, small heat sink recommended
+### Board
+
+| Board Type | SOC / Module | Firmware Release | Remarks
+|:--- |:--- |:--- |:---
+| [ESP32-CAM](http://www.ai-thinker.com/pro_view-24.html) | ESP32 | All | - Only boards with >4MB RAM are supported
- Beware of inferior quality Chinese clones
+| [XIAO ESP32 Sense](https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html) | ESP32S3 | $\ge$ v17.0.0 |- No onboard illumination: Separate illumination (PWM controlable LED / Intelligent LED) necessary
- Running quite hot, small heat sink recommended
+| [ESP32S3-WROOM](https://github.com/Freenove/Freenove_ESP32_S3_WROOM_Board) | ESP32S3-WROOM-1-N16R8 | $\ge$ v17.0.0 |- SOC and pin compatible borads of Freenove ESP32S3-WROOM with 16MB flash and 8MB RAM supported
+
+### Camera
+| Camera Type | Resolution | Firmware Release | Remarks
+|:--- |:--- |:--- |:---
+| [OV2640](https://www.arducam.com/ov2640/) | 2MP (max. 1600x1200) | All | - Officially EOL since 2009, but still very popular
- Pin and function compatible Chinese clones are supported
## Device Installation
diff --git a/code/.gitignore b/code/.gitignore
index cbee1008c..911e8c9e0 100644
--- a/code/.gitignore
+++ b/code/.gitignore
@@ -9,4 +9,6 @@ dependencies.lock
sdkconfig.esp32cam
sdkconfig.esp32cam-localbuild
sdkconfig.xiao-esp32s3-sense
-sdkconfig.xiao-esp32s3-sense-localbuild
\ No newline at end of file
+sdkconfig.xiao-esp32s3-sense-localbuild
+sdkconfig.freenove-esp32s3-n16r8
+sdkconfig.freenove-esp32s3-n16r8-localbuild
\ No newline at end of file
diff --git a/code/components/camera_ctrl/ClassControlCamera.cpp b/code/components/camera_ctrl/ClassControlCamera.cpp
index eafe69dd0..e49ef36e6 100644
--- a/code/components/camera_ctrl/ClassControlCamera.cpp
+++ b/code/components/camera_ctrl/ClassControlCamera.cpp
@@ -963,10 +963,17 @@ void ClassControlCamera::setStatusLed(bool _status)
/* Set the GPIO as a push/pull output */
gpio_set_direction(GPIO_STATUS_LED_ONBOARD, GPIO_MODE_OUTPUT);
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
if (!_status)
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
+#else
+ if (_status)
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
+ else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
+#endif
}
}
diff --git a/code/components/misc_helper/statusled.cpp b/code/components/misc_helper/statusled.cpp
index 67609d7b3..3b87d6a3f 100644
--- a/code/components/misc_helper/statusled.cpp
+++ b/code/components/misc_helper/statusled.cpp
@@ -25,7 +25,11 @@ void task_StatusLED(void *pvParameter)
esp_rom_gpio_pad_select_gpio(GPIO_STATUS_LED_ONBOARD); // Init the GPIO
gpio_set_direction(GPIO_STATUS_LED_ONBOARD, GPIO_MODE_OUTPUT); // Set the GPIO as a push/pull output
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);// LED off
+#else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);// LED off
+#endif
for (int i=0; i<2; ) // Default: repeat 2 times
{
@@ -34,9 +38,17 @@ void task_StatusLED(void *pvParameter)
for (int j = 0; j < StatusLEDDataInt.iSourceBlinkCnt; ++j)
{
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
+#else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
+#endif
vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
+#else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
+#endif
vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);
}
@@ -44,9 +56,17 @@ void task_StatusLED(void *pvParameter)
for (int j = 0; j < StatusLEDDataInt.iCodeBlinkCnt; ++j)
{
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
+#else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
+#endif
vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
+#else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
+#endif
vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);
}
vTaskDelay(1500 / portTICK_PERIOD_MS); // Delay to signal new round
@@ -147,5 +167,9 @@ void setStatusLedOff(void)
esp_rom_gpio_pad_select_gpio(GPIO_STATUS_LED_ONBOARD); // Init the GPIO
gpio_set_direction(GPIO_STATUS_LED_ONBOARD, GPIO_MODE_OUTPUT); // Set the GPIO as a push/pull output
+#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);// LED off
+#else
+ gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);// LED off
+#endif
}
\ No newline at end of file
diff --git a/code/include/defines.h b/code/include/defines.h
index b704c7ba8..d50ad88fe 100644
--- a/code/include/defines.h
+++ b/code/include/defines.h
@@ -277,33 +277,23 @@ CONFIG_WPA_11R_SUPPORT=n
//*************************************************************************
// Define BOARD type
-// Define ENV_BOARD_TYPE in platformio.ini
+// Define in platformio.ini
//************************************
-#if ENV_BOARD_TYPE == 1
-#define BOARD_AITHINKER_ESP32CAM
-#define BOARD_TYPE_NAME "ESP32CAM" // Keep Board type equal to main board environment name
- // This is used for OTA update package verification (converted to lower case)
-#elif ENV_BOARD_TYPE == 2
-#define BOARD_XIAO_ESP32S3
-#define BOARD_TYPE_NAME "XIAO-ESP32S3-Sense" // Keep Board type equal to main board environment name.
+#if defined(BOARD_AITHINKER_ESP32CAM)
+#define BOARD_TYPE_NAME "ESP32CAM" // Keep Board type equal to main board environment name
// This is used for OTA update package verification (converted to lower case)
-#else
-#error "Board type (ENV_BOARD_TYPE) not defined"
-#define BOARD_AITHINKER_ESP32CAM
-#define BOARD_TYPE_NAME "Board unknown"
-#endif
+#elif defined(BOARD_XIAO_ESP32S3)
+#define BOARD_TYPE_NAME "XIAO-ESP32S3-Sense" // Keep Board type equal to main board environment name.
+ // This is used for OTA update package verification (converted to lower case)
-// Define CAMERA model
-// Define ENV_CAMERA_MODEL in platformio.ini
-//************************************
-#if ENV_CAMERA_MODEL == 1
-#define CAMERA_AITHINKER_ESP32CAM_OV2640
-#elif ENV_CAMERA_MODEL == 2
-#define CAMERA_XIAO_ESP32S3_SENSE_OV2640
+#elif defined(BOARD_FREENOVE_ESP32S3_N16R8)
+#define BOARD_TYPE_NAME "Freenove-ESP32S3-N16R8"// Keep Board type equal to main board environment name.
+ // This is used for OTA update package verification (converted to lower case)
#else
-#define CAMERA_AITHINKER_ESP32CAM_OV2640
-#error "Camera model (ENV_CAMERA_MODEL) not defined"
+#error "Board type not defined"
+#define BOARD_AITHINKER_ESP32CAM
+#define BOARD_TYPE_NAME "Board unknown"
#endif
@@ -324,9 +314,33 @@ CONFIG_WPA_11R_SUPPORT=n
#define GPIO_SDCARD_D3 GPIO_NUM_13 // Needs to be high to init SD in MMC mode. After init GPIO can be used as spare GPIO
+ // Camera pin config
+ // Further models: https://github.com/Mjrovai/XIAO-ESP32S3-Sense/blob/main/camera_round_display_save_jpeg/camera_pins.h
+ //-------------------------------------------------
+ #define PWDN_GPIO_NUM GPIO_NUM_32
+ #define RESET_GPIO_NUM -1
+ #define XCLK_GPIO_NUM GPIO_NUM_0
+ #define SIOD_GPIO_NUM GPIO_NUM_26
+ #define SIOC_GPIO_NUM GPIO_NUM_27
+
+ #define Y9_GPIO_NUM GPIO_NUM_35
+ #define Y8_GPIO_NUM GPIO_NUM_34
+ #define Y7_GPIO_NUM GPIO_NUM_39
+ #define Y6_GPIO_NUM GPIO_NUM_36
+ #define Y5_GPIO_NUM GPIO_NUM_21
+ #define Y4_GPIO_NUM GPIO_NUM_19
+ #define Y3_GPIO_NUM GPIO_NUM_18
+ #define Y2_GPIO_NUM GPIO_NUM_5
+ #define VSYNC_GPIO_NUM GPIO_NUM_25
+ #define HREF_GPIO_NUM GPIO_NUM_23
+ #define PCLK_GPIO_NUM GPIO_NUM_22
+
+
// LEDs
//-------------------------------------------------
- #define GPIO_STATUS_LED_ONBOARD GPIO_NUM_33 // Onboard red status LED
+ #define GPIO_STATUS_LED_ONBOARD GPIO_NUM_33 // Onboard status LED (red, active low)
+ #define GPIO_STATUS_LED_ONBOARD_LOWACTIVE // Enable if status LED is low active
+
#define GPIO_FLASHLIGHT_ONBOARD GPIO_NUM_4 // Onboard flashlight LED
#ifdef BOARD_SDCARD_SDMMC_BUS_WIDTH_1
@@ -396,14 +410,39 @@ CONFIG_WPA_11R_SUPPORT=n
#define GPIO_SDCARD_CLK GPIO_NUM_7
#define GPIO_SDCARD_CMD GPIO_NUM_9
#define GPIO_SDCARD_D0 GPIO_NUM_8
+ #define GPIO_SDCARD_D1 GPIO_NUM_NC
+ #define GPIO_SDCARD_D2 GPIO_NUM_NC
#define GPIO_SDCARD_D3 GPIO_NUM_21 // Needs to be high to init with MMC mode. After init GPIO can be used as status LED
+ // Camera pin config
+ // Further models: https://github.com/Mjrovai/XIAO-ESP32S3-Sense/blob/main/camera_round_display_save_jpeg/camera_pins.h
+ //-------------------------------------------------
+ #define PWDN_GPIO_NUM -1
+ #define RESET_GPIO_NUM -1
+ #define XCLK_GPIO_NUM GPIO_NUM_10
+ #define SIOD_GPIO_NUM GPIO_NUM_40
+ #define SIOC_GPIO_NUM GPIO_NUM_39
+
+ #define Y9_GPIO_NUM GPIO_NUM_48
+ #define Y8_GPIO_NUM GPIO_NUM_11
+ #define Y7_GPIO_NUM GPIO_NUM_12
+ #define Y6_GPIO_NUM GPIO_NUM_14
+ #define Y5_GPIO_NUM GPIO_NUM_16
+ #define Y4_GPIO_NUM GPIO_NUM_18
+ #define Y3_GPIO_NUM GPIO_NUM_17
+ #define Y2_GPIO_NUM GPIO_NUM_15
+ #define VSYNC_GPIO_NUM GPIO_NUM_38
+ #define HREF_GPIO_NUM GPIO_NUM_47
+ #define PCLK_GPIO_NUM GPIO_NUM_13
+
+
// LEDs
//-------------------------------------------------
- #define GPIO_STATUS_LED_ONBOARD GPIO_NUM_21 // Onboard yellow status LED (USER LED)
- #define GPIO_FLASHLIGHT_ONBOARD GPIO_NUM_NC // No onboard flashlight available
+ #define GPIO_STATUS_LED_ONBOARD GPIO_NUM_21 // Onboard yellow status LED (USER LED, yellow, active low)
+ #define GPIO_STATUS_LED_ONBOARD_LOWACTIVE // Enable if status LED is low active
+ #define GPIO_FLASHLIGHT_ONBOARD GPIO_NUM_NC // No onboard flashlight available
#define GPIO_FLASHLIGHT_DEFAULT GPIO_NUM_1 // Default flashlight GPIO pin (can be modified by activiating GPIO functionality in WebUI)
#define GPIO_FLASHLIGHT_DEFAULT_USE_PWM // Default flashlight LED is PWM controlled
@@ -449,53 +488,96 @@ CONFIG_WPA_11R_SUPPORT=n
#define GPIO_SPARE_6 GPIO_NUM_6
#define GPIO_SPARE_6_USAGE "spare"
-#else
- #error "define.h: No board type defined or type unknown"
-#endif //Board types
-
+#elif defined(BOARD_FREENOVE_ESP32S3_N16R8)
+ #ifndef BOARD_SDCARD_SDMMC_BUS_WIDTH_1
+ #define BOARD_SDCARD_SDMMC_BUS_WIDTH_1 // Only 1 line SD card operation is supported (hardware related)
+ #endif
-// Camera models
-// Further models: https://github.com/Mjrovai/XIAO-ESP32S3-Sense/blob/main/camera_round_display_save_jpeg/camera_pins.h
-//************************************
-#ifdef CAMERA_AITHINKER_ESP32CAM_OV2640
- #define PWDN_GPIO_NUM GPIO_NUM_32
- #define RESET_GPIO_NUM -1
- #define XCLK_GPIO_NUM GPIO_NUM_0
- #define SIOD_GPIO_NUM GPIO_NUM_26
- #define SIOC_GPIO_NUM GPIO_NUM_27
+ // SD card (operated with SDMMC peripheral)
+ //-------------------------------------------------
+ #define GPIO_SDCARD_CLK GPIO_NUM_39
+ #define GPIO_SDCARD_CMD GPIO_NUM_38
+ #define GPIO_SDCARD_D0 GPIO_NUM_40
+ #define GPIO_SDCARD_D1 GPIO_NUM_NC
+ #define GPIO_SDCARD_D2 GPIO_NUM_NC
+ #define GPIO_SDCARD_D3 GPIO_NUM_NC
- #define Y9_GPIO_NUM GPIO_NUM_35
- #define Y8_GPIO_NUM GPIO_NUM_34
- #define Y7_GPIO_NUM GPIO_NUM_39
- #define Y6_GPIO_NUM GPIO_NUM_36
- #define Y5_GPIO_NUM GPIO_NUM_21
- #define Y4_GPIO_NUM GPIO_NUM_19
- #define Y3_GPIO_NUM GPIO_NUM_18
- #define Y2_GPIO_NUM GPIO_NUM_5
- #define VSYNC_GPIO_NUM GPIO_NUM_25
- #define HREF_GPIO_NUM GPIO_NUM_23
- #define PCLK_GPIO_NUM GPIO_NUM_22
-#elif defined(CAMERA_XIAO_ESP32S3_SENSE_OV2640)
+ // Camera pin config
+ // Further models: https://github.com/Mjrovai/XIAO-ESP32S3-Sense/blob/main/camera_round_display_save_jpeg/camera_pins.h
+ //-------------------------------------------------
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
- #define XCLK_GPIO_NUM GPIO_NUM_10
- #define SIOD_GPIO_NUM GPIO_NUM_40
- #define SIOC_GPIO_NUM GPIO_NUM_39
-
- #define Y9_GPIO_NUM GPIO_NUM_48
- #define Y8_GPIO_NUM GPIO_NUM_11
- #define Y7_GPIO_NUM GPIO_NUM_12
- #define Y6_GPIO_NUM GPIO_NUM_14
- #define Y5_GPIO_NUM GPIO_NUM_16
- #define Y4_GPIO_NUM GPIO_NUM_18
- #define Y3_GPIO_NUM GPIO_NUM_17
- #define Y2_GPIO_NUM GPIO_NUM_15
- #define VSYNC_GPIO_NUM GPIO_NUM_38
- #define HREF_GPIO_NUM GPIO_NUM_47
+ #define XCLK_GPIO_NUM GPIO_NUM_15
+ #define SIOD_GPIO_NUM GPIO_NUM_4
+ #define SIOC_GPIO_NUM GPIO_NUM_5
+
+ #define Y9_GPIO_NUM GPIO_NUM_16
+ #define Y8_GPIO_NUM GPIO_NUM_17
+ #define Y7_GPIO_NUM GPIO_NUM_18
+ #define Y6_GPIO_NUM GPIO_NUM_12
+ #define Y5_GPIO_NUM GPIO_NUM_10
+ #define Y4_GPIO_NUM GPIO_NUM_8
+ #define Y3_GPIO_NUM GPIO_NUM_9
+ #define Y2_GPIO_NUM GPIO_NUM_11
+ #define VSYNC_GPIO_NUM GPIO_NUM_6
+ #define HREF_GPIO_NUM GPIO_NUM_7
#define PCLK_GPIO_NUM GPIO_NUM_13
+
+
+ // LEDs
+ //-------------------------------------------------
+ #define GPIO_STATUS_LED_ONBOARD GPIO_NUM_2 // Onboard status LED (blue, active high)
+ //#define GPIO_STATUS_LED_ONBOARD_LOWACTIVE // Enable if status LED is low active
+
+ #define GPIO_FLASHLIGHT_ONBOARD GPIO_NUM_48 // Onboard flashlight (WS2812)
+ #define GPIO_FLASHLIGHT_DEFAULT GPIO_FLASHLIGHT_ONBOARD // Default flashlight GPIO pin (can be modified by activiating GPIO functionality in WebUI)
+
+ //#define GPIO_FLASHLIGHT_DEFAULT_USE_PWM // Default flashlight LED is PWM controlled
+ #define GPIO_FLASHLIGHT_DEFAULT_USE_SMARTLED // Default flashlight SmartLED (e.g. onboard WS2812X) controlled
+
+ #ifdef GPIO_FLASHLIGHT_DEFAULT_USE_SMARTLED
+ #define GPIO_FLASHLIGHT_DEFAULT_SMARTLED_TYPE LED_WS2812 // Flashlight default: SmartLED type
+ #define GPIO_FLASHLIGHT_DEFAULT_SMARTLED_QUANTITY 1 // Flashlight default: SmartLED Quantity
+ #endif
+
+
+ // Spare GPIO
+ //-------------------------------------------------
+ // Options for usage defintion:
+ // - 'spare': Free to use
+ // - 'restricted: usage': Restricted usable (WebUI expert view)
+ // - 'flashlight-pwm' or 'flashlight-smartled' or 'flashlight-digital' (ON/OFF) -> Map to 'flashlight-default'
+ // --> flashlight-default -> flashlight-smartled (Onboard LED, smartled controlled)
+ //-------------------------------------------------
+ #define GPIO_SPARE_PIN_COUNT 6
+
+ #define GPIO_SPARE_1 GPIO_NUM_1
+ #define GPIO_SPARE_1_USAGE "spare"
+
+ #define GPIO_SPARE_2 GPIO_NUM_14
+ #define GPIO_SPARE_2_USAGE "spare"
+
+ #define GPIO_SPARE_3 GPIO_NUM_21
+ #define GPIO_SPARE_3_USAGE "spare"
+
+ #define GPIO_SPARE_4 GPIO_NUM_46
+ #define GPIO_SPARE_4_USAGE "spare"
+
+ #define GPIO_SPARE_5 GPIO_NUM_47
+ #define GPIO_SPARE_5_USAGE "spare"
+
+ #define GPIO_SPARE_6 GPIO_FLASHLIGHT_DEFAULT // Flashlight default
+ #if defined(GPIO_FLASHLIGHT_DEFAULT_USE_PWM)
+ #define GPIO_SPARE6_USAGE FLASHLIGHT_PWM // Define flashlight-default as ...
+ #elif defined(GPIO_FLASHLIGHT_DEFAULT_USE_SMARTLED)
+ #define GPIO_SPARE_6_USAGE FLASHLIGHT_SMARTLED // Define flashlight-default as ...
+ #else
+ #define GPIO_SPARE_6_USAGE FLASHLIGHT_DIGITAL // Define flashlight-default as ...
+ #endif
+
#else
- #error "define.h: No camera model defined or model unknown"
-#endif //Camera models
+ #error "define.h: No board type defined or type unknown"
+#endif //Board types
#endif //DEFINES_H
\ No newline at end of file
diff --git a/code/partitions_16MB.csv b/code/partitions_16MB.csv
new file mode 100644
index 000000000..1cb331c0a
--- /dev/null
+++ b/code/partitions_16MB.csv
@@ -0,0 +1,7 @@
+# Name, Type, SubType, Offset, Size, Flags
+nvs, data, nvs, , 0x5000,
+otadata, data, ota, , 0x2000,
+ota_0, app, ota_0, , 2048K,
+ota_1, app, ota_1, , 2048K,
+coredump, data, coredump, , 64K,
+littlefs, data, littlefs, , 0xBE0000,
\ No newline at end of file
diff --git a/code/partitions_4MB.csv b/code/partitions_4MB.csv
new file mode 100644
index 000000000..239443215
--- /dev/null
+++ b/code/partitions_4MB.csv
@@ -0,0 +1,6 @@
+# Name, Type, SubType, Offset, Size, Flags
+nvs, data, nvs, , 0x5000,
+otadata, data, ota, , 0x2000,
+ota_0, app, ota_0, , 0x1EC000,
+ota_1, app, ota_1, , 0x1EC000,
+coredump, data, coredump, , 64K,
\ No newline at end of file
diff --git a/code/partitions.csv b/code/partitions_4MB_legacy.csv
similarity index 100%
rename from code/partitions.csv
rename to code/partitions_4MB_legacy.csv
diff --git a/code/partitions_8MB.csv b/code/partitions_8MB.csv
new file mode 100644
index 000000000..d1984f7ad
--- /dev/null
+++ b/code/partitions_8MB.csv
@@ -0,0 +1,7 @@
+# Name, Type, SubType, Offset, Size, Flags
+nvs, data, nvs, , 0x5000,
+otadata, data, ota, , 0x2000,
+ota_0, app, ota_0, , 2048K,
+ota_1, app, ota_1, , 2048K,
+coredump, data, coredump, , 64K,
+littlefs, data, littlefs, , 0x3F800,
\ No newline at end of file
diff --git a/code/platformio.ini b/code/platformio.ini
index 2bc806d2b..077a3dd20 100644
--- a/code/platformio.ini
+++ b/code/platformio.ini
@@ -53,21 +53,19 @@ build_flags =
; #############################################################################
[env:esp32cam]
extends = common:esp32-idf
-board = esp32cam
framework = espidf
+board = esp32cam
+board_build.partitions = partitions_4MB_legacy.csv
build_flags =
; ### Common flags:
${common:esp32-idf.build_flags}
${flags:runtime.build_flags}
- ; ### Hardware: Define board type + camera model
- ; ### (see 'include/defines.h' for definitions)
- -D ENV_BOARD_TYPE=1
- -D ENV_CAMERA_MODEL=1
+ ; ### Hardware: Define board type (see 'include/defines.h' for definitions)
+ -D BOARD_AITHINKER_ESP32CAM
; ### Software modules: Uncomment to disable
;-D ENV_DISABLE_MQTT
;-D ENV_DISABLE_INFLUXDB
;-D ENV_DISABLE_SOFTAP
-board_build.partitions = partitions.csv
monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
@@ -87,10 +85,8 @@ build_flags =
; ### Common flags:
${common:esp32-idf.build_flags}
${flags:runtime.build_flags}
- ; ### Hardware: Define board type + camera model
- ; ### (see 'include/defines.h' for definitions)
- -D ENV_BOARD_TYPE=1
- -D ENV_CAMERA_MODEL=1
+ ; ### Hardware: Define board type (see 'include/defines.h' for definitions)
+ -D BOARD_AITHINKER_ESP32CAM
@@ -100,21 +96,19 @@ build_flags =
; #############################################################################
[env:xiao-esp32s3-sense]
extends = common:esp32-idf
-board = seeed_xiao_esp32s3
framework = espidf
+board = seeed_xiao_esp32s3
+board_build.partitions = partitions_8MB.csv
build_flags =
; ### common imported :
${common:esp32-idf.build_flags}
${flags:runtime.build_flags}
- ; ### Hardware: Define board type + camera model
- ; ### (see 'include/defines.h' for definitions)
- -D ENV_BOARD_TYPE=2
- -D ENV_CAMERA_MODEL=2
+ ; ### Hardware: Define board type (see 'include/defines.h' for definitions)
+ -D BOARD_XIAO_ESP32S3
; ### Software modules: Uncomment to disable
;-D ENV_DISABLE_MQTT
;-D ENV_DISABLE_INFLUXDB
;-D ENV_DISABLE_SOFTAP
-board_build.partitions = partitions.csv
monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
@@ -134,7 +128,50 @@ build_flags =
; ### common imported :
${common:esp32-idf.build_flags}
${flags:runtime.build_flags}
- ; ### Hardware: Define board type + camera model
- ; ### (see 'include/defines.h' for definitions)
- -D ENV_BOARD_TYPE=2
- -D ENV_CAMERA_MODEL=2
+ ; ### Hardware: Define board type (see 'include/defines.h' for definitions)
+ -D BOARD_XIAO_ESP32S3
+
+
+; #############################################################################
+; Board
+; Freenove ESP32S3-WROOM-1-N16R8 (Freenove pin compatible clones)
+; #############################################################################
+[env:freenove-esp32s3-n16r8]
+extends = common:esp32-idf
+framework = espidf
+# 'freenove_esp32_s3_wroom' not yet supported, but already in dev: (#1469) Freenove ESP32-S3-WROOM added
+board = 4d_systems_esp32s3_gen4_r8n16
+board_upload.flash_size = 16MB
+board_upload.maximum_size = 16777216
+board_build.partitions = partitions_16MB.csv
+build_flags =
+ ; ### common imported :
+ ${common:esp32-idf.build_flags}
+ ${flags:runtime.build_flags}
+ ; ### Hardware: Define board type (see 'include/defines.h' for definitions)
+ -D BOARD_FREENOVE_ESP32S3_N16R8
+ ; ### Software modules: Uncomment to disable
+ ;-D ENV_DISABLE_MQTT
+ ;-D ENV_DISABLE_INFLUXDB
+ ;-D ENV_DISABLE_SOFTAP
+monitor_speed = 115200
+monitor_rts = 0
+monitor_dtr = 0
+monitor_filters = default, esp32_exception_decoder
+
+
+; +++++++++++++++++++++++++++++++++++++++++++
+; Use this environment if building locally
+; Include parameter tooltips to HTML parameter config file
+; and hash to HTML files (caching)
+; +++++++++++++++++++++++++++++++++++++++++++
+[env:freenove-esp32s3-n16r8-localbuild]
+extends = env:freenove-esp32s3-n16r8
+extra_scripts = post:scripts/localbuild.py # Add parameter tooltips to HTML page
+ # and hashes to all cached HTML files
+build_flags =
+ ; ### common imported :
+ ${common:esp32-idf.build_flags}
+ ${flags:runtime.build_flags}
+ ; ### Hardware: Define board type (see 'include/defines.h' for definitions)
+ -D BOARD_FREENOVE_ESP32S3_N16R8
diff --git a/code/sdkconfig.freenove-esp32s3-n16r8.defaults b/code/sdkconfig.freenove-esp32s3-n16r8.defaults
new file mode 100644
index 000000000..373e22fce
--- /dev/null
+++ b/code/sdkconfig.freenove-esp32s3-n16r8.defaults
@@ -0,0 +1,46 @@
+##################################################
+# Application and board specific configuration
+# Edit this file instead of sdkconfig.{board_type}!
+# After editing make sure to explicitly delete
+# sdkconfig.{board_type} to apply your changes!
+##################################################
+
+#
+# Serial flasher config
+#
+CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
+CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
+CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
+
+
+#
+# Partition Table
+#
+CONFIG_PARTITION_TABLE_CUSTOM=y
+CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
+CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
+CONFIG_PARTITION_TABLE_OFFSET=0x8000
+CONFIG_PARTITION_TABLE_MD5=y
+
+
+#
+# Common ESP-related
+#
+CONFIG_ESP_ERR_TO_NAME_LOOKUP=n
+CONFIG_ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY=n
+
+
+#
+# SPI RAM config
+#
+CONFIG_SPIRAM_SIZE=-1
+CONFIG_SPIRAM_MODE_OCT=y
+CONFIG_SPIRAM_SPEED_80M=y
+CONFIG_SPIRAM_BOOT_INIT=y
+CONFIG_SPIRAM_USE_MALLOC=y
+CONFIG_SPIRAM_MEMTEST=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=8192
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=131072
+CONFIG_SPIRAM_IGNORE_NOTFOUND=y
+CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=n
+CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=n
diff --git a/docs/Installation/Firmware/freenove-esp32s3-n16r8.md b/docs/Installation/Firmware/freenove-esp32s3-n16r8.md
new file mode 100644
index 000000000..2b0935fc3
--- /dev/null
+++ b/docs/Installation/Firmware/freenove-esp32s3-n16r8.md
@@ -0,0 +1,49 @@
+# Firmware Installation (Freenove ESP32S3)
+
+## Manual Firmware Installation / Manual Firmware Update
+
+ ### 1. Flash microcontroller content (ESP32S3 based microcontroller)
+
+ - Put your board into bootloader mode (IO0 grounded + board reset)
+ - Three files to be flashed with correct flash offset
+
+ | Filename | Offset | Description
+ |:------------------|:------------|:------
+ | bootloader.bin | 0x0 | Bootloader
+ | partitions.bin | 0x8000 | Partition definition
+ | firmware.bin | 0x10000 | User application
+
+ - Use `Flash Download Tool` from Espressif or the console-based `esptool` to flash the files.
+ Usage is described [here](https://jomjol.github.io/AI-on-the-edge-device-docs/Installation/#flashing-using-the-flash-tool-from-espressif-gui).
+
+
+ ### 2. Prepare SD Card
+ - Format SD card with FAT32 (Windows recommenend. In MacOS formated cards could not working properly)
+ - Copy folders `/config` and `/html` from zip file to SD card root folder
+
+
+ ### 3. Configure WLAN
+
+ #### Option 1: Modify content directly in config file
+ Use config.json template from `sdcard/config/template` folder, copy it to
+ `sdcard/config` folder and to configure your wlan connection.
+ Note 1: If device is already booted once, a full config with default configuration is already sitting in `/config` folder.
+ You can also use this file, search for section network and adapt the wlan config there.
+ Note 2: Be careful with syntax. Messing up the JSON notation, config is getting rejected.
+
+ #### Option 2: Use Access Point feature
+ Usage is decribed [here](https://jomjol.github.io/AI-on-the-edge-device-docs/Installation/#remote-setup-using-the-built-in-access-point).
+
+
+
+## Web-based Firmware Installer
+
+ --> Not supported up to now.
+
+
+
+## OTA (Over-The-Air) Firmware Update
+
+ Select firmware package zip from github repository in WebUI OTA Updater page.
+ The device is getting updated automatically. The existing configuration will not be overwritten.
+