AnsweredAssumed Answered

Overwriting initialized arrays with large programs

Question asked by MikeSmithCanada on Jun 4, 2009
Latest reply on Jun 4, 2009 by kaushal

I teach Blackfin classes at the University of Calgary. As I place my Blackfin tutorials on the web, I often get questions about Blackfin issues. This is one I recently received.

I will post my resp;onse to this question in a minute, but I did not really resolve the problem. Have asked the emailer to join the Forum

 

Question posed

I need to compile and run a big program in BF531. The linker gives out of memory error in L1_data_a section.
Futhermore when I try to locate big global arrays like

int dummy[100000];

it also gives out of memory error in bsz_L1_data_a section. It is expected for such big arrays.

When I select "Internal SRAM and external SDRAM" option under project options, it successfully compiles and maps some arrays to external SDRAM as expected.

But, program does NOT run correctly because it does NOT initialize some arrays in the SDRAM like the one below;

int dummy[100] = {1, 2, 8, 125, ... etc};

I read ADI's application note EE-240. It mentions about some initializing code for SDRAM but all are in ASM language.

Is there any practical way to initialize SDRAM with project options or compiler directives? Or, should I write an initializing code and link it with my program?

Do you have a C (but not ASM) language example program to compile and/or run big programs in SDRAM?

Outcomes