sd_jpeg sample failure: No demo jpeg file!

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

sd_jpeg sample failure: No demo jpeg file!

跳至解决方案
4,530 次查看
nanjun
Contributor III

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!

000.jpg

0 项奖励
回复
1 解答
4,436 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Please refer to AN12110, the application is same as yours. It has software package. You can use its code almost directly.

 

Regards,

Jing

在原帖中查看解决方案

0 项奖励
回复
10 回复数
4,520 次查看
jingpan
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
4,510 次查看
nanjun
Contributor III

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?

0 项奖励
回复
4,496 次查看
jingpan
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
4,482 次查看
nanjun
Contributor III

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!

0 项奖励
回复
4,476 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi,

But the size of this image is zero. Please check again.

 

Regards,

Jing

标记 (1)
0 项奖励
回复
4,461 次查看
nanjun
Contributor III

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.

0 项奖励
回复
4,450 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Do you mean file system in RT1064 cause SD crash when create new image file? Can you send me your project?

 

Regards,

Jing 

标记 (1)
0 项奖励
回复
4,444 次查看
nanjun
Contributor III

Hello Jing,

Thanks for your help.

After more tests the the data from compression is not written properly into the SD card.

Attached is the project data.

The status of SDcard mount is checked before going further to compressing.

 

Kind Regards,

Nanjun

0 项奖励
回复
4,437 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Please refer to AN12110, the application is same as yours. It has software package. You can use its code almost directly.

 

Regards,

Jing

0 项奖励
回复
4,408 次查看
nanjun
Contributor III

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

0 项奖励
回复