From 7cbc3b39be4dfbfca2d34565065d75563ad8626f Mon Sep 17 00:00:00 2001 From: Miroslav Pivovarsky Date: Thu, 27 Jun 2024 22:31:46 +0200 Subject: [PATCH] Change board name from ESP32_S3_CAM to ESP32_S3_DEV_CAM. Added template for the ESP32-S3-CAM board --- .../ESP32_PrusaConnectCam.ino | 13 +--- ESP32_PrusaConnectCam/mcu_cfg.h | 3 +- .../module_AI_Thinker_ESP32-CAM.h | 2 +- ESP32_PrusaConnectCam/module_ESP32-S3-CAM.h | 74 +++++++++++++++++++ .../module_ESP32-S3-EYE_2_2.h | 2 +- .../module_ESP32-WROVER-DEV.h | 2 +- ...P32_S3_CAM.h => module_ESP32_S3_DEV_CAM.h} | 6 +- .../module_XIAO_ESP32-S3-cam.h | 2 +- ESP32_PrusaConnectCam/module_templates.h | 7 +- 9 files changed, 90 insertions(+), 21 deletions(-) create mode 100644 ESP32_PrusaConnectCam/module_ESP32-S3-CAM.h rename ESP32_PrusaConnectCam/{module_ESP32_S3_CAM.h => module_ESP32_S3_DEV_CAM.h} (93%) diff --git a/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino b/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino index 1f2006a..a77a7b9 100644 --- a/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino +++ b/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino @@ -4,7 +4,7 @@ It's neccesary install support for ESP32 board to the arduino IDE. In the board manager we need add next link https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json Then we can install "ESP32 by Espressif Systems" board in the board manager. - ESP32 lib version: 2.0.16 (ESP-IDF v4.4.7) by Espressif Systems + ESP32 lib version: 3.0.2 (ESP-IDF v5.1.4) by Espressif Systems This project uses other libraries. It is necessary to install them in the arduino IDE. - Library - License - Version - Link @@ -12,7 +12,7 @@ - AsyncTCP - LGPL 3.0 - 3.1.4 - https://github.com/mathieucarbou/AsyncTCP - ArduinoJson - MIT - 7.0.4 - https://github.com/bblanchon/ArduinoJson - ArduinoUniqueID - MIT - 1.3.0 - https://github.com/ricaun/ArduinoUniqueID - - ESP32 - LGPL 2.1 - 3.0.2 - https://github.com/espressif/arduino-esp32 + - arduino-esp32 - LGPL 2.1 - 3.0.2 - https://github.com/espressif/arduino-esp32 Arduino IDE configuration for the MCU are stored in the module_XXX.h file. @@ -22,15 +22,6 @@ If you do not disable this option, your camera configuration will continue to be erased from the flash memory after uploading new firmware from the Arduino IDE. - Here is partitions table - # Name, Type, SubType, Offset, Size, Flags - nvs, data, nvs, 0x9000, 0x5000, - otadata, data, ota, 0xe000, 0x2000, - app0, app, ota_0, 0x10000, 0x1E0000, - app1, app, ota_1, 0x1F0000,0x1E0000, - spiffs, data, spiffs, 0x3D0000,0x20000, - coredump, data, coredump,0x3F0000,0x10000, - Project: ESP32 PrusaConnect Camera Developed for: Prusa Research, prusa3d.com Author: Miroslav Pivovarsky diff --git a/ESP32_PrusaConnectCam/mcu_cfg.h b/ESP32_PrusaConnectCam/mcu_cfg.h index 2cf7baf..f34ee4a 100644 --- a/ESP32_PrusaConnectCam/mcu_cfg.h +++ b/ESP32_PrusaConnectCam/mcu_cfg.h @@ -16,9 +16,10 @@ /* ----------------- CAMERA TYPE ---------------*/ #define AI_THINKER_ESP32_CAM true #define ESP32_WROVER_DEV false -#define CAMERA_MODEL_ESP32_S3_CAM false +#define CAMERA_MODEL_ESP32_S3_DEV_CAM false #define CAMERA_MODEL_ESP32_S3_EYE_2_2 false #define CAMERA_MODEL_XIAO_ESP32_S3_CAM false +#define CAMERA_MODEL_ESP32_S3_CAM false /* ---------------- BASIC MCU CFG --------------*/ #define SW_VERSION "1.1.0-rc1" ///< SW version diff --git a/ESP32_PrusaConnectCam/module_AI_Thinker_ESP32-CAM.h b/ESP32_PrusaConnectCam/module_AI_Thinker_ESP32-CAM.h index 4ddc23f..0ea9d39 100644 --- a/ESP32_PrusaConnectCam/module_AI_Thinker_ESP32-CAM.h +++ b/ESP32_PrusaConnectCam/module_AI_Thinker_ESP32-CAM.h @@ -79,7 +79,7 @@ /* -------------- STATUS LED CFG ----------------*/ #define STATUS_LED_ENABLE true ///< enable/disable status LED #define STATUS_LED_GPIO_NUM 33 ///< GPIO pin for status LED -#define STATUS_LED_OFF_PIN_LEVEL LOW ///< GPIO pin level for status LED ON +#define STATUS_LED_OFF_PIN_LEVEL LOW ///< GPIO pin level for status LED ON #endif // AI_THINKER_ESP32_CAM /* EOF */ \ No newline at end of file diff --git a/ESP32_PrusaConnectCam/module_ESP32-S3-CAM.h b/ESP32_PrusaConnectCam/module_ESP32-S3-CAM.h new file mode 100644 index 0000000..9cdd9ba --- /dev/null +++ b/ESP32_PrusaConnectCam/module_ESP32-S3-CAM.h @@ -0,0 +1,74 @@ +/** + @file module_ESP32-S3-CAM.h + + @brief Definition of the diymore esp32-s3-cam module + + @author Miroslav Pivovarsky + Contact: miroslav.pivovarsky@gmail.com + + @bug: NOT COMPLETED! + +*/ + +#pragma once + +#include "mcu_cfg.h" + +#ifdef CAMERA_MODEL_ESP32_S3_CAM + +/* --------------- CAMERA CFG -------------------*/ +#define PWDN_GPIO_NUM -1 ///< Power down control pin +#define RESET_GPIO_NUM -1 ///< Reset control pin +#define XCLK_GPIO_NUM 15 ///< External clock pin +#define SIOD_GPIO_NUM 4 ///< SCCB: SI/O data pin +#define SIOC_GPIO_NUM 5 ///< SCCB: SI/O control pin +#define Y9_GPIO_NUM 16 ///< SCCB: Y9 pin +#define Y8_GPIO_NUM 17 ///< SCCB: Y8 pin +#define Y7_GPIO_NUM 18 ///< SCCB: Y7 pin +#define Y6_GPIO_NUM 12 ///< SCCB: Y6 pin +#define Y5_GPIO_NUM 10 ///< SCCB: Y5 pin +#define Y4_GPIO_NUM 8 ///< SCCB: Y4 pin +#define Y3_GPIO_NUM 9 ///< SCCB: Y3 pin +#define Y2_GPIO_NUM 11 ///< SCCB: Y2 pin +#define VSYNC_GPIO_NUM 6 ///< Vertical sync pin +#define HREF_GPIO_NUM 7 ///< Line sync pin +#define PCLK_GPIO_NUM 13 ///< Pixel clock pin + +/* ------------------ MCU CFG ------------------*/ +#define ENABLE_BROWN_OUT_DETECTION false ///< Enable brown out detection +#define ENABLE_PSRAM true ///< Enable PSRAM + +/* --------------- OTA UPDATE CFG --------------*/ +#define OTA_UPDATE_FW_FILE PSTR("esp32-s3-cam.bin") ///< OTA update firmware file name +#define FW_STATUS_LED_PIN 4 ///< GPIO pin for status FW update LED +#define FW_STATUS_LED_LEVEL_ON HIGH ///< GPIO pin level for status LED ON + +/* --------------- FLASH LED CFG ---------------*/ +#define ENABLE_CAMERA_FLASH false ///< Enable camera flash function +#define CAMERA_FLASH_DIGITAL_CTRL false ///< Enable camera flash digital control +#define CAMERA_FLASH_PWM_CTRL false ///< Enable camera flash PWM control +#define FLASH_GPIO_NUM 48 ///< Flash control pin. RGB LED NeoPixel +#define FLASH_OFF_STATUS 0 ///< PWM intensity LED for OFF. 0-2^FLASH_PWM_RESOLUTION = 0-255 +#define FLASH_ON_STATUS 205 ///< PWM intensity LED for ON. limitation to 80%. 2^FLASH_PWM_RESOLUTION * 0.8% = 204 +//#define FLASH_PWM_FREQ 2000 ///< frequency of pwm [240MHz / (100 prescale * pwm cycles)] = frequency +//#define FLASH_PWM_CHANNEL 0 ///< channel 0 +//#define FLASH_PWM_RESOLUTION 8 ///< range 1-20bit. 8bit = 0-255 range + +/* --------------- SD CARD CFG ---------------*/ +#define ENABLE_SD_CARD false ///< Enable SD card function +#define SD_PIN_CLK 14 ///< GPIO pin for SD card clock +#define SD_PIN_CMD 15 ///< GPIO pin for SD card command +#define SD_PIN_DATA0 2 ///< GPIO pin for SD card data 0 + +/* ---------- RESET CFG CONFIGURATION ----------*/ +#define CFG_RESET_PIN 12 ///< GPIO 16 is for reset CFG to default +#define CFG_RESET_LED_PIN 4 ///< GPIO for indication of reset CFG +#define CFG_RESET_LED_LEVEL_ON HIGH ///< GPIO pin level for status LED ON + +/* -------------- STATUS LED CFG ----------------*/ +#define STATUS_LED_ENABLE true ///< enable/disable status LED +#define STATUS_LED_GPIO_NUM 33 ///< GPIO pin for status LED +#define STATUS_LED_OFF_PIN_LEVEL LOW ///< GPIO pin level for status LED ON + +#endif +/* EOF */ \ No newline at end of file diff --git a/ESP32_PrusaConnectCam/module_ESP32-S3-EYE_2_2.h b/ESP32_PrusaConnectCam/module_ESP32-S3-EYE_2_2.h index 0762e01..05f5b1e 100644 --- a/ESP32_PrusaConnectCam/module_ESP32-S3-EYE_2_2.h +++ b/ESP32_PrusaConnectCam/module_ESP32-S3-EYE_2_2.h @@ -61,7 +61,7 @@ #define ENABLE_PSRAM true ///< Enable PSRAM /* --------------- OTA UPDATE CFG --------------*/ -#define OTA_UPDATE_FW_FILE PSTR("ESP32S3_EYE22_PrusaConnectCam.ino.bin") ///< OTA update firmware file name +#define OTA_UPDATE_FW_FILE PSTR("ESP32S3_EYE22.bin") ///< OTA update firmware file name #define FW_STATUS_LED_PIN 3 ///< GPIO pin for status FW update LED #define FW_STATUS_LED_LEVEL_ON LOW ///< GPIO pin level for status LED ON diff --git a/ESP32_PrusaConnectCam/module_ESP32-WROVER-DEV.h b/ESP32_PrusaConnectCam/module_ESP32-WROVER-DEV.h index 2d62089..570923e 100644 --- a/ESP32_PrusaConnectCam/module_ESP32-WROVER-DEV.h +++ b/ESP32_PrusaConnectCam/module_ESP32-WROVER-DEV.h @@ -49,7 +49,7 @@ #define ENABLE_PSRAM true ///< Enable PSRAM /* --------------- OTA UPDATE CFG --------------*/ -#define OTA_UPDATE_FW_FILE PSTR("ESP32_WROVERDEV_PrusaConnectCam.ino.bin") ///< OTA update firmware file name +#define OTA_UPDATE_FW_FILE PSTR("ESP32_WROVERDEV.bin") ///< OTA update firmware file name #define FW_STATUS_LED_PIN 2 ///< GPIO pin for status FW update LED #define FW_STATUS_LED_LEVEL_ON LOW ///< GPIO pin level for status LED ON diff --git a/ESP32_PrusaConnectCam/module_ESP32_S3_CAM.h b/ESP32_PrusaConnectCam/module_ESP32_S3_DEV_CAM.h similarity index 93% rename from ESP32_PrusaConnectCam/module_ESP32_S3_CAM.h rename to ESP32_PrusaConnectCam/module_ESP32_S3_DEV_CAM.h index 0494484..9ee8604 100644 --- a/ESP32_PrusaConnectCam/module_ESP32_S3_CAM.h +++ b/ESP32_PrusaConnectCam/module_ESP32_S3_DEV_CAM.h @@ -1,5 +1,5 @@ /** - @file module_ESP32-WROVER-DEV.h + @file module_ESP32-S3-DEV-CAM.h @brief Definition of the ESP32-S3 DEV CAM module @@ -35,7 +35,7 @@ #include "mcu_cfg.h" -#ifdef CAMERA_MODEL_ESP32_S3_CAM +#ifdef CAMERA_MODEL_ESP32_S3_DEV_CAM /* --------------- CAMERA CFG -------------------*/ #define PWDN_GPIO_NUM -1 ///< Power down control pin @@ -60,7 +60,7 @@ #define ENABLE_PSRAM true ///< Enable PSRAM /* --------------- OTA UPDATE CFG --------------*/ -#define OTA_UPDATE_FW_FILE PSTR("ESP32S3_CAM_PrusaConnectCam.ino.bin") ///< OTA update firmware file name +#define OTA_UPDATE_FW_FILE PSTR("ESP32S3_DEV_CAM.bin") ///< OTA update firmware file name #define FW_STATUS_LED_PIN 34 ///< GPIO pin for status FW update LED #define FW_STATUS_LED_LEVEL_ON LOW ///< GPIO pin level for status LED ON diff --git a/ESP32_PrusaConnectCam/module_XIAO_ESP32-S3-cam.h b/ESP32_PrusaConnectCam/module_XIAO_ESP32-S3-cam.h index 3e0e70c..e767a1e 100644 --- a/ESP32_PrusaConnectCam/module_XIAO_ESP32-S3-cam.h +++ b/ESP32_PrusaConnectCam/module_XIAO_ESP32-S3-cam.h @@ -7,7 +7,7 @@ Contact: miroslav.pivovarsky@gmail.com https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html - https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/ + https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/ @bug: Currently SW don't work with this DEV board. WiFi and MicroSD is not working diff --git a/ESP32_PrusaConnectCam/module_templates.h b/ESP32_PrusaConnectCam/module_templates.h index 257dd27..c442bbf 100644 --- a/ESP32_PrusaConnectCam/module_templates.h +++ b/ESP32_PrusaConnectCam/module_templates.h @@ -20,8 +20,8 @@ #elif (true == ESP32_WROVER_DEV) #include "module_ESP32-WROVER-DEV.h" -#elif (true == CAMERA_MODEL_ESP32_S3_CAM) -#include "module_ESP32_S3_CAM.h" +#elif (true == CAMERA_MODEL_ESP32_S3_DEV_CAM) +#include "module_ESP32_S3_DEV_CAM.h" #elif (true == CAMERA_MODEL_ESP32_S3_EYE_2_2) #include "module_ESP32-S3-EYE_2_2.h" @@ -29,6 +29,9 @@ #elif (true == CAMERA_MODEL_XIAO_ESP32_S3_CAM) #include "module_XIAO_ESP32-S3-cam.h" +#elif (true == CAMERA_MODEL_ESP32_S3_CAM) +#include "module_ESP32_S3_CAM.h" + #else #error "No module selected"