if CONFIG_CAMERA_MODULE_ESP_EYE || CONFIG_CAMERA_MODULE_ESP32_CAM_BOARD
/* IO13, IO14 is designed for JTAG by default,
* to use it as generalized input,
* firstly declair it as pullup input */
gpio_config_t conf;
conf.mode = GPIO_MODE_INPUT;
conf.pull_up_en = GPIO_PULLUP_ENABLE;
conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
conf.intr_type = GPIO_INTR_DISABLE;
conf.pin_bit_mask = 1LL << 13;
gpio_config(&conf);
conf.pin_bit_mask = 1LL << 14;
gpio_config(&conf);
我在适配一个新的CIS,这颗输出的格式是raw,大小为480*270,所以dma node size 为2880,图片fb_size为129600,程序将它计算为9次拷贝,一次的大小为14400,我在esp32-camera的基础上修改了很多内容,目前的问题是出在cam_hal中的cam_task,程序期待的是有9次IN_SUC_EOF中断,但是每次只收到8次,也就是在came_task中只拷贝了8次,所以得到的大小为115200(离正确的129600差14400),测量过sensor的波形,其pclk为6.4MHZ,一共有270个行同步信号,每个行同步信号内有480个pclk信号. 我使用的是esp32s3-eye,主程序如下: `extern "C" void app_main() {
if CONFIG_CAMERA_MODULE_ESP_EYE || CONFIG_CAMERA_MODULE_ESP32_CAM_BOARD
endif
}`
为了进一步调试,我修改了cam_hal中的buf_size检查,将尺寸不合规的frame的en也置为0,得到了如下输出:
I (00:00:09.711) cam_hal: FB-SIZE: 115200 != 129600 W (00:00:09.712) example:take_picture: pic addr: 0x3d8009c8 W (00:00:09.712) example:take_picture: Picture taken! Its size was: 115200 bytes W (00:00:09.712) example:take_picture: Taking picture... I (00:00:09.741) cam_hal: FB-SIZE: 115200 != 129600 W (00:00:09.741) example:take_picture: pic addr: 0x3d82040c W (00:00:09.741) example:take_picture: Picture taken! Its size was: 115200 bytes W (00:00:09.742) example:take_picture: Taking picture... I (00:00:09.770) cam_hal: FB-SIZE: 115200 != 129600 W (00:00:09.770) example:take_picture: pic addr: 0x3d8009c8 W (00:00:09.771) example:take_picture: Picture taken! Its size was: 115200 bytes W (00:00:09.771) example:take_picture: Taking picture... I (00:00:09.799) cam_hal: FB-SIZE: 115200 != 129600
看起来像最后一个包的时候,程序还没来得及读到14400个字节,v信号就来了。实在想不出来问题出在哪。 当程序运行到这一行时的cam_obj:
frame_buffer_event->len += ll_cam_memcpy(cam_obj, &frame_buffer_event->buf[frame_buffer_event->len], &cam_obj->dma_buffer[(cnt % cam_obj->dma_half_buffer_cnt) * cam_obj->dma_half_buffer_size], cam_obj->dma_half_buffer_size);