Startup Code Source

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've reviewed the source code for crt0.S, exception.S, and trampoline.S. I've disassembled the `.elf' file from the "Hello World" example.

The startup code from the Hello World example is clearly not the same as the startup code from crt0.S. Why should they be different? Can we get the source for the actual startup code that is being used for the framework examples?

We never have time to do it right,
but we always have time to do it over

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Crt0.S from the framework is in: \UTILS\STARTUP_FILES\GCC.

I do not know for the Hello World example, but it should be linked with the crt0 from the Newlib. I think you can find the Newlib source on atmel.com.

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sma wrote:
Crt0.S from the framework is in: \UTILS\STARTUP_FILES\GCC.

I do not know for the Hello World example, but it should be linked with the crt0 from the Newlib. I think you can find the Newlib source on atmel.com.

-sma


That is probably correct. I thought I had implied that the simple `crt0.S' from UTILS\STARTUP_FILES\GCC is not used for any of the examples in the framework that I have looked at so far. HelloWorld was only the example that came readily to mind. The use of Newlib is part of the reason why all of the examples in the framework generate executables in excess of 32K, because the contents of the entire C library is included along with what ever code you may be interested in.

I'll check www.atmel.com for the source to Newlib. If anyone has the actual link it would be helpful to post it here.

I've searched it pretty thoroughly and I'm pretty sure it is not there.

We never have time to do it right,
but we always have time to do it over

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmmm - so it is buried in the source for the entire toolchain. I suppose that makes sense. Sure am glad I don't have a 56K dialup -- I'd be gray by the time it finished.

Thanks for the link.

Edit: It took a minute or so to locate `crt0.S' and `exception.S' and they were exactly what I was looking for. Thanks again for the helping hand.

We never have time to do it right,
but we always have time to do it over

Last Edited: Wed. Jan 30, 2008 - 05:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

there is one zipped file called: avr32-newlib-1.14.0.atmel.1.0.1.tar.gz inside the above linked zip file, is it what you looking for?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

darthvader wrote:
there is one zipped file called: avr32-newlib-1.14.0.atmel.1.0.1.tar.gz inside the above linked zip file, is it what you looking for?

Yup! got it. After several extraction steps
The files I was looking for were in
.../newlib/libc/sys/avr32/crt0.S and
.../newlib/libc/sys/avr32/exception.S

We never have time to do it right,
but we always have time to do it over

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

but in the PM example of UC3B framework, its config.mk uses the

$(UTIL_PATH)/STARTUP_FILES/GCC/crt0.S \
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

darthvader wrote:
but in the PM example of UC3B framework, its config.mk uses the

$(UTIL_PATH)/STARTUP_FILES/GCC/crt0.S \


That may well be. I havn't looked at the UC3B framework yet since I'm concentrating on the UC3A. I get nervous when an embedded application has mysterious code embedded in it. You just never know if it might lead to problems. What I'm aiming for is a C runtime startup somewhere between the minimal footprint from the STARTUP_FILES/GCC folder which is just 140 bytes long and the NewLib startup plus C library that is about 36K or 8% of the available flash. Maybe I'll succeed and maybe I won't; but I'm gonna try.

We never have time to do it right,
but we always have time to do it over

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

great, good luck!