From 138c620296b98c5857e1d1e3031b79cf00325eae Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Mon, 5 Feb 2024 01:19:04 +0100 Subject: [PATCH] Added unitcams3 --- README.md | 14 +++-- boards/esp32cam_ai_thinker.json | 2 +- boards/esp32cam_espressif_esp_eye.json | 2 +- boards/esp32cam_freenove_wrover_kit.json | 2 +- boards/esp32cam_m5stack_unitcams3.json | 78 ++++++++++++++++++++++++ platformio.ini | 4 ++ src/main.cpp | 12 ++-- 7 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 boards/esp32cam_m5stack_unitcams3.json diff --git a/README.md b/README.md index a4ca78c..b1e456a 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ This software supports the following ESP32-CAM (and alike) modules: - M5STACK ESP32CAM - M5STACK_PSRAM - M5STACK_UNITCAM +- M5STACK_UNITCAMS3 - M5STACK_V2_PSRAM - M5STACK_PSRAM - M5STACK_WIDE @@ -289,15 +290,16 @@ Not all the boards are equipped with PSRAM: | Board | PSRAM | |--- |--- | -| WROVER_KIT | Yes | -| ESP_EYE | Yes | -| ESP32S3_EYE | Yes | -| M5STACK_PSRAM | Yes | +| WROVER_KIT | 8Mb | +| ESP_EYE | 8Mb | +| ESP32S3_EYE | 8Mb | +| M5STACK_PSRAM | 8Mb | | M5STACK_V2_PSRAM | Version B only | -| M5STACK_WIDE | Yes | +| M5STACK_WIDE | 8Mb | | M5STACK_ESP32CAM | No | | M5STACK_UNITCAM | No | -| AI_THINKER | Yes | +| M5STACK_UNITCAMS3 | 8Mb | +| AI_THINKER | 8Mb | | TTGO_T_JOURNAL | No | | ESP32_CAM_BOARD | ? | | ESP32S2_CAM_BOARD | ? | diff --git a/boards/esp32cam_ai_thinker.json b/boards/esp32cam_ai_thinker.json index 7e2d1b4..7ae3458 100644 --- a/boards/esp32cam_ai_thinker.json +++ b/boards/esp32cam_ai_thinker.json @@ -9,7 +9,7 @@ "'-D ESP32CAM_AI_THINKER'", "'-D BOARD_HAS_PSRAM'", "'-mfix-esp32-psram-cache-issue'", - "'-D LED_BUILTIN=33'", + "'-D LED_GPIO=33'", "'-D CAMERA_CONFIG_PIN_PWDN=32'", "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", "'-D CAMERA_CONFIG_PIN_XCLK=0'", diff --git a/boards/esp32cam_espressif_esp_eye.json b/boards/esp32cam_espressif_esp_eye.json index 7ed1d29..78a1f56 100644 --- a/boards/esp32cam_espressif_esp_eye.json +++ b/boards/esp32cam_espressif_esp_eye.json @@ -9,7 +9,7 @@ "'-D ESP32CAM_ESPRESSIF_ESP_EYE'", "'-D BOARD_HAS_PSRAM'", "'-mfix-esp32-psram-cache-issue'", - "'-D LED_BUILTIN=14'", + "'-D LED_GPIO=14'", "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", "'-D CAMERA_CONFIG_PIN_XCLK=11'", diff --git a/boards/esp32cam_freenove_wrover_kit.json b/boards/esp32cam_freenove_wrover_kit.json index 1a258b0..01e5f2d 100644 --- a/boards/esp32cam_freenove_wrover_kit.json +++ b/boards/esp32cam_freenove_wrover_kit.json @@ -9,7 +9,7 @@ "'-D ESP32CAM_WROVER_KIT'", "'-D BOARD_HAS_PSRAM'", "'-mfix-esp32-psram-cache-issue'", - "'-D LED_BUILTIN=2'", + "'-D LED_GPIO=2'", "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", "'-D CAMERA_CONFIG_PIN_XCLK=21'", diff --git a/boards/esp32cam_m5stack_unitcams3.json b/boards/esp32cam_m5stack_unitcams3.json new file mode 100644 index 0000000..bc5ca18 --- /dev/null +++ b/boards/esp32cam_m5stack_unitcams3.json @@ -0,0 +1,78 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_8MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "'-D ESP32CAM_M5STACK_UNITCAMS3'", + "'-D BOARD_HAS_PSRAM'", + "'-D ARDUINO_USB_MODE=1'", + "'-D ARDUINO_USB_CDC_ON_BOOT=1'", + "'-D ARDUINO_RUNNING_CORE=1'", + "'-D ARDUINO_EVENT_RUNNING_CORE=1'", + "'-D LED_GPIO=14'", + "'-D CAMERA_CONFIG_PIN_PWDN=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_RESET=GPIO_NUM_NC'", + "'-D CAMERA_CONFIG_PIN_XCLK=21'", + "'-D CAMERA_CONFIG_PIN_SCCB_SDA=26'", + "'-D CAMERA_CONFIG_PIN_SCCB_SCL=27'", + "'-D CAMERA_CONFIG_PIN_Y9=35'", + "'-D CAMERA_CONFIG_PIN_Y8=34'", + "'-D CAMERA_CONFIG_PIN_Y7=39'", + "'-D CAMERA_CONFIG_PIN_Y6=36'", + "'-D CAMERA_CONFIG_PIN_Y5=19'", + "'-D CAMERA_CONFIG_PIN_Y4=18'", + "'-D CAMERA_CONFIG_PIN_Y3=5'", + "'-D CAMERA_CONFIG_PIN_Y2=4'", + "'-D CAMERA_CONFIG_PIN_VSYNC=25'", + "'-D CAMERA_CONFIG_PIN_HREF=23'", + "'-D CAMERA_CONFIG_PIN_PCLK=22'", + "'-D CAMERA_CONFIG_CLK_FREQ_HZ=20000000'", + "'-D CAMERA_CONFIG_LEDC_TIMER=LEDC_TIMER_0'", + "'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'", + "'-D CAMERA_CONFIG_FB_COUNT=2'", + "'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'", + "'-D I2C_MEMS_SDA=48'", + "'-D I2C_MEMS_SCL=47'" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [ + [ + "0x2886", + "0x0056" + ], + [ + "0x2886", + "0x8056" + ] + ], + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "openocd_target": "esp32s3.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "M5STACK UNITCAMS3", + "upload": { + "flash_size": "8MB", + "maximum_ram_size": 327680, + "maximum_size": 8388608, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.m5stack.com/en/unit/Unit-CamS3", + "vendor": "M5STACK" +} diff --git a/platformio.ini b/platformio.ini index d5eea6e..7d34cb0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,6 +19,7 @@ #default_envs = esp32cam_m5stack_esp32cam #default_envs = esp32cam_m5stack_psram #default_envs = esp32cam_m5stack_unitcam +#default_envs = esp32cam_m5stack_unitcams3 #default_envs = esp32cam_m5stack_v2_psram #default_envs = esp32cam_m5stack_wide #default_envs = esp32cam_ttgo_t_camera @@ -96,6 +97,9 @@ board = esp32cam_m5stack_psram [env:esp32cam_m5stack_unitcam] board = esp32cam_m5stack_unitcam +[env:esp32cam_m5stack_unitcams3] +board = esp32cam_m5stack_unitcams3 + [env:esp32cam_m5stack_v2_psram] board = esp32cam_m5stack_v2_psram diff --git a/src/main.cpp b/src/main.cpp index 6f814ba..b614739 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -318,10 +318,10 @@ void setup() { // Disable brownout WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); - // LED_BUILTIN (GPIO33) has inverted logic false => LED on -#ifdef LED_BUILTIN - pinMode(LED_BUILTIN, OUTPUT); - digitalWrite(LED_BUILTIN, false); + // LED_GPIO (GPIO33) has inverted logic false => LED on +#ifdef LED_GPIO + pinMode(LED_GPIO, OUTPUT); + digitalWrite(LED_GPIO, false); #endif // ESP32S2 has no serial port @@ -372,8 +372,8 @@ void setup() iotWebConf.getApTimeoutParameter()->visible = true; iotWebConf.setConfigSavedCallback(on_config_saved); iotWebConf.setWifiConnectionCallback(on_connected); -#ifdef LED_BUILTIN - iotWebConf.setStatusPin(LED_BUILTIN, LOW); +#ifdef LED_GPIO + iotWebConf.setStatusPin(LED_GPIO, LOW); #endif iotWebConf.init();