avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Relocate Data into bootloader-Section


From: Johannes Bauer
Subject: Re: [avr-gcc-list] Relocate Data into bootloader-Section
Date: Mon, 10 May 2010 16:37:52 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

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?

Regards,
Johannes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]