Forum: µC & Digital Electronics How to write a bootloader for SAM7A3?

von Al pacino D. (bigmicro)

Rate this post
not useful
Hello my friends,

I've a problem, I want to write my own bootloader. My first attemption 
was writing an application with built in bootloader. So when I want to 
upgrade for example, I flash the new firmware from RAM because my own 
code will be overwritten by the new firmware.

Sometimes it works and sometime not, another problem is if upgrading a 
new firmware goes wrong, the whole device must be sent back flash the uC 
with a JTAG. So to solve this proble, I want a seperate bootloader e.g. 
at the beginning of the flashmemory address and the application firmware 
in another memorysegment of the flash.

Now I'm facing other problems, when the bootloader ends, I need to jump 
to the entry-point of the application firmware. But several things need 
to acount with. For example, the linker script of application firmware 
needs to be modified before compiling the sources. Also, how about the 
interruptvectors? Because at address zero to 1c or something the 
interruptvectors is used of the bootloader, so how about the application 

Can somebody help me, give me hints or tips?

thank you very much!

P.S: Compiler = IAR EWARM 4.41A, uC = at91SAM7A3

von denilson (Guest)

Rate this post
not useful
Hey, what is about your sam7a3 Bootloader? Have you already solve this 

von Rooney B. (rooney)

Rate this post
not useful
The bootloader should always be located in the flash. If the firmware 
update was not successful your bootloader will be still available for a 
retry. A simple bootloader will occupy about one sector.

The only functions that have to be executed in RAM are the function to 
write the flash and to lock the sectors. This is done easily by 
declaring the function as __ramfunc in IAR.


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]
  • [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.