esp camera 无法重新配置初始化
Posted: Thu Mar 21, 2024 2:05 am
现在我要实现一个功能:
1. esp-camera默认配置为低分辨率的RGB565格式,然后将采集到的摄像头数据显示在屏幕上
2. 按下按键,摄像头配置为最大分辨率的JPEG格式,然后将采集到的图片保存在TF卡中
问题:当重新配置摄像头时,发生panic错误
报错信息:
出错代码:
测试设备信息:
- idf v4.4
- OV2640
- esp-camera v2.0.8
是否是因为esp-camera目前不支持 重新在配置?
1. esp-camera默认配置为低分辨率的RGB565格式,然后将采集到的摄像头数据显示在屏幕上
2. 按下按键,摄像头配置为最大分辨率的JPEG格式,然后将采集到的图片保存在TF卡中
问题:当重新配置摄像头时,发生panic错误
报错信息:
Code: Select all
E (3464) gdma: gdma_disconnect(278): no peripheral is connected to the channel
I (3465) s3 ll_cam: DMA Channel=1
I (3465) cam_hal: cam init ok
I (3469) sccb: pin_sda 4 pin_scl 5
I (3473) sccb: sccb_i2c_port=1
I (3488) camera: Detected camera at address=0x30
I (3491) camera: Detected OV2640 camera
I (3491) camera: Camera PID=0x26 VER=0x42 MIDL=0x7f MIDH=0xa2
I (3567) cam_hal: buffer_size: 384000, half_buffer_size: 1024, node_buffer_size: 1024, node_cnt: 375, total_
cnt: 375
I (3568) cam_hal: Allocating 384016 Byte frame buffer in PSRAM
I (3574) cam_hal: Frame[0]: Offset: 16, Addr: 0x3D807400
I (3581) cam_hal: cam config ok
I (3584) ov2640: Set PLL: clk_2x: 0, clk_div: 0, pclk_auto: 0, pclk_div: 12
I (3668) ov2640: Set PLL: clk_2x: 0, clk_div: 0, pclk_auto: 0, pclk_div: 8
W (3669) cam_hal: NO-SOI
W (3777) cam_hal: NO-SOI
W (3802) cam_hal: NO-SOI
W (3827) cam_hal: NO-SOI
W (3852) cam_hal: NO-SOI
W (3877) cam_hal: NO-SOI
W (3902) cam_hal: NO-SOI
W (3927) cam_hal: NO-SOI
W (3952) cam_hal: NO-SOI
W (3977) cam_hal: NO-SOI
W (4002) cam_hal: NO-SOI
W (4027) cam_hal: NO-SOI
W (4052) cam_hal: NO-SOI
W (4077) cam_hal: NO-SOI
W (4102) cam_hal: NO-SOI
W (4127) cam_hal: NO-SOI
W (4152) cam_hal: NO-SOI
W (4177) cam_hal: NO-SOI
W (4202) cam_hal: NO-SOI
W (4227) cam_hal: NO-SOI
W (4252) cam_hal: NO-SOI
W (4277) cam_hal: NO-SOI
W (4302) cam_hal: NO-SOI
W (4327) cam_hal: NO-SOI
W (4352) cam_hal: NO-SOI
W (4376) cam_hal: NO-SOI
W (4401) cam_hal: NO-SOI
W (4426) cam_hal: NO-SOI
W (4451) cam_hal: NO-SOI
***ERROR*** A stack overflow in task cam_task has been detected.
Backtrace:0x40375c56:0x3fce91e00x40382089:0x3fce9200 0x4038501e:0x3fce9220 0x40383d9b:0x3fce92a0 0x40382144:
0x3fce92c0 0x4038213a:0x00000000 |<-CORRUPTED
0x40375c56: panic_abort at /home/don/esp/esp-idf/components/esp_system/panic.c:402
0x40382089: esp_system_abort at /home/don/esp/esp-idf/components/esp_system/esp_system.c:121
0x4038501e: vApplicationStackOverflowHook at /home/don/esp/esp-idf/components/freertos/port/xtensa/port.c:39
4
0x40383d9b: vTaskSwitchContext at /home/don/esp/esp-idf/components/freertos/tasks.c:3554
0x40382144: _frxt_dispatch at /home/don/esp/esp-idf/components/freertos/port/xtensa/portasm.S:436
0x4038213a: _frxt_int_exit at /home/don/esp/esp-idf/components/freertos/port/xtensa/portasm.S:231
Code: Select all
// 按下按键,唤醒用于保存图像的task
if (xQueueReceive(queue_i, &key, 0))
{
camera_fb_t *jpg_fb = NULL;
xSemaphoreTake(fbmutex, portMAX_DELAY);
esp_camera_deinit();
camera_init(PIXFORMAT_JPEG, FRAMESIZE_UXGA, 1);
jpg_fb = esp_camera_fb_get();
// TODO: save_image(jpg_fb);
esp_camera_fb_return(jpg_fb);
esp_camera_deinit();
camera_init(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2);
xSemaphoreGive(fbmutex);
}
- idf v4.4
- OV2640
- esp-camera v2.0.8
是否是因为esp-camera目前不支持 重新在配置?