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

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

Re: [avr-gcc-list] Boot loader issues


From: Georg-Johann Lay
Subject: Re: [avr-gcc-list] Boot loader issues
Date: Thu, 14 Mar 2013 11:40:33 +0100
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

larry barello schrieb:

1. How do I specify a long call from my application to jump into the
boot-loader (which resides at 0x20000).  This is my solution:

        case SMB_GOTO_BOOTLOADER:
                EIND = 1;       // HACK HACK
                ((void (*)(bool bCalled))((BOOT_SECTION_START)/2))(true);
                break;

This is not supposed to work reliably, cf. "EIND and Devices with more than 128 Ki Bytes of Flash" in the avr-gcc manual.

2. How do I get Studio 6 to not include the C startup files?  I know how

1) -nostartfiles
2) Implement the startup bits from libgcc

If this does not work: "Studio 6" is not a compiler. It's some GUI. Consult your "Studio 6" support.

3. The boot loader C runtime sets RAMPZ=1 but the compiler insists on using
indirect through Z to access I/O so it fails miserably in the boot section.
I solved this problem by wrapping my various I/O routines (init, TWI
handler, etc) with "RAMPZ=0; . RAMPZ=1;" Surely there is a better way.

avr-gcc assumes RAMPZ=0 always on devices that use RAMPZ on RAM. YMMV depending on the distribution you are using.

4. It appears that the boot-loader pushes 116 bytes of stuff into the end of
the APPTABLE section of FLASH.  It is avr-gcc jamming trampolines or
something there?  How do I make that go away?  I don't need the loader and
my applications fighting over that chunk of flash.

Try compiling with -fno-tree-switch-conversion, this works for implicit .rodata objects with names that start with "CSWTCH". If there are no such objects, then clean up your source code, factor out the unneeded data, remove the data by objcopy or own ld script, ...

Johann




reply via email to

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