On 08/09/14 01:18, Erik Christiansen wrote:

Thanks for the reply.  Interesting.

I think the solution I will use is to put the buffer between __bss_end and the stack.

Initializing in C:

extern unsigned int __bss_end;
...
buffer_base = (uint8_t *)(__bss_end & 0xff80) + 0x80
buf_head_ptr = spi_buffer_base
buf_tail_ptr = spi_buffer_base


etc.

I have a gap, but, it is on the order of 20 bytes.

The order of allocation of variables by ld is curious. The ldscripts give order to the sections. Moving variable declarations around seems to have little or no effect on the order I see from avr-nm.

Tom Dean

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to