<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to debug in sdram</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40315/how-to-debug-in-sdram</link><description> 
Hi, 

 
I use LPC4357 board and try to debug on sdram, but i meet the
problem on it. download program is OK, but verify is fail. The
following is the message and ini file. Who can give me advise?
Thanks. 

 
Robert 

 
 
Programming Done. 
Contents</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: How to debug in sdram</title><link>https://community.arm.com/thread/120128?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 09:52:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6179aa1c-1fa2-491e-9242-cbcec0a6a702</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
When using the script you wouldn&amp;#39;t need a flash algorithm&lt;/p&gt;

&lt;p&gt;
Suggest looking at the project/example for the options/settings
and form you&amp;#39;re shooting for in a configuration.&lt;/p&gt;

&lt;p&gt;
\Keil\ARM\Boards\Atmel\AT91SAM9XE-EK\Blinky\Ext_SDRAM.ini&lt;/p&gt;

&lt;p&gt;
You&amp;#39;ll obviously have to adapt to your hardware&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug in sdram</title><link>https://community.arm.com/thread/107239?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 08:26:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:614894c0-84bc-4a5f-819b-aac039709cd2</guid><dc:creator>robert shen</dc:creator><description>&lt;p&gt;&lt;p&gt;
the board is similar to Keil&amp;#39;s MCB4357. There is one chip SDRAM
(16MB:MT48LC4m32b2). I can run the program on SPIFI flash, and emwin
is ok too, which use VRAM on SDRAM, that is to say SDRAM is OK.&lt;/p&gt;

&lt;p&gt;
As this ini file is use for program, it do not allow LOAD, g, main
command.&lt;/p&gt;

&lt;p&gt;
As there is not flash chip for SDRAM to add a Algorithm, I just
select a 16MB 32bits flash to add Algorithm. Maybe this is the
problem.&lt;/p&gt;

&lt;p&gt;
Who have similar chip film file to adding Algorithm to share? Or
give me suggestion?&lt;/p&gt;

&lt;p&gt;
Many thanks.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug in sdram</title><link>https://community.arm.com/thread/118432?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 07:20:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:98d3e79e-0faf-412e-b16f-df0e0773c734</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
Is the .INI complete?&lt;/p&gt;

&lt;p&gt;
You have a LOAD and g, main in there too?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug in sdram</title><link>https://community.arm.com/thread/92355?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 05:34:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2d2cebf0-51dc-4898-b6c5-75ce2033d9dc</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
Not sure having all the comparison errors tells us much. No
details of the board, or SDRAM.&lt;/p&gt;

&lt;p&gt;
Suggest you concentrate on the SDRAM timing and geometry
settings.&lt;/p&gt;

&lt;p&gt;
Does the part have any SRAM that you could test the SDRAM from?
Have you tested/validated it? How does the INI correlate to other
SDRAM initialization code, in C, you know works, or is correct for
the board.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug in sdram</title><link>https://community.arm.com/thread/62200?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2013 02:44:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3d6ecbab-dcde-43ae-ba52-c0aed48a6cef</guid><dc:creator>robert shen</dc:creator><description>&lt;p&gt;&lt;p&gt;
ini file:&lt;/p&gt;

