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

BL/BU: Handle bad bootloaders #1874

Merged
merged 3 commits into from
Jul 3, 2017
Merged

BL/BU: Handle bad bootloaders #1874

merged 3 commits into from
Jul 3, 2017

Conversation

tracernz
Copy link
Member

@tracernz tracernz commented Jul 3, 2017

Tested and working on Revo:

  • Latest Librepilot bootloader (v6) -> flash BU from this branch -> flash dR firmware from this branch
  • BL from this branch -> flash BU from this branch -> flash dR firmware from this branch
  • BL from this branch -> flash BU from Release-20160720.1 linux release -> flash BU from this branch -> flash dR firmware from this branch

Fixes #1689 (issue detailed in #1689 (comment))

Remaining questions:

mlyle and others added 2 commits July 3, 2017 20:06
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.
@tracernz tracernz added this to the Neat milestone Jul 3, 2017
@tracernz tracernz requested a review from mlyle July 3, 2017 08:15
@tracernz tracernz changed the title Mpl interruptbu BL/BU: Handle bad bootloaders Jul 3, 2017
@tracernz
Copy link
Member Author

tracernz commented Jul 3, 2017

@mlyle I dropped the commit which switched from newlib-nano to newlib.

@tracernz
Copy link
Member Author

tracernz commented Jul 3, 2017

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)
@d-ronin d-ronin deleted a comment from dronin-ci Jul 3, 2017
@tracernz
Copy link
Member Author

tracernz commented Jul 3, 2017

jenkins, build artifacts please

@@ -1,12 +1,12 @@
BOARD_TYPE := 0x94
BOARD_REVISION := 0x01
BOOTLOADER_VERSION := 0x87
BOOTLOADER_VERSION := 0x88
Copy link
Member

@yamahabest yamahabest Jul 3, 2017

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?

Copy link
Member

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 ;)

@dronin-ci
Copy link
Collaborator

Artifacts built, by request of @tracernz

@mlyle
Copy link
Member

mlyle commented Jul 3, 2017

OMG thanks.

@henn1001
Copy link
Collaborator

henn1001 commented Jul 4, 2017

thanks 👍

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

Successfully merging this pull request may close these issues.

5 participants