Skip to main content
Chris Rice
Associate III
August 20, 2018
Question

CODE vs RO vs RW vs ZI-data

  • August 20, 2018
  • 2 replies
  • 6786 views

Hi there, dumb, dumb, dumb, dumb question: which of the above, as reported by my Keil MDK compiler, count against my program space and which count against my RAM? Does CODE+RO go into my program space, or just CODE?

Asking because I'm playing with techniques to get image data into my program, and found an example project that does this:

static const uint8_t pixelmap_ButtonVideo[] = 
{ 
 /*Pixel format: Alpha 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit*/
 0x00, 0x00, 0x00, 0x00
...
}

and the static const ends up going into my RO tally, and I'm embarrassed to say I'm not 100% sure where that goes.

Thanks very much!

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
August 20, 2018

RO data stays in FLASH (see .MAP addresses, between 0x08000000..0x081FFFFF, or whatever)

RW is initialized data which stages in FLASH and gets copied/unpacked to RAM via __main/scatterload

ZI is zero initialized memory, it is described in a load region table with the RW data, and cleared by __main/scatterload

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Chris Rice
Associate III
August 20, 2018

Thanks!