<?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>LPC1768 how to Reserve 4K of SRAM to store data</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/29683/lpc1768-how-to-reserve-4k-of-sram-to-store-data</link><description> 
Hi all 

 
I&amp;#39;m learning to program uC&amp;#39;s on by myself, and I&amp;#39;m using the
MCB1700, now I have some doubts. 

 
for example, How can I reserve SRAM space memory for storing data?
what I want is to have for example 4 KB of memory to store data, from
one</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: LPC1768 how to Reserve 4K of SRAM to store data</title><link>https://community.arm.com/thread/116536?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2011 03:20:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f1491f5f-30ed-42de-abf3-52d683b6eac5</guid><dc:creator>ruben garcia</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank you everyone, specially Marc&lt;/p&gt;

&lt;p&gt;
I was quite clear with the explanation you have given me and meets
my needs.&lt;/p&gt;

&lt;p&gt;
thanks again&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 how to Reserve 4K of SRAM to store data</title><link>https://community.arm.com/thread/105377?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2011 06:43:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:daa35ca2-922c-4578-baa5-ea05bf5947e0</guid><dc:creator>@Marc Crandall</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;/p&gt;

&lt;p&gt;
Most emac driver and usb stacks require buffers. Because these
communication are fast it&amp;#39;s often a good idea to put these buffers in
the SRAM.&lt;br /&gt;
So for example bank 0 would be for the USB stack and bank 1 for the
ethernet driver.&lt;/p&gt;

&lt;p&gt;
I would store my configuration data in a section of the iRAM
myself but there is no rule that says you have too use this
setup.&lt;/p&gt;

&lt;p&gt;
You are correct in your explanation of the linker memory section
usage. However the only reason to add a memory section to the target
tab is so the linker can use it.&lt;/p&gt;

&lt;p&gt;
For example I add bank 0 and bank 1 and I change the individual
file options for my emac and USB source file to use these locations
for RAM.&lt;/p&gt;

&lt;p&gt;
I&amp;#39;m not sure what you are doing but you may want to consider
reserving a section of iRAM that the linker can not use.&lt;/p&gt;

&lt;p&gt;
TARGET TAB&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
  RAM1 0x1000 0000 - 0x1000 5FFF (for stack, globals...) NOTE end
  address!&lt;/li&gt;

  &lt;li&gt;RAM2 0x2007 C000 - 0x2007 FFFF (for USB)&lt;/li&gt;
  &lt;li&gt;RAM3 0x2008 0000 - 0x2008 3FFF (for ethernet)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Then in your code add a block of memory at 0x10006000 for your
data.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 how to Reserve 4K of SRAM to store data</title><link>https://community.arm.com/thread/105374?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2011 01:36:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5e4d2b8f-5fd8-4e29-8cef-fdacf3078dcb</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Some actions - like DMA transfers - do care about whith memory
block you try to use.&lt;br /&gt;
Another thing is that the different RAM blocks can be accessed
concurrently since the processor have more than one bridge. So the
peripherials can perform DMA transfers without affecting bandwidth of
the main RAM.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 how to Reserve 4K of SRAM to store data</title><link>https://community.arm.com/thread/79659?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2011 00:24:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7736c5f7-39ca-43fa-9905-0f12721e15db</guid><dc:creator>ruben garcia</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks Marc&lt;/p&gt;

&lt;p&gt;
I think your comment has been helpful, but ... If I understand
correctly.&lt;/p&gt;

&lt;p&gt;
the three LPC1768 SRAM banks are:&lt;br /&gt;
On-chip SRAM&lt;br /&gt;
0x1000 0000 - 0x1000 7FFF For device with 32 kB of local SRAM.&lt;br /&gt;
On-chip SRAM (typically Used for peripheral data)&lt;br /&gt;
0x2007 C000 - 0x2007 FFFF AHB SRAM - bank 0 (16 kB)&lt;br /&gt;
0x2008 0000 - 0x2008 3FFF AHB SRAM - bank 1 (16 kB)&lt;/p&gt;

&lt;p&gt;
So, if In Options for Target &amp;#39;FLASH&amp;#39; in Target Tab, I leave this
configuration&lt;/p&gt;

&lt;p&gt;
in Read / Write Memory Areas&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;default off-chip Start Size NoInit&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;default on-chip Start Size NoInit&lt;br /&gt;
selectedI RAM1 0x10000000 0x8000 Not Selected&lt;br /&gt;
Not Selected IRAM2 0x2007C000 0x4000 Not Selected&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
both local 32Kb SRAM and 16Kb bank 0 SRAM are treated by the
linker, and are sensitive to any local and global variables, and used
by the stack and heap. and fully 16Kb bank 1 SRAM would never be used
during program execution unless I explicitly choose to access it.
That&amp;#39;s right?&lt;/p&gt;

&lt;p&gt;
I do not understand what you mean by the expression&lt;br /&gt;
&lt;i&gt;(btw. SRAM At This location is Generally Used peripherals for USB
and Ethernet)&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Do you mean that if my program use USB or Ethernet, I can not use
these memory locations to store my data from, and if so ... How I can
use this memory and USB or Ethernet at once?&lt;/p&gt;

&lt;p&gt;
thanks again&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC1768 how to Reserve 4K of SRAM to store data</title><link>https://community.arm.com/thread/59945?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2011 07:50:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:393fc4c7-9d29-4645-a79d-c296420ce56a</guid><dc:creator>@Marc Crandall</dc:creator><description>&lt;p&gt;&lt;p&gt;
Everything under the Options for Target &amp;#39;FLASH&amp;#39; in Target tab is
used by the linker during &amp;#39;scatter loading&amp;#39;&lt;/p&gt;

&lt;p&gt;
If you want a section of memory that would not be used by the
linker, gernerally you should not include it under these
settings.&lt;/p&gt;

&lt;p&gt;
(btw. SRAM at this location is generally used for USB and Ethernet
peripherals)&lt;/p&gt;

&lt;p&gt;
In your case just remove the RAM section from this tab all
together and use your&lt;/p&gt;

&lt;pre&gt;
Unsigned char my_sram_sector [0x4000] __attribute__ ((section (&amp;quot;. ARM.__at_0x20080000&amp;quot;), zero_init));
&lt;/pre&gt;

&lt;p&gt;
or if you just want a pointer this is more portable:&lt;/p&gt;

&lt;pre&gt;
Unsigned char * my_sram_sector = (Unsigned char *)0x20080000;
&lt;/pre&gt;

&lt;p&gt;
Hope this helps.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>