&lt;pre&gt;
FUNC void SDRAM_Setup (void) {
// Pin setup
// Data Lines 0..31
_WDWORD(0x4008609C, 0x000000F3);
_WDWORD(0x400860A0, 0x000000F3);
_WDWORD(0x400860A4, 0x000000F3);

_WDWORD(0x400860A8, 0x000000F3);
_WDWORD(0x400860AC, 0x000000F3);
_WDWORD(0x400860B0, 0x000000F3);
_WDWORD(0x400860B4, 0x000000F3);
_WDWORD(0x400860B8, 0x000000F3);

_WDWORD(0x40086290, 0x000000F2);
_WDWORD(0x40086294, 0x000000F2);
_WDWORD(0x40086298, 0x000000F2);
_WDWORD(0x4008629C, 0x000000F2);
_WDWORD(0x40086280, 0x000000F2);
_WDWORD(0x40086284, 0x000000F2);
_WDWORD(0x40086288, 0x000000F2);
_WDWORD(0x4008628C, 0x000000F2);

_WDWORD(0x40086124, 0x000000F3);
_WDWORD(0x40086128, 0x000000F3);
_WDWORD(0x4008612C, 0x000000F3);
_WDWORD(0x40086130, 0x000000F3);
_WDWORD(0x40086134, 0x000000F3);

_WDWORD(0x40086080, 0x000000F2);
_WDWORD(0x40086084, 0x000000F2);
_WDWORD(0x40086088, 0x000000F2);

_WDWORD(0x40086120, 0x000000F3);
_WDWORD(0x4008611C, 0x000000F3);

_WDWORD(0x40086118, 0x000000F2);
_WDWORD(0x40086108, 0x000000F2);
_WDWORD(0x40086104, 0x000000F2);
_WDWORD(0x40086100, 0x000000F2);

_WDWORD(0x40086320, 0x000000F1);
_WDWORD(0x4008631C, 0x000000F1);

_WDWORD(0x400866C0, 0x000000F2);
_WDWORD(0x400866BC, 0x000000F2);

_WDWORD(0x40086700, 0x000000F3);
_WDWORD(0x40086704, 0x000000F3);
_WDWORD(0x40086708, 0x000000F3);
_WDWORD(0x4008670C, 0x000000F3);
_WDWORD(0x40086710, 0x000000F3);
_WDWORD(0x40086510, 0x000000F3);
_WDWORD(0x40086090, 0x000000F3);

_WDWORD(0x40086318, 0x000000F1);

_WDWORD(0x400866B4, 0x000000F2);
_WDWORD(0x400866A8, 0x000000F2);

_WDWORD(0x40086324, 0x000000F3);
_WDWORD(0x40086098, 0x000000F3);
_WDWORD(0x40086310, 0x000000F3);
_WDWORD(0x40086314, 0x000000F3);
_WDWORD(0x4008632C, 0x000000F3);
_WDWORD(0x40086330, 0x000000F3);
_WDWORD(0x40086328, 0x000000F3);

_WDWORD(0x40086680, 0x000000F2);

_WDWORD(0x40086734, 0x000000F3);
_WDWORD(0x4008608C, 0x000000F3);
_WDWORD(0x40086090, 0x000000F3);
_WDWORD(0x40086094, 0x000000F3);
_WDWORD(0x40086098, 0x000000F3);

// Configure CLK0 pin as EMC SDRAM CLK 0
_WDWORD(0x40086C00, 0x000000F0);
_WDWORD(0x40086C04, 0x000000F0);
_WDWORD(0x40086C08, 0x000000F0);
_WDWORD(0x40086C0C, 0x000000F0);

_WDWORD(0x40086344, 0x000000F3);
_WDWORD(0x40086348, 0x000000F3);
_WDWORD(0x40086340, 0x000000F3);
_WDWORD(0x40086680, 0x000000F2);
_WDWORD(0x4008674C, 0x000000F3);

// Configure EMC delays
_WDWORD(0x40086D00, 0x00006666); // EMCCLKDELAY

// Initialize EMC
_WDWORD(0x40005000, 0x00000001); // CONTROL=1 = Enable EMC
_WDWORD(0x40005008, 0x00000000); // CONFIG=0
_WDWORD(0x40005100, 0x00001280); // DYNAMICCONFIG0
_WDWORD(0x40005140, 0x00001280); // DYNAMICCONFIG2
_WDWORD(0x40005104, 0x00000303); // DYNAMICRASCAS0
_WDWORD(0x40005144, 0x00000303); // DYNAMICRASCAS2

_WDWORD(0x40005028, 0x00000001); // DYNAMICREADCONFIG

_WDWORD(0x40005030, 0x00000001); // DYNAMICRP
_WDWORD(0x40005034, 0x00000003); // DYNAMICRAS
_WDWORD(0x40005038, 0x00000005); // DYNAMICREX
_WDWORD(0x4000503C, 0x00000000); // DYNAMICAPR
_WDWORD(0x40005040, 0x00000004); // DYNAMICDAL
_WDWORD(0x40005044, 0x00000001); // DYNAMICWR
_WDWORD(0x40005048, 0x00000005); // DYNAMICRC
_WDWORD(0x4000504C, 0x00000005); // DYNAMICRFC
_WDWORD(0x40005050, 0x00000005); // DYNAMICXSR
_WDWORD(0x40005054, 0x00000001); // DYNAMICRRD
_WDWORD(0x40005058, 0x00000001); // DYNAMICMRD

_WDWORD(0x40005020, 0x00000183); // DYNAMICCONTROL - NOP
_WDWORD(0x40005020, 0x00000103); // DYNAMICCONTROL - PRECHARGE_ALL

_WDWORD(0x40005024, 0x00000002); // DYNAMICREFRESH = 2
_WDWORD(0x40005024, 0x00000032); // DYNAMICREFRESH = 50

_WDWORD(0x40005020, 0x00000083); // DYNAMICCONTROL - MODE

_RDWORD(0x28006600); // Write 16-bit SDRAM Mode register burst 8

_WDWORD(0x40005020, 0x00000000); // DYNAMICCONTROL = 0

_WDWORD(0x40005100, 0x00081280); // DYNAMICCONFIG0
_WDWORD(0x40005120, 0x00081280); // DYNAMICCONFIG0
_WDWORD(0x40005140, 0x00081280); // DYNAMICCONFIG2
_WDWORD(0x40005160, 0x00081280); // DYNAMICCONFIG2
}

FUNC void Setup (unsigned int region) {
  region &amp;amp;= 0xFF000000;
  SP = _RDWORD(region);                          // Setup Stack Pointer
  PC = _RDWORD(region + 4);                          // Setup Program Counter
  _WDWORD(0xE000ED08, region);                   // Setup Vector Table Offset Register
}

SDRAM_Setup();
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>