Closed RajatVardam closed 9 months ago
I also had this problem recently on an S3 camera, and I solved it by setting ".fb_location = CAMERA_FB_IN_DRAM".
@RajatVardam :
the code you shared does it solve the problem?
@remibert : i am also receiving the Camera init error.
Yes the issue is solved for me. I am using VS-Code as an editor of choice for programming my esp32-cam with ESP-IDF extension on VS-Code. this problem occurred only because of PSRAM not enabled. the camera click of esp32-cam requires a larger temporary storage area which is why espressif have externally added a PSRAM to the board. So when adding the PSRAM, make sure you add configurations for an external PSRAM since esp32S chip; which comes with esp32-cam module does not in-built have a PSRAM but on the esp32-cam board, they have a PSRAM attached which is actually treated as an external component. the base esp32 also does not have a PSRAM neither on board, nor on the esp32S chip which is attached on it.
This issue appears to be stale. Please close it if its no longer valid.
I am using esp-idf on VS Code. My hardware unit is an esp32 cam from espressif. the camera module is OV 2640.
I am running in the following problem: E (539) cam_hal: cam_dma_config(300): frame buffer malloc failed E (549) cam_hal: cam_config(384): cam_dma_config failed E (549) camera: Camera config failed with error 0xffffffff E (559) Camera: Camera Init Failed
I changed my hardware 3 times. each time it runs into same problem.
my esp-idf version I am using is 5.1
I am using your example code only:
/**
// =============================== SETUP ======================================
// 1. Board setup (Uncomment): // #define BOARD_WROVER_KIT // #define BOARD_ESP32CAM_AITHINKER
/**
/**
// ================================ CODE ======================================
include
include
include
include <sys/param.h>
include
include "freertos/FreeRTOS.h"
include "freertos/task.h"
// support IDF 5.x
ifndef portTICK_RATE_MS
define portTICK_RATE_MS portTICK_PERIOD_MS
endif
include "esp_camera.h"
define BOARD_ESP32CAM_AITHINKER 1
// WROVER-KIT PIN Map
ifdef BOARD_WROVER_KIT
define CAM_PIN_PWDN -1 //power down is not used
define CAM_PIN_RESET -1 //software reset will be performed
define CAM_PIN_XCLK 21
define CAM_PIN_SIOD 26
define CAM_PIN_SIOC 27
define CAM_PIN_D7 35
define CAM_PIN_D6 34
define CAM_PIN_D5 39
define CAM_PIN_D4 36
define CAM_PIN_D3 19
define CAM_PIN_D2 18
define CAM_PIN_D1 5
define CAM_PIN_D0 4
define CAM_PIN_VSYNC 25
define CAM_PIN_HREF 23
define CAM_PIN_PCLK 22
endif
// ESP32Cam (AiThinker) PIN Map
ifdef BOARD_ESP32CAM_AITHINKER
define CAM_PIN_PWDN 32
define CAM_PIN_RESET -1 //software reset will be performed
define CAM_PIN_XCLK 0
define CAM_PIN_SIOD 26
define CAM_PIN_SIOC 27
define CAM_PIN_D7 35
define CAM_PIN_D6 34
define CAM_PIN_D5 39
define CAM_PIN_D4 36
define CAM_PIN_D3 21
define CAM_PIN_D2 19
define CAM_PIN_D1 18
define CAM_PIN_D0 5
define CAM_PIN_VSYNC 25
define CAM_PIN_HREF 23
define CAM_PIN_PCLK 22
endif
static const char *TAG = "example:take_picture";
if ESP_CAMERA_SUPPORTED
static camera_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,
};
static esp_err_t init_camera(void) { //initialize the camera esp_err_t err = esp_camera_init(&camera_config); if (err != ESP_OK) { ESP_LOGE(TAG, "Camera Init Failed"); return err; }
}
endif
void app_main(void) {
if ESP_CAMERA_SUPPORTED
else
endif
}