Hello,
I tried the sample on the MXRT1064 EVK board in IDE. The picture named as 000.jpg is stored in SD card .
However, failure occured as the code:
// Open file to check
error = f_open(&jpgFil, _T("/000.jpg"), FA_OPEN_EXISTING);
if (error != FR_OK)
{
PRINTF("No demo jpeg file!\r\n");
return -4;}
Is there any idea for the possible reason?
Thanks!
解決済! 解決策の投稿を見る。
Hi,
Please refer to AN12110, the application is same as yours. It has software package. You can use its code almost directly.
Regards,
Jing
Hi nanjun,
I test the example from SDK v2.9.1. It works fine. So, please
1. use the most update SDK;
2. Please refer to the readme in the project to set the environment;
3. There is a pics.zip in the project. Please unzip this zip file to SD card.
Regards,
Jing
Hello Jing,
thanks for your kind reply.
The error was removed via modifying the configuration of the SD-Card.
In this application, i.MX RT1064 EVK is used to capture the camera data and sends it to LCD-Display.They work fine.
However, the JPG data written into SD Card cannot be opened properly, which shows "IMG_0001.JPG this data cannot be opened"
All data share a same size of 128 KB and the resolution of camera is set to 272x480.
Where could the error come from?
Hi nanjun,
Is the jpeg file is generate by system? Can this file be opened by computer? Can you send me the file?
Regards,
Jing
Hello Jing,
attached you find the file. Please extract it from zip.
A piece of code is shown here:
The upper part is copied from csi_rgb565.c, which reads the data from camera and transfers it to LCD.
The last line is referenced by the AN12110.
/* Wait to get the full frame buffer to show**** */
while (kStatus_Success != CAMERA_RECEIVER_GetFullBuffer(&cameraReceiver, &cameraReceivedFrameAddr))
{
}
/* Wait for the previous frame buffer is shown. */
while (s_newFrameShown == false)
{
}
g_dc.ops->setFrameBuffer(&g_dc, 0, (void *)cameraReceivedFrameAddr);
/***********************************************************/
JpegCompress(cameraReceivedFrameAddr);
Thanks!
Hello Jing,
I tried to copy the file from SD card but it came to error 0x80070570.
Only after repairing the SD card, these files can be copied but it seems that all the data coming from compressing are formatted during this repairng process. Attached shows the property of these 128 Byte data. (Sorry for the language in German)
The sd card should be no problem with normal reading and writing since 000.jpg is written to the card and is read by the code before goting further to compressing.
Hi,
Do you mean file system in RT1064 cause SD crash when create new image file? Can you send me your project?
Regards,
Jing
Hi,
Please refer to AN12110, the application is same as yours. It has software package. You can use its code almost directly.
Regards,
Jing
Hi Jing,
Thank you for your help by multiple times.I will try to configure this in IAR.
I wish you have a nice day!
Kind regards,
Nanjun