SDCardSaveJPEGTimelapse Example Saves 0KB Images

I used the SDCardSaveJPEGTimelapse example program, but the images saved to the SD card are all 0KB.

It seems that Camera.getImage(CHANNEL, &img_addr, &img_len); cannot read the photos there.

I’m certain the CAMERA is functioning properly because it can perform object detection.

can’t find the reason at all…

Hi @Clay, i had tried on my side it seems to be working fine, however If the picture files shows 0kb then the pictures might have not properly moved/copied to the sd card. You may check on your sd card whether is working or remove and reinsert to AMB pro2. Thanks.

thank you for your reply.

The SD card is working fine, and I have monitored that img_len is always equal to 0, which is why I suspect there is an issue with Camera.getImage.

Below are the messages I printed

11:56:47.666 → Build @ 15:49:32, Nov 11 2024

11:56:47.666 →

11:56:47.666 → $8735b>[video_voe_presetting] fps:30 w:1920 h:1080

11:56:47.666 → fwin(1),enc_en(0),IQ_OFFSET = 0x17b60

11:56:47.666 → fwin(1),enc_en(0),SENSOR_OFFSET = 0x2fba0

11:56:47.666 → sensor id 1 iq_data 17b60 sensor_data 2fba0

11:56:47.666 → VOE not init

11:56:47.666 → VOE_OUT_CMD type 2 command fail -1

11:56:47.666 → hal_voe_ready 0x0 0x1718

11:56:47.666 → sensor timestamp: 2024/09/12

11:56:47.699 → iq timestamp: 2023/05/15 14:48:54

11:56:47.699 → The fcs setup is finished

11:56:47.699 → [VOE]load time sensor:254us iq:4587us itcm:1018us dtcm:52us ddr:12134us ddr2:11278us

11:56:47.699 → [VOE]VOELOAD(18045)/FCS(43427)/ISPReady(25836)/FrameDone(59614) KMRST(139438) us

11:56:47.746 → fcs_start_time 62 fcs_voe_time 71 frame_done_time 130

11:56:47.746 → g_enc_buff_size 0 = 2356352

11:56:47.746 → g_enc_buff_size 1 = 1163776

11:56:47.746 → g_enc_buff_size 2 = 8

11:56:47.746 → Register disk driver to Fatfs.

11:56:47.825 → FATFS Register: disk driver 0

11:56:47.825 → SD_Init 0

11:56:47.870 → part_count = 0

Hi @Clay,

Can I check what SDK version are you using? Also what are your options that you set on the Arduino IDE when you compile and upload the example? For example, camera option and is fast camera start enabled?

Thank you.

Thanks for your reply

I am using Arduino 2.3.3

board manager 4.0.8

and

https://github.com/ambiot/ambpro2_arduino/raw/main/Arduino_package/package_realtek_amebapro2_index.json

setup is as follows:

I just compiled it again, and it seems to work now.

Reinstalling the board manager 4.0.8 fixed the issue.

Thank you all! @Kelvin_Huang @KaiFai_Y

2 Likes