You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked the issue tracker for similar issues to ensure this is not a duplicate.
Provided a clear description of your suggestion.
Included any relevant context or examples.
Issue or Suggestion Description
/** * This example takes a picture every 5s and print its size on serial monitor.*/// =============================== SETUP ======================================// 1. Board setup (Uncomment):// #define BOARD_WROVER_KIT// #define BOARD_ESP32CAM_AITHINKER// #define BOARD_ESP32S3_WROOM/** * 2. Kconfig setup * * If you have a Kconfig file, copy the content from * https://github.com/espressif/esp32-camera/blob/master/Kconfig into it. * In case you haven't, copy and paste this Kconfig file inside the src directory. * This Kconfig file has definitions that allows more control over the camera and * how it will be initialized.*//** * 3. Enable PSRAM on sdkconfig: * * CONFIG_ESP32_SPIRAM_SUPPORT=y * * More info on * https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-esp32-spiram-support*/// ================================ CODE ======================================
#include<esp_log.h>
#include<esp_system.h>
#include<nvs_flash.h>
#include<sys/param.h>
#include<string.h>
#include"freertos/FreeRTOS.h"
#include"freertos/task.h"// support IDF 5.x
#ifndef portTICK_RATE_MS
#defineportTICK_RATE_MS portTICK_PERIOD_MS
#endif
#include"esp_camera.h"
#defineBOARD_ESP32S3_WROOM1// WROVER-KIT PIN Map
#ifdef BOARD_WROVER_KIT
#defineCAM_PIN_PWDN -1//power down is not used
#defineCAM_PIN_RESET -1//software reset will be performed
#defineCAM_PIN_XCLK21
#defineCAM_PIN_SIOD26
#defineCAM_PIN_SIOC27
#defineCAM_PIN_D735
#defineCAM_PIN_D634
#defineCAM_PIN_D539
#defineCAM_PIN_D436
#defineCAM_PIN_D319
#defineCAM_PIN_D218
#defineCAM_PIN_D15
#defineCAM_PIN_D04
#defineCAM_PIN_VSYNC25
#defineCAM_PIN_HREF23
#defineCAM_PIN_PCLK22
#endif// ESP32Cam (AiThinker) PIN Map
#ifdef BOARD_ESP32CAM_AITHINKER
#defineCAM_PIN_PWDN32
#defineCAM_PIN_RESET -1//software reset will be performed
#defineCAM_PIN_XCLK0
#defineCAM_PIN_SIOD26
#defineCAM_PIN_SIOC27
#defineCAM_PIN_D735
#defineCAM_PIN_D634
#defineCAM_PIN_D539
#defineCAM_PIN_D436
#defineCAM_PIN_D321
#defineCAM_PIN_D219
#defineCAM_PIN_D118
#defineCAM_PIN_D05
#defineCAM_PIN_VSYNC25
#defineCAM_PIN_HREF23
#defineCAM_PIN_PCLK22
#endif// ESP32S3 (WROOM) PIN Map
#ifdef BOARD_ESP32S3_WROOM
#defineCAM_PIN_PWDN -1//power down is not used
#defineCAM_PIN_RESET39//software reset will be performed
#defineCAM_PIN_XCLK38
#defineCAM_PIN_SIOD5
#defineCAM_PIN_SIOC4
#defineCAM_PIN_D79
#defineCAM_PIN_D610
#defineCAM_PIN_D511
#defineCAM_PIN_D413
#defineCAM_PIN_D321
#defineCAM_PIN_D248
#defineCAM_PIN_D147
#defineCAM_PIN_D014
#defineCAM_PIN_VSYNC8
#defineCAM_PIN_HREF18
#defineCAM_PIN_PCLK12
#endifstaticconstchar *TAG = "example:take_picture";
#if ESP_CAMERA_SUPPORTED
staticcamera_config_t camera_config = {
.pin_pwdn = CAM_PIN_PWDN,
.pin_reset = CAM_PIN_RESET,
.pin_xclk = CAM_PIN_XCLK,
.pin_sccb_sda = CAM_PIN_SIOD,
.pin_sccb_scl = CAM_PIN_SIOC,
.pin_d7 = CAM_PIN_D7,
.pin_d6 = CAM_PIN_D6,
.pin_d5 = CAM_PIN_D5,
.pin_d4 = CAM_PIN_D4,
.pin_d3 = CAM_PIN_D3,
.pin_d2 = CAM_PIN_D2,
.pin_d1 = CAM_PIN_D1,
.pin_d0 = CAM_PIN_D0,
.pin_vsync = CAM_PIN_VSYNC,
.pin_href = CAM_PIN_HREF,
.pin_pclk = CAM_PIN_PCLK,
//XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
.xclk_freq_hz = 20000000,
.ledc_timer = LEDC_TIMER_0,
.ledc_channel = LEDC_CHANNEL_0,
.pixel_format = PIXFORMAT_RGB565, //YUV422,GRAYSCALE,RGB565,JPEG
.frame_size = FRAMESIZE_QVGA, //QQVGA-UXGA, For ESP32, do not use sizes above QVGA when not JPEG. The performance of the ESP32-S series has improved a lot, but JPEG mode always gives better frame rates.
.jpeg_quality = 12, //0-63, for OV series camera sensors, lower number means higher quality
.fb_count = 1, //When jpeg mode is used, if fb_count more than one, the driver will work in continuous mode.
.fb_location = CAMERA_FB_IN_PSRAM,
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
};
staticesp_err_tinit_camera(void)
{
//initialize the cameraesp_err_t err = esp_camera_init(&camera_config);
if (err != ESP_OK)
{
ESP_LOGE(TAG, "Camera Init Failed");
return err;
}
return ESP_OK;
}
#endifvoidapp_main(void)
{
#if ESP_CAMERA_SUPPORTED
if(ESP_OK != init_camera()) {
return;
}
while (1)
{
ESP_LOGI(TAG, "Taking picture...");
camera_fb_t *pic = esp_camera_fb_get();
// use pic->buf to access the imageESP_LOGI(TAG, "Picture taken! Its size was: %zu bytes", pic->len);
esp_camera_fb_return(pic);
vTaskDelay(5000 / portTICK_RATE_MS);
}
#elseESP_LOGE(TAG, "Camera support is not available for this chip");
return;
#endif
}
I am using above code.
ESP-IDF version :- 5.1.2
Board :- Lilgo-t-camera s3 with PSRAM 8MB and FLASH 16MB in build
The above code is giving the below error
E (472) cam_hal: cam_dma_config(301): frame buffer malloc failed
E (478) cam_hal: cam_config(390): cam_dma_config failed
E (484) gdma: gdma_disconnect(234): no peripheral is connected to the channel
E (492) camera: Camera config failed with error 0xffffffff
E (498) example:take_picture: Camera Init Failed
The text was updated successfully, but these errors were encountered:
Checklist
Issue or Suggestion Description
I am using above code.
ESP-IDF version :- 5.1.2
Board :- Lilgo-t-camera s3 with PSRAM 8MB and FLASH 16MB in build
The above code is giving the below error
The text was updated successfully, but these errors were encountered: