esp camera 配置为JPEG输出格式出现问题
Posted: Mon Mar 11, 2024 11:03 am
初始化代码:
报错信息如下:
函数中有递归实现:
想知道究竟是什么原因
Code: Select all
app_camera_init(PIXFORMAT_JPEG, FRAMESIZE_96X96, 1);
经过检查,发现W (6535) cam_hal: NO-EOI
W (6737) cam_hal: FB-OVF
W (6737) cam_hal: FB-OVF
W (6737) cam_hal: NO-EOI
W (6939) cam_hal: FB-OVF
W (6940) cam_hal: FB-OVF
***ERROR*** A stack overflow in task cam_task has been detected.
Backtrace:0x40375df6:0x3fce23400x40381be9:0x3fce2360 0x40384b32:0x3fce2380 0x403838fb:0x3fce2400 0x40381ca4:0x3fce2420 0x40381c9a:0x00000000 |<-CORRUPTED
0x40375df6: panic_abort at /home/don/esp/esp-idf/components/esp_system/panic.c:402
0x40381be9: esp_system_abort at /home/don/esp/esp-idf/components/esp_system/esp_system.c:121
0x40384b32: vApplicationStackOverflowHook at /home/don/esp/esp-idf/components/freertos/port/xtensa/port.c:394
0x403838fb: vTaskSwitchContext at /home/don/esp/esp-idf/components/freertos/tasks.c:3506
0x40381ca4: _frxt_dispatch at /home/don/esp/esp-idf/components/freertos/port/xtensa/portasm.S:436
0x40381c9a: _frxt_int_exit at /home/don/esp/esp-idf/components/freertos/port/xtensa/portasm.S:231
Code: Select all
camera_fb_t* esp_camera_fb_get(void);
Code: Select all
int offset_e = cam_verify_jpeg_eoi(dma_buffer->buf, dma_buffer->len);
if (offset_e >= 0) {
// adjust buffer length
dma_buffer->len = offset_e + sizeof(JPEG_EOI_MARKER);
return dma_buffer;
} else {
ESP_LOGW(TAG, "NO-EOI");
cam_give(dma_buffer);
TickType_t ticks_spent = xTaskGetTickCount() - start;
if (ticks_spent >= timeout) {
return NULL; /* We are out of time */
}
return cam_take(timeout - ticks_spent);//recurse!!!!
}