How to write a bootloader for SAM7A3?

OP #713369
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 
firmware?

Can somebody help me, give me hints or tips?

thank you very much!

P.S: Compiler = IAR EWARM 4.41A, uC = at91SAM7A3
#766773
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.

Reply

A question of your own? This thread is over 18 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.