We are using Camera.getimage(...)
to save JPEG images, and everything works normally under standard conditions.
However, after the system enters deep sleep and wakes up once via GPA2, the generated JPEG files become unreadable on a PC.
Upon inspection, it appears that the JPEG header region (approximately from offset 0x20 to 0x267) contains incorrect data.
This issue persists even after a board reset or power cycle; only re-flashing the firmware can restore the image capture functionality.
Hi @Howard,
Which SDK version are you using?
Do you have a sample code for us to replicate?
Thank you.
Dear @Kelvin_Huang,
The attached file demonstrates a simple example:
Upon power-up, the system captures a snapshot and saves it as image_firstboot.jpg
, then enters deep sleep.
When Pin21 is connected to VDD33 using a Dupont wire, the system wakes up and captures another image as image.jpg
.
If the reset button is pressed, the system will capture a new image again and overwrite image.jpg
.
The file image_firstboot.jpg
can be opened and displayed normally. However, image.jpg
always has a header issue and cannot be properly displayed.
Thanks.
SDCardSaveJPEGWwithDeepSleep.7z (83.5 KB)
SDK version is 4.0.9-build20250325
Dear @Kelvin_Huang
I would like to confirm whether the issue can be reproduced using the sample I provided.
Please let me know if there is anything further I should provide on my side.
Hi @Howard,
I have seen your code, and reproduced it. Please give me some more time to take a look at this issue.
Thank you.
Hi @Howard,
It seems like this behavior is caused by using the writeword API. You may want to debug further from there. Maybe the flow needs to be changed.
sample.zip (1.3 KB).
Thank you.
Dear @Kelvin_Huang ,
Thanks for your reply, I will check that API.