Arduino-esp32: ESP32-CAM rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) fault

Created on 24 Nov 2019  路  5Comments  路  Source: espressif/arduino-esp32

Hardware:

Board: ESP32-CAM WROVER MODULE
Core Installation/update date: 11/jul/2017
IDE name: ARDUINO 1.8.9
Flash Frequency: 80 MHZ
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10

Description:

I've got newly ESP-32CAM and I programmed it in the office for basically start it, everything was worked properly. Then I came home, and I want to connect it to home wifi, I set up everything for my laptop and I installed same program. Only one thing I know happened, I've connected +5v to directly its 5V pin and board had started to be warm, I realized it and I changed it to 3.3V. After that, I started to get this script on serial monitor.

Sketch:

include "esp_camera.h"

include

include "soc/soc.h" //disable brownour problems

include "soc/rtc_cntl_reg.h" //disable brownour problems

//
// or another board which has PSRAM enabled
//

// Select camera model
//#define CAMERA_MODEL_WROVER_KIT
//#define CAMERA_MODEL_ESP_EYE
//#define CAMERA_MODEL_M5STACK_PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE

define CAMERA_MODEL_AI_THINKER

include "camera_pins.h"

const char* ssid = "ssid";
const char* password = "pwd";

void startCameraServer();

void setup() {

WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();

camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.pixel_format = PIXFORMAT_JPEG;
//init with high specs to pre-allocate larger buffers
if(psramFound()){
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 10;
config.fb_count = 2;
} else {
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 12;
config.fb_count = 1;
}

if defined(CAMERA_MODEL_ESP_EYE)

pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);

endif

// camera init
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
return;
}

sensor_t * s = esp_camera_sensor_get();
//initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1);//flip it back
s->set_brightness(s, 1);//up the blightness just a bit
s->set_saturation(s, -2);//lower the saturation
}
//drop down frame size for higher initial frame rate
s->set_framesize(s, FRAMESIZE_QVGA);

if defined(CAMERA_MODEL_M5STACK_WIDE)

s->set_vflip(s, 1);
s->set_hmirror(s, 1);

endif

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");

startCameraServer();

Serial.print("Camera Ready! Use 'http://");
Serial.print(WiFi.localIP());
Serial.println("' to connect");
}

Originally, properly working code is above, nothing much changed though. Only SSID and SSID PASSWORD changed.

This, I started to get it from the serial monitor:

Debug Messages:

Brownout detector was triggered

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6364
entry 0x400806b8

Any ideas, advice? Thanks for advance.

Most helpful comment

I have found that one of my ESP32 modules had this exact issue, setting the flash frequency to 40MHz instead of 80MHz solved the issue, no more reboots.

All 5 comments

Hi mr. HALIT,

I have the same problem with you.

I use ESP32 Dev KIT, and have a SW_RESET problem on the device.

maybe you need to update the ESP SDK or esptool on the arduino IDE.

see https://github.com/espressif/arduino-esp32/issues/3461

Thanks, problem solved. This link helpful for this issue.
https://randomnerdtutorials.com/esp32-troubleshooting-guide/

I have found that one of my ESP32 modules had this exact issue, setting the flash frequency to 40MHz instead of 80MHz solved the issue, no more reboots.

@Tcoton how do you change 80Mhz to 40Mhz ? any guidance ?

Using Arduino IDE, select the ESP32 Dev Module as a board and a bit below, you will find the Flash Frequency set to 80 MHz by default, set it to 40 MHz and check other settings too. I personally use the following settings on the weirdo ESP32-CAM I have:

Board: ESP32 Dev Module
Upload Speed : 921600 (default)
CPU Frequency: 240MHz (default)
Flash Frequency: 40 MHz
Flash Mode: QIO (default)
Flash size: 4MB (default)
Partition Scheme: Huge APP (3MB No OTA/1MB SPIFFS)
Core Debug Level: None
PSRAM: Enabled

Again, this is specific to my weirdo board and it took me ages to figure why on earth it would not work with any other settings than the Flash Frequency set to 40 MHz, flashing with the AI-Thinker board which offers no settings was making the board to loop reset. The second module I have bought at the very same time at the vey same place did not have this issue at all.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilColbert picture PhilColbert  路  125Comments

jh83 picture jh83  路  124Comments

adamwilt picture adamwilt  路  63Comments

vseven picture vseven  路  150Comments

vshymanskyy picture vshymanskyy  路  105Comments