sd_jpeg sample failure: No demo jpeg file!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

sd_jpeg sample failure: No demo jpeg file!

Jump to solution
4,533 Views
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 Kudos
Reply
1 Solution
4,439 Views
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

View solution in original post

0 Kudos
Reply
10 Replies
4,523 Views
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 Kudos
Reply
4,513 Views
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 Kudos
Reply
4,499 Views
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 Kudos
Reply
4,485 Views
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 Kudos
Reply
4,479 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

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

 

Regards,

Jing

Tags (1)
0 Kudos
Reply
4,464 Views
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 Kudos
Reply
4,453 Views
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 

Tags (1)
0 Kudos
Reply
4,447 Views
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 Kudos
Reply
4,440 Views
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 Kudos
Reply
4,411 Views
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 Kudos
Reply