Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4109924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:52:01+00:00 2026-05-20T21:52:01+00:00

I am working on an ARM processor, I wondered if the ROM and RAM

  • 0

I am working on an ARM processor, I wondered if the ROM and RAM used are quite different than what I assume. For an example, for a program having the following memory table:

Program Size: 
Code=1264 
RO-data=16 
RW-data=0 
ZI-data=1384

How is this distributed among ROM and RAM?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:52:02+00:00Added an answer on May 20, 2026 at 9:52 pm

    You say "different than what we think of", as if everyone thinks in the same way 🙂

    I would guess that you are coming from low-end microcontrollers which often have separate program and data address spaces. On ARM the situation is different: program code, data and peripheral registers all reside in the same flat 32-bit memory space. They are said to use a so-called "modified Harvard" architecture: the data and instruction buses are separate* (Harvard), but they use a single memory space (Von Neumann). Thus, you can read data from ROM and execute programs from RAM without any special set up.

    For example, here’s the memory map of LPC1768, a common Cortex-M3 microcontroller from NXP.

    LPC1768

    Note that on bigger ARMs the map can be much more complex, e.g. there are usually several CS (chip select) regions for external flash/SRAM/SDRAM or other peripherals, which might or might not be connected for each specific device using the processor. However, they all are still accessible via the same 32-bit flat memory space.

    Now about the line you quote. At a guess, it was produced by Keil or ARM RVCT compiler. The abbreviations mean the following: RO=read-only, RW=read-write, ZI=zero-initialized.

    When you compile a standalone firmware for a microcontroller (as opposed to a user-mode program to be run in an OS), in the end you usually get a single monolithic image that will be flashed into the flash ROM and executed in-place. This is fine for code which usually is not modified, or read-only (const) data, but not so great for writable data. That’s where RW and ZI regions come in. The compiler inserts a small bootstrap code which takes a chunk with initial values of initialized data from the ROM image and copies it into RAM (this is the RW region). It then zeroes out the rest of the used RAM (ZI region). Then the control is transferred to the actual code written by the programmer.

    Here I tried to illustrate how a typical program looks like for the above-mentioned LPC1768:

    +-----------+ 0x1000 8000 \
    |  Unused   |             |
    +-----------+             |
    |  ZI data  | <--(clear)  | RAM
    +-----------+             |
    |  RW data  | <--(copy)---|---+
    +-----------+ 0x1000 0000 /   |
                                  |
                                  |
    +-----------+ 0x0008 0000 \   |
    |  Unused   |             |   |
    +-----------+             |   |
    |  RW init  |-------------|---+
    +-----------+             |
    |  RO data  |             | ROM (Flash)
    +-----------+             |
    | User code |             |
    +-----------+             |
    | Boot code |             |
    +-----------+             |
    |  Vectors  |             |
    +-----------+ 0x0000 0000 /
    

    Thus, to calculate the used ROM (flash) space, you need to add up code, RO-data and RW-data. Used RAM will be the sum of RW-data and ZI-data. So, for your case, it’s 1264+16+0=1280 bytes of flash and 0+1384=1384 bytes of RAM.

    *: not always true: I think Cortex-M0 chips have a single data/instruction bus.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're working on a C program compiled with arm-eabi-gcc under Linux. We're using a
I am working on ARM 9 processor with 266 Mhz with fpu support and
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Here is the site mock-up I'm working on for my job: http://dev.arm.gov/~noensie/dqhands/cgi-bin/explorer . I'm
I need to write a program to implement real time clock for ARM architecture.
I'm using the following code to do a simple counter-based delay/wait for ARM: .thumb_func
I need to use GMP in an iphone program I'm working on, but don't
I am working with an ARM Cortex M3 on which I need to port
I'm producing a hex file to run on an ARM processor which I want
I am working on lpc2468 ARM-based microcontroller. I am not able to configure the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.