-->
Page 1 of 1

Where the compiler places things

PostPosted: Sat Mar 14, 2015 2:40 pm
by picstart
void ICACHE_FLASH_ATTR
user_init()

Questions
1)
ICACHE_FLASH_ATTR appears to be some pragma that places the following subroutine into external 512K byte flash but where would the code be placed if it the pragma was
omitted?
2)
If a character array is declared as
static const uint8_t ASCII[][5] =
does it get stored in external 512k byte flash if not where?

Re: Where the compiler places things

PostPosted: Sun Mar 15, 2015 4:29 am
by joostn
There's a 32k section of RAM which is filled with a corresponding section from flash (iram1) upon startup. By default code goes here. The code will run fast and you can safely use it in ISR but space is very limited.

You can have all code by default go into flash, a.o. see this post:
viewtopic.php?f=9&t=224&start=150

For your second question see:
viewtopic.php?f=13&t=2006