Forum: ARM programming with GCC/GNU tools ARM: Beginners questions about startup and Linker

Author: sNOOBy (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful

I recently started programming an ADuC7026 Microcontroller which has a 
ARM7TDMI core.
I managed to write a code that blinks a LED (attached), however even 
though the code works, there are some issues that I don't understand.

First a question regarding the startup code: At the beginning of the 
startup code I try to set up the vector table whith a Branch to the 
actual startup routine (_start) at the first address, which will later 
be linked to 0x0. However I discovered, that if I modify this line to 
reset:  B  reset
the code will still work! Shouldn't this modification result in the MCU 
never reaching the rest of the code?

The second question is about the Linker-script: The Flash begins at 
address 0x80000 which after reset is equivalent with address 0x0? So it 
shouldn't make a difference if the "." variable is set to 0x0 or 0x80000 
before the .text section? What I found was, that this does indeed not 
make a difference. However I can actually give the "." any value I want 
and it will still work! Also exchanging the placement order of the 
subsections to eg:
* (exception_vectors);
* (.text .text.*);
doesn't have any impact!

I feel like any of the described modifications should prove fatal for my 
I would be really glad if someone could explain where I have gone wrong.
Also, as a beginner, I appreciate any other comments and advice on the 

Thanks for your help already!

: Moved by Moderator


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.