Out of Memory with MFS

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

Out of Memory with MFS

跳至解决方案
2,005 次查看
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...

标签 (1)
0 项奖励
回复
1 解答
1,563 次查看
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 项奖励
回复
5 回复数
1,563 次查看
naftalir
Contributor III

Few important notes about my project:

  • Im using Sandisk Micro SD-Card, SDHC 16GB, Class10
  • 64K Allocation Unit
0 项奖励
回复
1,563 次查看
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 项奖励
回复
1,564 次查看
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 项奖励
回复
1,563 次查看
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 项奖励
回复
1,563 次查看
naftalir
Contributor III

Thank you for your information :smileyhappy:

0 项奖励
回复