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

zephyr: restore device tree overlay #604

Merged
merged 1 commit into from Dec 5, 2019
Merged

zephyr: restore device tree overlay #604

merged 1 commit into from Dec 5, 2019

Conversation

SuperPrower
Copy link
Contributor

@SuperPrower SuperPrower commented Dec 3, 2019

0e3fa72 removed device tree overlay that configures Zephyr to link mcuboot at the beginning of the flash, and CMake variable that pointed to it (required for Zephyr). This resulted in mcuboot not being linked at some offset, rendering it unable to boot. Restore overlay and required code.

Without it, Zephyr will use zephyr,code-partition configuration from board device tree that usually points to the slot0_partition. This behaviour is due to the CONFIG_USE_CODE_PARTITION being used in MCUboot's configuration for Zephyr.

Fixes #601.

Signed-off-by: Sergey Koziakov dya.eshshmai@gmail.com

0e3fa72 removed device tree overlay
that is required to flash mcuboot to correct partition and CMake
variable that pointed to it. Restore it.

Do not restore adding "boards/${BOARD}.overlay" to the list since Zephyr
detects this file automatically now - see https://docs.zephyrproject.org/latest/application/index.html#devicetree-overlays

Signed-off-by: Sergey Koziakov <dya.eshshmai@gmail.com>
@mbolivar
Copy link

mbolivar commented Dec 3, 2019

Do not restore adding "boards/${BOARD}.overlay" to the list since Zephyr
detects this file automatically now

I believe this is incorrect. It only detects it automatically if DTC_OVERLAY_FILE is not already set. See this comment for a fuller description: #577 (review)

@mbolivar
Copy link

mbolivar commented Dec 3, 2019

This is exactly what I was talking about when I say I wish the Zephyr behavior were additive instead of mutually exclusive.

@SuperPrower
Copy link
Contributor Author

@mbolivar , yes, you are correct. I am unfamiliar with changes of Zephyr functionality and assumed that mentioned part was added because previously Zephyr didn't automatically scan for the board-specific overlay.
I can edit the commit message to make it more correct if you believe this is required.

@mbolivar
Copy link

mbolivar commented Dec 3, 2019

I more meant that the BOARD.overlay behavior is desirable.

@d3zd3z
Copy link
Member

d3zd3z commented Dec 3, 2019

We do need to do something, though. Right now, Zephyr doesn't build correctly, because there is no overlay, and it goes in the wrong partition? We do need a general overlay file that is used for all MCUboot targets, in order to set the default partition.

@mbolivar
Copy link

mbolivar commented Dec 4, 2019

Then I think there's no choice but to implement the desired "additive" logic by hand before including the boilerplate file.

Copy link
Member

@d3zd3z d3zd3z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with doing it this way. At least it restores Zephyr builds.

@d3zd3z
Copy link
Member

d3zd3z commented Dec 4, 2019

@mbolivar Are you ok with this approach for now?

@mbolivar
Copy link

mbolivar commented Dec 5, 2019

@mbolivar Are you ok with this approach for now?

No objections from me on any of this, just chiming in with information I thought might be relevant

@d3zd3z d3zd3z merged commit 24d1be0 into mcu-tools:master Dec 5, 2019
@SuperPrower SuperPrower deleted the restore_overlay branch December 5, 2019 10:49
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

Successfully merging this pull request may close these issues.

zephyr: mcuboot is not being linked to the boot partition
3 participants