AnsweredAssumed Answered

Beating my head against a wall with BF538 SDRAM..

Question asked by gmarsh on May 8, 2012

I have an application running on a BF538 EZKIT, which makes use of the board's SDRAM. If I run the application using the Debug Agent emulator built into the EZKIT, SDRAM access works fine. But if I try to make the application boot from the EZKIT's flash, things go awry when I attempt to access the SDRAM.

 

I have initialization code created which initializes the SDRAM configuration registers, which is pointed to under the "load" page in the project configuration. I can tell that this code correctly runs when the board boots, additionally the code configures the PLL and the DSP is running at the correct clock frequency.

 

Here's the SDRAM initialization routine in the initcode:

 

R0.H=0xFFC2;

R0.L=0xFFC2;

[P0+LO(EBIU_AMBCTL0)]=R0;

[P0+LO(EBIU_AMBCTL1)]=R0;

R0=0x00FF;

W[P0+LO(EBIU_AMGCTL)]=R0;

R0=0x03A0;

W[P0+LO(EBIU_SDRRC)]=R0;

R0=0x0025;

W[P0+LO(EBIU_SDBCTL)]=R0;

R0.H=0x8011;

R0.L=0x998D;

[P0+LO(EBIU_SDGCTL)]=R0;

// do dummy read to initialize SDRAM

P0=4;

R0.L=W[P0];

SSYNC;

 

Anyway, when accessing the SDRAM with the board booting from flash, writes seem to fail and the SDRAM always reads 0xFFB0.

 

Another clue is that all of the SDRAM/EBIU registers match between emulator-load and flash-boot scenario, with the exception of EBIU_SDSTAT - when everything's working on the emulator-loaded board, the register reads 0x0009 (before any SDRAM access) and 0x0001 (after SDRAM access). In the flash-boot scenario, EBIU_SDSTAT always reads 0x0019 - indicating that the SDRAM isn't "powered up yet" and the SDEASE error flag is set - and I can't find any documentation on what this flag means.

 

Blackfin silicon revision is 0.4, EZ-KIT Lite version is 1.2.

 

Any ideas? Thanks for any help!

Outcomes