Quantcast
Channel: EngineerZone: Message List
Viewing all articles
Browse latest Browse all 24339

Re: CrossCore example Project for BF512 that initializes external SDRAM?

$
0
0

Hi Kevin,

I am by no means an expert, but I made this work at one point.

 

The first trick to SDRAM on Blackfins is to know where the RAM ends up, initially.

This can be done by mapping it in the debugger, via the .xml file (I'll attempt to attach one I used for a BF518)

Now you can read and write your SDRAM and find out, where the holes are (if any).

 

I was using a 48LC16M16 RAM, which did not fill out the entire address room, so I got for instance

0x0000000 = 0x0400000

0x0100000 = 0x0500000

0x0200000 = 0x0600000

0x0300000 = 0x0700000

 

So it loops on itself every 0x4000000 bytes.

That ended up with the following mapping for the .ldf file:

 

MEM_SDRAM0_BANK0    { TYPE(RAM) START(0x00000004) END(0x003fffff) WIDTH(8) }
MEM_SDRAM0_BANK1    { TYPE(RAM) START(0x00800000) END(0x00Bfffff) WIDTH(8) }
MEM_SDRAM0_BANK2    { TYPE(RAM) START(0x01000000) END(0x013fffff) WIDTH(8) }
MEM_SDRAM0_BANK3    { TYPE(RAM) START(0x01800000) END(0x01Bfffff) WIDTH(8) }

 

The SDRAM is now working and the linker will not attempt to use the actual banks twice.

You can now run the program in the debugger (this may be obvious to you).

But the SDRAM has to be set up from the program, which can only be done from code running in L1 memory.
For this, there is a specific project, InitCode, which needs to be entered into the ldf file

 

Project Options->Load->Options->Initialization file: C:\.......\Initcode.dxe (equivalent to elfloader.exe -init initcode.dxe)

 

The .xml (attached) to initialize the IDE / debugger on reset via the JTAG

was for me in the custom register definitions of the Custom Resets.xml:

 

<custom-register-reset-definitions>

  <register core="Common" reset-value="0x01A0" name="EBIU_SDRRC"/>

  <register core="Common" reset-value="0x13" name="EBIU_SDBCTL"/>

  <register core="Common" reset-value="0x0091998D" name="EBIU_SDGCTL"/>

</custom-register-reset-definitions>

 

The InitCode.c should be possible to edit to match your RAM.

 

Kent


Viewing all articles
Browse latest Browse all 24339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>