EmbDev.net

Forum: ARM programming with GCC/GNU tools Question about ARM self Programming


Author: Min Ge (minge519)
Posted on:

Rate this post
0 useful
not useful
Hi All,

I wanna build a boot loader code for my project. The boot code will load
application code from external device (EEPROM or SD Card) and self
programming.
So my code should have tow part, one is boot loader code, another one is
application code.
I want to put bootloader code in either beginning or the end of Flash,
but I do not know how to compile the code into specific range in flash.
Also, when I update applicatin code, I do not want to change my
bootloader code.

I used to use AVR micro, it has a fuse bit that can set reset vector to
bootloader part.

Does anybody have solution for this? Thanks.

Min Ge

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
Min Ge wrote:
> I wanna build a boot loader code for my project. The boot code will load
> application code from external device (EEPROM or SD Card) and self
> programming.
> So my code should have tow part, one is boot loader code, another one is
> application code.
> I want to put bootloader code in either beginning or the end of Flash,
> but I do not know how to compile the code into specific range in flash.
> Also, when I update applicatin code, I do not want to change my
> bootloader code.
>
> I used to use AVR micro, it has a fuse bit that can set reset vector to
> bootloader part.

Some ARM-controllers support something like the "reset-vector"-setting
of the AVRs. The start-address can be defined by connection pins to VCC
or GND. But devices without external memory-interface usualy start from
the first address in the internal  flash-memory which is mapped to
0x0000000 (ARM Reset-Vector). So at least at this address should be a
"jump to bootloader". But it might be a better approach to place the
bootloader at the start of the internal flash. On system-startup the
bootloader is executed and can check a condition (Version-String on
SD-card or something like this) and a new version of the
user-application code can be read from the memory-card and programmed
into the internal flash. If the start-condition is not fullfilled the
loader can check for a valid application and start it (Jump to the
address of the application's startup-code). The application can be
linked so the start-adress is "behind" the bootloader (address depends
on the flash-memory-layout/banking and bootloader size), On startup the
application has to "remap" so the interrupt-vectors of the application
are used (not the ones from the bootloader). FLASH-programming itself is
very device-specific and should be documented in the manual of your
controller. IRC there is a bootloader for AT91SAM7S with USB available
(not SAM-BA, search the AT91.com forum) which should give an idea.

Martin Thomas

Reply

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.