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

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

Re: [avr-gcc-list] linking bootloader and main application at once


From: dimax un
Subject: Re: [avr-gcc-list] linking bootloader and main application at once
Date: Mon, 2 Oct 2006 06:37:19 -0700

If all you need is to program two hex files into flash why not to do it?
You can use following trick:
1. avr-objcopy hex1 to bin1
2. avr-objcopy hex2 to bin2
3. merge bin1 and bin2 (may require some scripting). Take care to add
bin2 to bin1 at the correct address where the bootloader starts.
4. avr-objcopy bin12 to hex12


On 10/2/06, Jan Menzel <address@hidden> wrote:
Dear Eric, Dear Dimax!
       This schema is possible, agreed, but to be avoided. The reason is that
as part of the production process the MCU gets programmed once - so why
not program bootloader and application - and, due to nature of the
product, an update via bootloader takes quite long.
       I'm just looking for a solution not to merge application and bootloader
.hex files together for programming.
       I also understand why in principle only one IVT and init section is
available. But the bootloader is programmed to not use any IRQ and hence
only needs the bootloader reset vector to be linked to the bootloaders
main(), while the main reset has to be linked to application main(). So
I still wonder if there is a way to get this two applications
automatically into one .hex file.

       Best Regards
               Jan

dimax un wrote:
> I think it is nonsense to link bootloader and application together.
> The reason to have bootloader is to be able to update application. So
> why not to burn bootloader and after that download application using
> bootloader?
>
> Best Regards.
> http://www.xdimax.com
>
>
> On 9/29/06, Eric Weddington <address@hidden> wrote:
>>
>>
>> > -----Original Message-----
>> > From:
>> > address@hidden
>> > [mailto:address@hidden
>> > org] On Behalf Of Jan Menzel
>> > Sent: Friday, September 29, 2006 8:00 AM
>> > To: address@hidden
>> > Subject: [avr-gcc-list] linking bootloader and main
>> > application at once
>> >
>> > Dear all,
>> >       within the last days we finished our bootloader for a
>> > Mega88 AVR. Now
>> > we would like to link it into existing projects written both in C and
>> > assembler. We prepared the bootloader to reside in a separate section
>> > (.bootloader) located into the AVRs bootloader. If we now link the
>> > bootloader all section .bootloader decorated functions get
>> > located into
>> > to correct flash section but the .init<x>, .verctor, ... are shared.
>> >       How do we have to setup the linker that bootloader and
>> > application gets
>> > their own .vector, .init<x>, ... sections each in their
>> > specific memory segment and that both have the full RAM available?
>>
>> The short answer is that you don't.
>>
>> In the AVR, the interrupt vector table (IVT) can either be at the
>> beginning
>> of memory, OR at the beginning of the bootloader section. You cannot have
>> two IVTs, hence you cannot have two separate groups of .vector
>> sections. The
>> same goes with the startup code: you cannot have two separate sections of
>> startup code, hence no two groups of .init<x> sections.
>>
>> You will have to redesign you application and bootloader to take this
>> into
>> account.
>>
>> Eric Weddington
>>
>>
>>
>> _______________________________________________
>> AVR-GCC-list mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>>
>
>






reply via email to

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