HI Johannes,

On Mon, May 10, 2010 at 7:37 AM, Johannes Bauer <jb....@gmx.de> wrote:
> Hi Dave,
>
> On 10.05.2010 16:22, Dave Hylands wrote:
>
>>> __attribute__ ((section(".bootloader")))
>>>
>>> this does still relocate the data into the non-bootloader flash section
>>> (although it works perfectly for functions). What must I do to force
>>> data into the bootloader?
>>
>> The data section itself has to be located in RAM, or are you talking
>> about the initial value of the data section which is copied to RAM?
>
> Yikes - that one bit me! Of course it has to be copied from .text to
> .data during startup, however I just did not think of that at the point
> I had written the code (possibly due to lack of caffeine).
>
> Is there an option to have gcc put data in the flash section and not
> reserve space for it in RAM? Some combination of noinit and progmem or
> something along those lines.
>
> The rationale for this being that I want to put a constant string in the
> FLASH memory, i.e. $Id$. When I send a command to the MCU, it will read
> the address directly from FLASH into the USART using lpm instructions. I
> do not need the whole string to reside in SRAM, but want the convenience
> of gcc resolving the address automatically for me.
>
> Is that possible at all?

I think that the following will work:

const char SomeString[] __attribute__((section(".bootloader"))) =
"Flash string";

although you should double check and make sure it shows up in a
reasonable place (like after your code instead of before  it)

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/

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

Reply via email to