Camera init failed with error 0xffffffff

Question/Issue:
I’m trying to use the ESP32 camera from my Edge Impulse model - using the Arduino libraries - with a XIAO ESP32S3 Sense, but now I’m getting the following error when initializing:

Edge Impulse Inferencing Demo
E (1022) cam_hal: cam_dma_config(300): frame buffer malloc failed
E (1023) cam_hal: cam_config(384): cam_dma_config failed
E (1023) camera: Camera config failed with error 0xffffffff
Camera init failed with error 0xffffffff
Failed to initialize Camera!

It works well when using the camera webserver example.

Project ID:
305878

Context/Use case:
Just trying and example

Hi @feiticeir0

By default, the esp32-camera sketch is configured to work with the ESP-EYE. This step is included in our Arduino Library doc:

#define CAMERA_MODEL_ESP_EYE // Has PSRAM

//#define CAMERA_MODEL_AI_THINKER // Has PSRAM

by

//#define CAMERA_MODEL_ESP_EYE // Has PSRAM

#define CAMERA_MODEL_AI_THINKER // Has PSRAM

You can find other camera model pin definitions here.

For the CAMERA_MODEL_XIAO_ESP32S3, the pin definitions in the camera initialization code are as follows:

  • PWDN_GPIO_NUM: -1
  • RESET_GPIO_NUM: -1
  • XCLK_GPIO_NUM: 10
  • SIOD_GPIO_NUM: 40
  • SIOC_GPIO_NUM: 39
  • Y9_GPIO_NUM: 48
  • Y8_GPIO_NUM: 11
  • Y7_GPIO_NUM: 12
  • Y6_GPIO_NUM: 14
  • Y5_GPIO_NUM: 16
  • Y4_GPIO_NUM: 18
  • Y3_GPIO_NUM: 17
  • Y2_GPIO_NUM: 15
  • VSYNC_GPIO_NUM: 38
  • HREF_GPIO_NUM: 47
  • PCLK_GPIO_NUM: 13

Best

Eoin

Hi @Eoin .
I did try those pins - I got them from the camera_pins.h .

And still no luck.
I have 2 of these XIAO and both fail with the same error:

Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x2b (SPI_FAST_FLASH_BOOT)
Saved PC:0x42030b5a
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
Edge Impulse Inferencing Demo
E (109) cam_hal: cam_dma_config(300): frame buffer malloc failed
E (110) cam_hal: cam_config(384): cam_dma_config failed
E (110) camera: Camera config failed with error 0xffffffff
Camera init failed with error 0xffffffff
Failed to initialize Camera!

Don’t know what to do here… :pensive:

1 Like

I finally solve this.
Going through the Arduino IDE option tools for the XIAO_ESP32S3, I found out that the option PSRAM: “OPI PSRAM” was disabled.
As soon that I enabled that option and uploaded the sketch, no more error and inference was going great.

1 Like