prusa3d / Prusa-Firmware-ESP32-Cam

Firmware for ESP32 Cam modules to be used in Prusa Connect
GNU General Public License v3.0
97 stars 10 forks source link

ESP32 Reset continuously after flashing #13

Open Airforc opened 1 month ago

Airforc commented 1 month ago

Flashed my ESP32 cam board (with OV2640 and the correct pinout for the programmer), also set to 'erase all flash prior to upload'.

After flashing board, board service AP becomes somewhat unstable, serial commands do work but MCU appears to be in reboot loop.

CPU reset reason is SW_CPU_RESET, but looks like camera init failed with error 105. I have gotten the camera to show up with an image before, and I have checked the connection of the ribbon cable to the board.

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:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
----------------------------------------------------------------
Start MCU!
Prusa ESP32-cam https://prusa3d.cz
SW Version: 1.0.1
Build: May  6 2024 16:17:04
----------------------------------------------------------------
Init Logs library
Start init micro-SD Card
E (505) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (506) vfs_fat_sdmmc: sdmmc_card_init failed (0x107).
SD Card Mount Failed
Micro-SD card not found! Disable logs
0000-00-00_00-00-00 - Init system lib
0000-00-00_00-00-00 - CPU reset reason: Software reset via esp_restart
0000-00-00_00-00-00 - CPU0 reset reason: SW_CPU_RESET
0000-00-00_00-00-00 - CPU1 reset reason: SW_CPU_RESET
0000-00-00_00-00-00 - MCU Temperature: 53.33 *C
0000-00-00_00-00-00 - Internal Total heap: 263880 ,internal Free Heap: 238052
0000-00-00_00-00-00 - SPIRam Total heap: 4192107 ,SPIRam Free Heap: 4191847
0000-00-00_00-00-00 - ChipRevision: 1 ,Cpu Freq: 240 ,SDK Version: v4.4.5
0000-00-00_00-00-00 - Flash Size: 4194304 ,Flash Speed 80000000
0000-00-00_00-00-00 - PSRAM is used.
0000-00-00_00-00-00 - malloc/new is not using SPIRAM
0000-00-00_00-00-00 - Init cfg module: 371
0000-00-00_00-00-00 - Read FirstMcuStart: 
0000-00-00_00-00-00 - It's not first start MCU: 15
0000-00-00_00-00-00 - web auth enable: 0
0000-00-00_00-00-00 - web auth user: admin
0000-00-00_00-00-00 - web auth pass: ******
0000-00-00_00-00-00 - Load camera CFG from EEPROM
0000-00-00_00-00-00 - Photo quality: 10
0000-00-00_00-00-00 - Framesize: 0
0000-00-00_00-00-00 - Framesize: 0
0000-00-00_00-00-00 - brightness: 0
0000-00-00_00-00-00 - contrast: 0
0000-00-00_00-00-00 - saturation: 0
0000-00-00_00-00-00 - awb: 1
0000-00-00_00-00-00 - awb_gain: 1
0000-00-00_00-00-00 - awb_mode: 0
0000-00-00_00-00-00 - aec2: 0
0000-00-00_00-00-00 - ae_level: 0
0000-00-00_00-00-00 - aec_value: 300
0000-00-00_00-00-00 - gain_ctrl: 1
0000-00-00_00-00-00 - agc_gain: 0
0000-00-00_00-00-00 - bpc: 1
0000-00-00_00-00-00 - wpc: 1
0000-00-00_00-00-00 - raw_gama: 1
0000-00-00_00-00-00 - hmirror: 0
0000-00-00_00-00-00 - vflip: 0
0000-00-00_00-00-00 - lensc: 1
0000-00-00_00-00-00 - exposure_ctrl: 1
0000-00-00_00-00-00 - Camera flash: 0
0000-00-00_00-00-00 - Camera flash time: 200
0000-00-00_00-00-00 - Load PrusaConnect CFG from EEPROM
0000-00-00_00-00-00 - Token: *
0000-00-00_00-00-00 - Fingerprint: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0000-00-00_00-00-00 - Refresh interval: 30
0000-00-00_00-00-00 - PrusaConnect hostname: connect.prusa3d.com
0000-00-00_00-00-00 - SSID: XXX
0000-00-00_00-00-00 - WiFi password: ***********
0000-00-00_00-00-00 - mDNS: prusa-esp32cam
0000-00-00_00-00-00 - WiFi MAC: 24:6F:28:88:30:E8
0000-00-00_00-00-00 - Service AP SSID: ESP32_camera_136.48.232
0000-00-00_00-00-00 - Set WiFi AP mode
0000-00-00_00-00-00 - WiFi STA start
0000-00-00_00-00-00 - WiFi AP start
0000-00-00_00-00-00 - Service IP Address: http://192.168.0.1
0000-00-00_00-00-00 - Scan WI-FI networks
0000-00-00_00-00-00 - Check available WI-FI network: 
0000-00-00_00-00-00 - WiFi networks scan done
0000-00-00_00-00-00 - 6 networks found
0000-00-00_00-00-00 - Nr | SSID                             | RSSI | CH | BSSID             | Encryption
0000-00-00_00-00-00 -  1 | XXXXXXXXX                 |  -68 |  1 | XXX | WPA2
0000-00-00_00-00-00 -  2 | XXXXXXXXX                 |  -69 |  1 | XXX | WPA2
0000-00-00_00-00-00 - SSID:  not found
0000-00-00_00-00-00 - Starting mDNS record: http://prusa-esp32cam.local
0000-00-00_00-00-00 - Starting mDNS OK
0000-00-00_00-00-00 - Init camera lib
0000-00-00_00-00-00 - Init GPIO
0000-00-00_00-00-00 - Init camera module
E (7582) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
0000-00-00_00-00-00 - Camera init failed. Error: 105
0000-00-00_00-00-00 - Reset ESP32-cam!
0000-00-00_00-00-00 - WiFi STA stop
0000-00-00_00-00-00 - WiFi AP stop
ets Jun  8 2016 00:22:57
johnyHV commented 1 month ago

