I have a c file:
#include <stdint.h>
static uint8_t data[] =
{
[0 ... 9] = 1,
[10 ... 99] = 2,
[100 ... 999] = 3,
[1000 ... 1499] = 4
};
int main (void)
{
while(1)
{
__asm__ __volatile__ ("nop"); // do nothing
}
return (0);
}
.text is about 160 bytes, and .data is 1500 bytes.
here is the output of avr-size:
Program: 1662 bytes (5.1% Full)
(.text + .data + .bootloader)
Data: 1500 bytes (73.2% Full)
(.data + .bss + .noinit)
I know that .data is to be considered belonging to sram, but its initial
image is hold in flash, and according to my opinion this fact must be
take into account, otherwise the binary may not work (as happened to my
real project)