Skip to content

ESP32-P4 SC2336 Camera isn't working on Function EV Board (AEGHB-1294) #53

@caiotoledo-lunasystems

Description

@caiotoledo-lunasystems

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

Camera SC2336 working properly on ESP32-P4 Function EV Board.

Actual behavior (suspected bug)

I have created my own application which was working fine that used the following code using the esp_video component:
cam_task.c

Later I created my own code to write to SC2336 registers directly and using the Camera Controller driver from Espressif:
cam_sc2336_config.c
cam_task_new.c
Which didn't work as I'm still developing it.

However when I went back to use the previous code cam_task.c I'm getting a crash on the isp_task:

Guru Meditation Error: Core  0 panic'ed (Stack protection fault). 

Detected in task "isp_task" at 0x4ff12f52
--- 0x4ff12f52: abort at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/abort.c:15
Stack pointer: 0x4ff19070
Stack bounds: 0x4ff190b0 - 0x4ff196b0


Core  0 register dump:
MEPC    : 0x4ff12f62  RA      : 0x4ff012a8  SP      : 0x4ff19070  GP      : 0x4ff16180  
--- Stack dump detected
--- 0x4ff12f62: abort at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/abort.c:15
--- 0x4ff012a8: _lock_init_recursive at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/locks.c:91
TP      : 0x48002220  T0      : 0x00000fff  T1      : 0x0000000e  T2      : 0x00000000  
S0/FP   : 0x4ff1909c  S1      : 0x4ff1cce0  A0      : 0x4ff1909c  A1      : 0x00000000  
A2      : 0x00000032  A3      : 0x7f000000  A4      : 0x3f000000  A5      : 0x00000004  
A6      : 0x4ff18d80  A7      : 0x00000000  S2      : 0x00000004  S3      : 0xffffffff  
S4      : 0x400e5000  S5      : 0x00000000  S6      : 0x0000000d  S7      : 0x400e8000  
S8      : 0x400e8000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x00000000  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x00000000  
MSTATUS : 0x00001880  MTVEC   : 0x4ff00003  MCAUSE  : 0x0000001b  MTVAL   : 0x00000000  
--- 0x4ff00003: _vector_table at ??:?
MHARTID : 0x00000000  


--- Backtrace:


add symbol table from file "/mnt/ExtraStorage/LunaSystems/ESP32-P4/example/esp32-p4-wifi-test/.build/bootloader/bootloader.elf"
0x4ff12f62 in abort () at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/abort.c:15
15      {
#0  0x4ff12f62 in abort () at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/abort.c:15
#1  0x4ff012a8 in lock_init_generic (lock=<optimized out>, mutex_type=<optimized out>) at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/locks.c:77
#2  lock_acquire_generic (lock=lock@entry=0x4ff1912c <xIsrStack+124>, delay=delay@entry=4294967295, mutex_type=mutex_type@entry=4 '\004') at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/locks.c:133
#3  0x4ff0155c in _lock_acquire_recursive (lock=0x4ff1912c <xIsrStack+124>) at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/locks.c:174
#4  __retarget_lock_acquire_recursive (lock=<optimized out>) at /mnt/ExtraStorage/LunaSystems/esp/esp-idf/components/newlib/src/locks.c:333
#5  0x400b3cc6 in _vfprintf_r (data=0x4ff3324c, fp=0x4ff1cb40, fmt0=0x400e9718 "", ap=<optimized out>) at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/vfprintf.c:846
#6  0x00000000 in ?? ()
Backtrace stopped: frame did not save the PC



ELF file SHA256: 4fb6ad3ab

Error logs or terminal output

Steps to reproduce the behavior

  1. Run code with cam_task.c
  2. See the crash.

Project release version

v5.5.1

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Ubuntu 24.04

Shell

Bash

Additional context

At first I was considering that I wrote a wrong value on SC2336 register, which is very likely, but I see that the chip ID is identified still, but the ISP Task from ESP32-P4 shows a crash.

I couldn't find the SC2336's documetation to perhaps factory reset it, but the sensor seems to be working correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions