[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Boot loader issues
From: |
larry barello |
Subject: |
[avr-gcc-list] Boot loader issues |
Date: |
Wed, 13 Mar 2013 21:39:32 -0700 |
I am implementing a boot-loader for the Xmega. Actually I have a working
boot-loader, but I had to do some ugly things that I am sure there are
proper ways to do if I were not so ignorant.
Pointers to FAQ, samples or replies appreciated. I did find the libc FAQ
and the gnu documentation on this subject.
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;
2. How do I get Studio 6 to not include the C startup files? I know how
this works with older versions of Winavr but specifying -nostdlib (or
-nostartfiles) doesn't seem to work with studio 6 avr-gcc. Currently I go
ahead and include gcrt... and accept the huge vector table (which I don't
use).
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.
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.
Thanks for your patience with my ignorance. This is the first time I have
broken the 128k barrier.
- [avr-gcc-list] Boot loader issues,
larry barello <=