Out of Memory with MFS

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

Out of Memory with MFS

Jump to solution
1,044 Views
naftalir
Contributor III

Hi,

I recently get Out of memory and Stack Overflow messages after writing ~50 Files (5MB each) with WRITE_THROUGH, both for MFS and FAT Writing policy.

prior to this error, which get my system to stuck, there is another message in the Debug Log: "Read request from 0x674E17E3 canceled. Area overlaps with uninitialized FlexBus area.

Thank you all for your help...

Labels (1)
0 Kudos
1 Solution
602 Views
naftalir
Contributor III

Well thank you.

it seems that the problem caused by accessing files on sd too frequently using the fopen() and fclose().

solved after loading the file into memory and then writing back to sd, writing only before removal of the sd.

View solution in original post

0 Kudos
5 Replies
602 Views
naftalir
Contributor III

Few important notes about my project:

  • Im using Sandisk Micro SD-Card, SDHC 16GB, Class10
  • 64K Allocation Unit
0 Kudos
602 Views
DavidS
NXP Employee
NXP Employee

Hi Naftalir,

The only adive I can suggest trying is to either increase your task stack size or monitor it to see if it overflows.

If you have TAD (task aware debugging) then halt and look at the heap to see if there is a memory leak and to check stack overflow.

If you do not have TAD, then you can periodically call:

 

void _tad_lightweight_memory_blocks(void)

and

 

void _tad_stack_usage(void)

Both in the PSP->PSP Generic->tad->tad.c

Regards,

David

0 Kudos
603 Views
naftalir
Contributor III

Well thank you.

it seems that the problem caused by accessing files on sd too frequently using the fopen() and fclose().

solved after loading the file into memory and then writing back to sd, writing only before removal of the sd.

0 Kudos
602 Views
DavidS
NXP Employee
NXP Employee

Hi Naftalir,

Ok...that spurs my memory that when doing a fclose() there needed to be a _time_delay() (or other blocking) to allow the MFS and other drivers to sync up properly.   Your solution of using RAM then writing back OK too.

How often were you opening/closing file?

Regards,

David

0 Kudos
602 Views
naftalir
Contributor III

Thank you for your information :smileyhappy:

0 Kudos