Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootloader cannot update itself #2

Open
shaneleonard opened this issue May 3, 2017 · 0 comments
Open

Bootloader cannot update itself #2

shaneleonard opened this issue May 3, 2017 · 0 comments

Comments

@shaneleonard
Copy link
Contributor

shaneleonard commented May 3, 2017

Although the bootloader can program the kernel and any application over serial, it cannot update its own code, since it is running from flash.

If the bootloader code relocates into RAM, it would be possible to arbitrarily overwrite its flash image. Thus, the bootloader could update itself.

I think the relocation step could be implemented simply by changing the linker script, so that all code sections are between _srelocate and _erelocate. The startup code will take care of the rest.

The only remaining item would be to add a corresponding command to tockloader.

Maybe this is a feature we don't actually want? It would allow a board to be bricked by a bad bootloader image (assuming the developer doesn't have a JLink). For a developer with only serial port access, the choice is either 1. a bad bootloader update could brick them, or 2. they are stuck with whatever version of the bootloader they started with.

Personally, I think 2. is the worse case, but maybe others feel differently. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant