No demo jpeg file! with i.MX RT1050 sd_jpeg demo app

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

No demo jpeg file! with i.MX RT1050 sd_jpeg demo app

Jump to solution
2,802 Views
danielc
Contributor II

Hello,

There is one customer wants to build a system using i.MX TRT1050 EVK with 1024 x 600 LCD panel,

they follow the AN12302_i.MX RT eLCDIF RGB Mode Use Case to modify the "sd_jpeg" demo app from MCUXpresso SDK. the 480x272 JPEG file can be showed on the display panel, but they get the buffer error when using the 1024 x600 JPEG file.

The attachment was provided by customer.

Could you please provide your suggestion about it? Thanks.

Regards,

Daniel

0 Kudos
1 Solution
2,530 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel Chiu,

Thanks for your reply.
Please follow the below steps to modify the heap placement to increase its size.

pastedImage_1.png

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

14 Replies
2,530 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel Chiu,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
Actually, I'm still not very clear with the 'error' you mention according to the attachment, I was wondering if you can introduce the phenomenon in details and it can help me figure it out.
Looking forward to your reply.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
2,530 Views
danielc
Contributor II

Hi Jeremy,

   The customer uses MCUXpresso SDK/demo_apps/sd_jpeg in his project,  customer put his jpeg files(1024x600) into SD card, when open the jpeg file(f_open) , the app will be terminated by assert(buffer); statement, does customer need to modify any configuration? Thanks.

status_t SD_ReadBlocks(sd_card_t *card, uint8_t *buffer, uint32_t startBlock, uint32_t blockCount)
{
assert(card);
assert(buffer);
assert(blockCount);
assert((blockCount + startBlock) <= card->blockCount);

Buffer_Error.PNG

Regards,

Daniel

0 Kudos
2,531 Views
danielc
Contributor II

Hi Jeremy,

In the eLCDIF demo app(sd_jpeg), Does it use "AT_NONCACHEABLE_SECTION" macron to define L1 cache as the jpeg file buffer?

Regards,

Daniel

0 Kudos
2,531 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel Chiu,

Thanks for your reply.
1)  Does it use "AT_NONCACHEABLE_SECTION" macron to define L1 cache as the jpeg file buffer?
-- No, please see the memory attribution by reviewing the BOARD_ConfigMPU().
The issue is caused by stack overflow, it happens when applying for the space for jpg_buf, the jpg_size exceeds the heap stack size.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
2,531 Views
danielc
Contributor II

Hi Jeremy,

Thanks for your explanation.

The message "No demo jpeg file!", it seems from  MOUNT_SDCard() function when opening the jpeg file to check.

could you please help to check it?

// 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;
}

Regards,

Daniel

0 Kudos
2,531 Views
danielc
Contributor II

Hi Jeremy,

Yes, the SD card using is FAT32 format follow the readme.txt file.

but f_open() return error when open the JPEG file.

Could you help to check sd_jpeg demo with the attached aaa.jpg? Thanks.

// 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;
}

aaa.jpg

Regards,

Daniel

0 Kudos
2,531 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel Chiu,

Thanks for your reply.

Accord the code, the name of JPEG file should be 000.jpg, however, the attached pictures name is aaa.jpg, I think you should ensure the names are consistent.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
2,531 Views
ray_deng
Contributor II

Hi Jeremy,

  I found I can debug this example successful, but when run on EVK separately, it also report '-4' error. Can you help to advice?

  BTW, if modify to larger pixel screen, eg. 800x480, how to improve the picture refresh rate? it seems too slow to ruan larger pictures.

BRs, 

Ray

0 Kudos
2,531 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ray deng,

Thanks for your reply.
Regarding your question, I'd like to suggest you create a  new thread, then send me the link.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
2,531 Views
ray_deng
Contributor II

Hi Jeremy,

 Thanks for your kindly help, please check below links,

https://community.nxp.com/message/1255381 

BRs,

Ray

0 Kudos
2,531 Views
danielc
Contributor II

Hi Jeremy,

Yes, you are right.  the 000.jpg can be detected now.

About customer's jpg_size exceeds the heap stack size, could you please suggest how to expand the jpg_buffer? Thanks.

******************************************************************************************

Decoding /000.jpg...

ASSERT ERROR " buffer ": file "../sdmmc/src/fsl_sd.c" Line "1566" function name "SD_ReadBlocks"

******************************************************************************************

Regards,

Daniel

0 Kudos
2,531 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel Chiu,

Thanks for your reply.
Please follow the below steps to modify the heap placement to increase its size.

pastedImage_1.png

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

2,531 Views
danielc
Contributor II

Hi Jeremy,

Thank you very much for your support.

Customer had finished his test by adding the Heap buffer.

Regards,

Daniel

0 Kudos
2,531 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel Chiu,

Thanks for your reply.
Before running the sd_jepg demo, please make sure the SD card you are using is FAT32 format, in addition, the jpg picture has already been in it.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos