Memory Management in Cortex M0/M3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Memory Management in Cortex M0/M3

776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Mon Oct 03 22:24:38 MST 2011
Hi all,

As the NXP Cortex M series always come with RAM size smaller than Flash size , for example LPC1343 with 8KB SRAM and 32 KB Flash; I wonder how the MCU load the program code in to SRAM ?
For Example: If the program code is 28 KB and the SRAM is only 8KB, how can it be fit into memory region ? do the MCU use overlay mechanism ? or ODP mechanism ?
I cannot find any information regarding of this on the User Manual.

Thank you.
0 Kudos
Reply
4 Replies

761 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Tue Oct 04 01:59:00 MST 2011
Thank you Zero,

The LPC11Uxx series is not available yet but the spec is already public.
The LPC11U1X is 6KB SRAM and LPC11U2X is 10KB SRAM.
I am currently using LPC1343 but plan to migrate product to LPC11Uxx series.
Thank you for all .
0 Kudos
Reply

761 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Oct 04 01:44:56 MST 2011
LPC11U-what :confused:

Are this chips already available somewhere?

How many RAM is necessary for your application depends on your application :eek:

Your compiler is showing the Flash / RAM size, but that's of course the data size.

See: http://support.code-red-tech.com/CodeRedWiki/FlashRamSize

There should be left a little bit RAM for stack and heap:

See: http://support.code-red-tech.com/CodeRedWiki/StackProblems

So if you don't know how much RAM is needed, start to write your application (with an available chip) and look what happens :)
0 Kudos
Reply

761 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Tue Oct 04 00:00:13 MST 2011
Hi Rob,

Thanks for your quick respond, now I understand that the Code  run directly from Flash. But what is the main task of SRAM ? just to keep Stack and Heap memory ?
How can I know how much memory of SRAM that I need for my application ?
If I design a USB CDC device using NXP Cortex M0, should I chose LPC11U1X or LPC11U2X , because LPC11U1X is 6KB SRAM and LPC11U2X is 10KB SRAM.

Thanks
0 Kudos
Reply

761 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Oct 03 23:10:13 MST 2011

Quote: tungsys
I wonder how the MCU load the program code in to SRAM ?



The short and simple answer to this question is: not.

The MCU does not do anything it is not programmed to do :eek:
The code is directly executed from Flash so there is no real need to place your code into SRAM.

SRAM is a bit faster than flash so if a part of your code needs to run from SRAM that is still possible and that has been discussed on this forum. Use the tips from CodeRedSupport in the sticky post on top of the forum to see how to search this forum.

Regards,
[INDENT]Rob
[/INDENT]
0 Kudos
Reply