-
Notifications
You must be signed in to change notification settings - Fork 167
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
BL/BU: Handle bad bootloaders #1874
Conversation
Defensive measure against bootloaders (possibly from other projects) leaving things running.
Some bootloaders set it to our initial SP and then some compiler generated code increments it off the top of the stack before branching to firmware... so we ensure it is correct before using the stack.
@mlyle I dropped the commit which switched from newlib-nano to newlib. |
jenkins, build artifacts please |
Gives the compiler no chance to insert garbage code. Before it was inserting in between setting MSP to initial SP and branching to initial PC: ldmia.w sp!, {r4, r5, r6, lr} (ldm = load multiple, ia = increment after... this tries to pop off the stack after setting SP to the new stack top)
jenkins, build artifacts please |
@@ -1,12 +1,12 @@ | |||
BOARD_TYPE := 0x94 | |||
BOARD_REVISION := 0x01 | |||
BOOTLOADER_VERSION := 0x87 | |||
BOOTLOADER_VERSION := 0x88 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already 0x88 at next, shouldn't it be 0x89 now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would require a rebase and it's only been at 0x88 for a couple of days... will just ignore ;)
Artifacts built, by request of @tracernz |
OMG thanks. |
thanks 👍 |
Tested and working on Revo:
Fixes #1689 (issue detailed in #1689 (comment))
Remaining questions: