ARMmbed / mbed-os-example-bootloader-blinky

DEPRECATED
4 stars 4 forks source link

Can a "bootloaded" mbed application be compiled independent from a bootloader image? #7

Open 0Grit opened 7 years ago

0Grit commented 7 years ago

A couple questions to gain my bearings

Can an mbed application be compiled without knowledge of the bootloader image that will be loading it?

What would be required for this? (Position independent compile?)

What role can uvisor secure boxes play in this realm?

c1728p9 commented 7 years ago

Hi @loverdeg-ep, you need to at least know the size of the bootloader. The application image must be built for an absolute address.

Currently uvisior is a pre-compiled binary for a fixed address. Because of this you can't use it in conjunction with an application built for use with a bootloader (since the application has an offset).

0Grit commented 7 years ago

Any chance of making things more position independent in the future?

I'd prefer to not have to worry what boot-loader might currently be in flash when compiling an application. It's just one more decision and potential source of error per compile.

c1728p9 commented 7 years ago

There are no plans to build applications as position independent, as this has implications on performance and compatibility among other things.

0Grit commented 7 years ago

What are the compatibility implications?

c1728p9 commented 7 years ago

There would need to be a massive overhaul of linker scripts to support relocatable rom and all the pre-compiled libraries in the codebase (like for example nanostack) would no longer work. There would also need to be source code changes in the boot sequence and other places.

0Grit commented 7 years ago

Does this mean remotely updating any of the pre-compiled libraries without restarting my application will never be an easy task?

Maybe this is something the uvisor will address?

I'm really trying to get a feel for the ultimate intents of the bootloader & uvisor. It just feels like something is missing and I'm not quite sure which questions to ask.