cancel
Showing results for 
Search instead for 
Did you mean: 

CODE vs RO vs RW vs ZI-data

Chris Rice
Associate III

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!

2 REPLIES 2

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
Up vote any posts that you find helpful, it shows what's working..
Chris Rice
Associate III

Thanks!