Fantastic!
 
Thanks a lot - very helpful
geo
----- Original Message -----

George,

You totally understood me correctly.

I advise never to overwrite the bootloader or the reset vector (and thus
the IVT). The bootloader should enforce that.

Let the bootloader forward the interrupt vectors to where the application
will land. Usually for a bootloader it is no problem to work without
interrupts as it has only one single job: wait for a new application and
write it to flash.

Without interrupts used in the bootloader you do not need to check in
which application you are and you don't need to share a flag (at a fixed
address) to indicate that. It is also better for interrupt latency which
has already gone up due to the required forwarding.

The application requires nothing special other than --code-loc.

If the bootloader detects a valid application it can jump to the relocated
reset vector of the application. Or even better, perform a self reset,
detect that at startup and then jump to the application. This way you
don't have any leftover peripheral initialization from the bootloader at
the start of the application.

Maarten

> Hello again
>
> Maarten, thanks for your fast reply.
>   I would recommend to keep the bootloader in low memory and relocate the
> application instead.
> ... and by doing that, one never has to erase the page with the IVT when
> copying in a different application. Is that the point you're trying to
> make here? (my CODE is page-erasable flash, as you guessed)
>   The bootloader then needs to forward all interrupt vectors to the
> application area. This can be done in assembly. This can include
> detection if your in the bootloader and jump to either the bootloaders
> ISR or the applications ISR. If your bootloader can do without
> interrupts things are easier though.
> ... because if the bootloader doesn't need to use the interrupt, you don't
> need to perform any detection. You just forward the vector blindly to the
> application's area.
>   How do you intend to overcome the problem of both the bootloader and the
> application using the dma_ISR and "don't overwrite each other"?
> Let's for a moment forget about the entire crtstart and relocation
> business. Assume we compile a project with a proper main() and make use of
> the default startup code. We then link that project with --code-loc 0x100.
> From what I can understand by reading the docs and from what I've seen in
> the map file, the IVT also gets bumped up by 0x100. This means that, in
> order to make use of those ISRs, we definitely need some forwarding code.
> Correct?
>
> As ever, thanks muchly for the assistance
> geo------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1_______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user