Hello @Airforc .

You're having an issue with the camera module. In 90% of cases, if there's an issue with initializing the camera, restarting the MCU helps. However, in your case, restarting the MCU doesn't seem to help. Try disconnecting the camera and reconnecting it. Check the correct insertion of the wires from the camera into the connector on the main board.

E (7582) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
0000-00-00_00-00-00 - Camera init failed. Error: 105
0000-00-00_00-00-00 - Reset ESP32-cam!
bin101 commented 1 month ago

Hi @johnyHV,

I get a similar error:

0000-00-00_00-00-00 - Init camera lib
0000-00-00_00-00-00 - Init GPIO
0000-00-00_00-00-00 - Init camera module
E (9312) cam_hal: cam_dma_config(301): frame buffer malloc failed
E (9312) cam_hal: cam_config(385): cam_dma_config failed
E (9312) camera: Camera config failed with error 0xffffffff
0000-00-00_00-00-00 - Camera init failed. Error: ffffffff
0000-00-00_00-00-00 - Reset ESP32-cam!
0000-00-00_00-00-00 - WiFi STA stop
0000-00-00_00-00-ets Jul 29 2019 12:21:46

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:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
E (342) psram: PSRAM ID read error: 0xffffffff

After reading this : https://github.com/espressif/arduino-esp32/issues/6209#issuecomment-1168979160 I think my psram is faulty. I got the module fresh in my mailbox today. Is there anything I can do or just RMA the module?

This is the module I ordered: https://www.amazon.de/dp/B0CXXYGNL4

mozgy commented 1 month ago

try few more things -

bin101 commented 1 month ago

@mozgy I can get the camera to work with the example: #define CAMERA_MODEL_AI_THINKER

But even in the example project I get the PSRAM read error:

rst:0x1 (POWERON_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:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
E (539) esp_core_dump_flash:��ɕ�dump partition found!
E (539) esp_core_dump_flash: No core dump partition found!
E (362) psram: PSRAM ID read error: 0xffffffff

.
WiFi connected
Camera Ready! Use 'http://192.168.10.14' to connect
bin101 commented 1 month ago

@mozgy @johnyHV Found my issue.

My Programmer had a solder bridge which bridged 3.3V and IO16 (PSRAM) on the MCU... So PSRAM wasn't detected. But this means the PSRAM check seems to be faulty here.

johnyHV commented 1 month ago

@bin101 this is strange issue. Do you have a photo ?

bin101 commented 1 month ago

@johnyHV of the solder bridge? This was just a hardware issue from a bad manufactured programmer board. edit: Untitled Those marked pins were bridged

cwylie11 commented 4 weeks ago

Had this same issue! Mine was on the MCU side. The solder was so thick between 3.3V and I16 that I thought it was actually intentional.

Thanks for the fix, it all works great now!