How to initializing variable placed in SDRAM

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

How to initializing variable placed in SDRAM

1,267 次查看
jake111
Contributor I

There is a SDRAM on my board,and the SDK example "semc cm7" works which write serveral bytes then read and compare.

I want to place some big arrays to SDRAM,and set configuration in MCUXPresso IDE:

1.Add "Memory details" which region is RAM8

2.Add "Extra linker script input sections" in "Managed Linker Script"

Then declare a variable:

__DATA(RAM8) char test[8] = {1,2,3,4,5,6,7,8};

But the program fails to run to main.It seems the initializing code should be placed before "copy data" code.Then I put the SDRAM initializing code(including Pin,Clock,MPU and SEMC config) after "System_init()"(before copy data code),the read&write test passes.But the variable "test" is not initilalized as {1,2,3,4,5,6,7,8}.

How Can I copy the initializing data to SDRAM just like copying data to SRAM?And Why the program fails to run in the case of I initialize SDRAM after "copy data" code since it is actually not successfully copied to SDRAM?

 

And I've noted that .SCP file may relate to initialize the SDRAM.What is it used for?Do you have any document?

0 项奖励
回复
1 回复

1,200 次查看
jake111
Contributor I

Anybody?

0 项奖励
回复