Hi Jeff,

On Tue, Nov 20, 2018 at 04:12:54PM +0000, Jeff Belz wrote:
> All:
> 
> I have to use a custom boot loader for my application.  Has anyone
> done this before and if so, what are the tricks to doing this?
> 
> I'm running a stm32f412.  I've got the application running on 0x802
> 0000   and the mynewt loader is at 0x8000000.  Looking to bypass the
> mynewt loader, and use mine instead.     My bootloader works for my
> other non-mynewt application, so I'm looking for possibility why it's
> not working now.    I'm thinking it's the naming of the entry points,
> but not sure of the newt OS needs something special it look for in
> order to run the application.

If I understand, you want to replace the Mynewt boot loader with a
custom one (as opposed to using two boot loaders).  Is that right?

That should be fairly straightforward.  The interface between boot
loader and application is very simple.  In particular, both components
just have to agree on the application starting address.  When the boot
loader is done doing whatever it is meant to do, it simply jumps to the
application starting address.  Entry point names don't matter; these are
discarded during the build process.

The specific address to jump to is:
    slot-0-offset + image-header-size + start-word

Using the default stm32f412 BSP definition, this would be:
    0x8020000 + 32 + 4 = 0x8020024

(It probably doesn't make sense to use the 32-byte Mynewt image header
at all with your custom boot loader, but that is a separate issue.)

Chris

Reply via email to