Keil Logo

How much of a RAM we can use in our program

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
applied automation
Posted
30-Apr-2019 11:07 GMT
Toolset
ARM
New! How much of a RAM we can use in our program

Hi,
I'm using LPC1768 controller keil v5.24.2.0. In the LPC1768 controller i put tcpip,http stack and some other application to it. While executing data memory reaches around 32700 it works well. But after that it gives an error".\Objects\IIOT Raw.axf: Error: L6406E: No space in execution regions with .ANY selector matching server.o(.data).". Before reach the error the memory limits are Program Size: Code=35844 RO-data=31472 RW-data=300 ZI-data=32348.
But in a datasheet they given the data memory is 64K. How to use the full of that ram memory?</br></br>

Thanks & Regards,
Prasanth.

Author
Tamir Michael
Posted
30-Apr-2019 12:45 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

If your linker script is wrong - indicating less SRAM that you physically have - you will get this.

Author
Tamir Michael
Posted
30-Apr-2019 12:46 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

Or, if this may happen if you actually need much more SRAM than you think.

Author
applied automation
Posted
30-Apr-2019 12:54 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

I just add 200 bytes of short int variable it gives an error. If i didn't add that i doesn't gets an error. So 200 bytes are not much higher memory in remaining 32k. But i got an error.

Author
applied automation
Posted
30-Apr-2019 12:49 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

Please tell me how to correct that linker script.

Author
Tamir Michael
Posted
30-Apr-2019 13:05 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

I cannot read minds yet; post it here using the correct tags!

Author
Andrew Neil
Posted
30-Apr-2019 13:38 GMT
Toolset
None
New! RE: indicating less SRAM that you physically have

Before delving into the linker script (or "scatter file", in Keil terminology), check your project's memory settings:

http://www.keil.com/support/man/docs/uv4/uv4_ca_ovwconfigdialogs.htm

Specifically: http://www.keil.com/support/man/docs/uv4/uv4_dg_adsld.htm

Some examples here: http://www.keil.com/support/man/docs/mcb1700/mcb1700_wp_cap_params.htm

See also: http://www2.keil.com/mdk5/learn

Author
applied automation
Posted
2-May-2019 05:33 GMT
Toolset
None
New! RE: indicating less SRAM that you physically have


In a "Setting Target Options" tab values are IROM1:start(0x00),size(0x80000) and IRAM1:start(0x10000000),size(0x8000). In a keil support page"http://www.keil.com/support/man/docs/mcb1700/mcb1700_wp_cap_params.htm" they mentioned ROM size is 0x40000 and RAM is 0x8000. </br>

According to lpc1768 datasheet RAM is 64k and ROM is 512k. So what size i need to replace in RAM and ROM size.</br>

Author
Westonsupermare Pier
Posted
30-Apr-2019 16:56 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

Start by looking at the Target tab in the Options, and make sure IRAM fully describes the available resources in the part you have chosen.

Review also the .MAP file to understand the current space utilization/allocation

Author
applied automation
Posted
2-May-2019 05:47 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

I go through the .map file and the details are
Load Region LR_IROM1 (Base: 0x00000000, Size: 0x00010828, Max: 0x00080000, ABSOLUTE, COMPRESSED[0x00010754])</br>


Execution Region ER_IROM1 (Exec base: 0x00000000, Load base: 0x00000000, Size: 0x000106fc, Max: 0x00080000, ABSOLUTE)</br>


Execution Region RW_IRAM1 (Exec base: 0x10000000, Load base: 0x000106fc, Size: 0x00007fb8, Max: 0x00008000, ABSOLUTE, COMPRESSED[0x00000058])</br>


Image component sizes


      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Object Name

  I deleted the code in this area due to memory limit in a forum.
    ----------------------------------------------------------------------
     10416        758      30412        252      32124     239113   Object Totals
         0          0         32          0          0          0   (incl. Generated)
         0          0          4          6          0          0   (incl. Padding)

    ----------------------------------------------------------------------

      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Library Member Name


  I deleted the code in this area due to memory limit in a forum.
    ----------------------------------------------------------------------
     25436       2230       1060         48        272      15100   Library Totals
        36          0          8          5          0          0   (incl. Padding)

    ----------------------------------------------------------------------

      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Library Name

     17968       1930        775         39        272      11196   TCP_CM3.lib
      2868        200        144          0          0        912   m_ws.l
      3228        100        133          4          0       1996   mc_w.l
      1336          0          0          0          0        996   mf_w.l

    ----------------------------------------------------------------------
     25436       2230       1060         48        272      15100   Library Totals

    ----------------------------------------------------------------------

==============================================================================


      Code (inc. data)   RO Data    RW Data    ZI Data      Debug

     35852       2988      31472        300      32396     242745   Grand Totals
     35852       2988      31472         88      32396     242745   ELF Image Totals (compressed)
     35852       2988      31472         88          0          0   ROM Totals

==============================================================================

    Total RO  Size (Code + RO Data)                67324 (  65.75kB)
    Total RW  Size (RW Data + ZI Data)             32696 (  31.93kB)
    Total ROM Size (Code + RO Data + RW Data)      67412 (  65.83kB)

==============================================================================


So my total allocated rom is 0x80000 and used is 65.83k and allocated ram is 0x8000 and used is 31.93k. May i change IRAM value to 0xFA00(64k) instead of 0x8000(32.7k)?</br>

Author
Westonsupermare Pier
Posted
2-May-2019 21:23 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

If the part has 64KB, set IRAM1 size to 0x10000

0x10000 = 65536 = 64 * 1024

Author
Westonsupermare Pier
Posted
2-May-2019 21:42 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

While the data sheet says it has 64KB, it is not all contiguous

There are two 16KB AHB SRAM, located at 0x2007C000 and 0x20080000
You might need to define an IRAM2 section at 0x2007C000 of 0x8000 length, and have your IRAM1 section at 0x10000000 of 0x8000 length. You then need to learn how to use attributes and scatter files to place data in the area you want

Anyway RTFM for the NXP and KEIL, so I don't have to read them for you
https://www.nxp.com/docs/en/data-sheet/LPC1769_68_67_66_65_64_63.pdf

Author
applied automation
Posted
3-May-2019 04:45 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

Okay. Thank you very much for your kind response. Its working for me after putting IRAM1 value to 0x10000.

Author
applied automation
Posted
15-May-2019 09:27 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

<p>After change the ram size i have an issue with debugging. When i initiate a debugging cursor start with main function. But now it starts automatically and if i stop debugging it stop at hard fault handler.</p>
<p>If i change ram size from 0x1000 to 0x800 it debug fine. But i need full of RAM 0x1000. What should i do to solve this issue?</p>

Author
Westonsupermare Pier
Posted
15-May-2019 21:35 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

As I established in my last message, the RAM is *not* contiguous, a fact provided in the reference manual. This is not a part I'm using, it is the part you're using, and should be familiar with.

You will need to define TWO IRAM sections at the different locations, and then direct resources into each. The scatter file will allow function and object level direction, and you should be able to use #pragma or attribute directives in your code to establish where variables and structures are placed.

Author
applied automation
Posted
16-May-2019 04:31 GMT
Toolset
ARM
New! RE: How much of a RAM we can use in our program

How to use #pragma or attribute in my code. Please give some sample code for that.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.