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

Multi image #71

Merged
merged 22 commits into from
Dec 12, 2019
Merged

Multi image #71

merged 22 commits into from
Dec 12, 2019

Conversation

tejlmand
Copy link
Contributor

@tejlmand tejlmand commented Nov 15, 2019

Update:
The PR now uses a series of reverts, and the reapplies the needed patches.

Copy link
Contributor

@SebastianBoe SebastianBoe left a comment

Choose a reason for hiding this comment

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

NACK

WIP

@mbolivar
Copy link

* It can be discussed if the changes introduced above should instead be applied as edits on the original commits, in order to reduce the size of the patch set to carry around.

In order to keep the 'west ncs-loot' output accurate and thus the next rebase clean, it would be better to see a revert + reapply style patch series. But if that is too complex, we can defer for now and clean up a bit during the rebase.

By the way, the revert+reapply rules are basically just a way to maintain a quilt patch stack in git.

@tejlmand
Copy link
Contributor Author

* It can be discussed if the changes introduced above should instead be applied as edits on the original commits, in order to reduce the size of the patch set to carry around.

In order to keep the 'west ncs-loot' output accurate and thus the next rebase clean, it would be better to see a revert + reapply style patch series. But if that is too complex, we can defer for now and clean up a bit during the rebase.

By the way, the revert+reapply rules are basically just a way to maintain a quilt patch stack in git.

Will do that.
Not difficult at all, I was just wondering what strategy you preferred.
And now that I know, I will follow that principle ;-)

@tejlmand
Copy link
Contributor Author

tejlmand commented Nov 19, 2019

By the way, the revert+reapply rules are basically just a way to maintain a quilt patch stack in git.

@mbolivar had to revert a series of patches to get down to the [nrf noup] 0fa1f04 without to avoid a lot of merge conflicts and keeping history nice.
Then I reapplied all needed patches again.

Let me know if this has been done in desired way.

@mbolivar
Copy link

Let me know if this has been done in desired way.

I had to hack up zephyr/west.yml a bit to use ncs-loot with it since mcuboot is not in the upstream manifest yet, but with that done, here is the resulting list of OOT patches:

- 65b76e3cbea653b275d22a162a10faf178588cea [nrf noup] zephyr: Remove duplication from Kconfig and cmake
- 4bcdaaddbfa9022c96aa81288fe6df2e65e34503 [nrf noup] boot: bootutil: Add shared crypto functions for ECDSA
- 0fa1f04f8b43bcce1fe84e314c194f2ff6d28219 [nrf noup] cmake: multi-image + partition manager
- df29916e333de18880f69209194f8a5214cd1f22 [nrf toup] bootutil: silence spurious GCC warning
- 6b3540266ed26e09ad9563402a07c4958471be77 [nrf toup] fix documentation build
- 7fedf1d1887e58354e43240fb0813c501adc0882 [nrf fromlist] cmake: image-ify DTC_OVERLAY_FILE
- 0f73241f0f96db5bfe3150d1dd03c0aba296054b [nrf toup] cmake: make update.hex without trailer data
- cfe07dab6fc5cbf3d1aee5e7e3705c3f4ffbde79 [nrf toup] kconfig: use template for partition manager config
- 74d2f039cba394c4b368c078625b442835707db0 [nrf noup] boot/zephyr: pm adaptation after macro updates
- b67ab0f792e73f3ba96a47d0f1ac55630289bc8b [nrf toup] cmake: use function for signing application
- 73f46d1e21fc45be2dbe59ab487ab53971f037b4 [nrf toup] cmake: sign s0 and s1 with mcuboot's imgtool
- 46edf6b36fc36c5ed73d5b25aa49d6c8a34fddcc [nrf toup] partition_manager: add partition alignment
- e1e545899f3342c08aec1c4ea43cde686e9c3a60 [nrf noup] cmake: inject kconfig from mcuboot cmakelist
- 3892cda9d33ce00bf849c0bb8651fb0e4d5689ba [nrf noup] zephyr: add NCS application boilerplate
- a5cffec803ac18766dfd8c4613e7a164265a11d7 [nrf toup] zephyr: enable progressive erase for nRF9160
- d46e7d083f16f17ec354a9e8d246bd754a805bc8 [nrf toup] zephyr: add support for Thingy:91
- 3db81a20bc4617c435a89732ed3f3cbd122c3595 [nrf noup] loader: support B0 -> B1 (S0 - S1) configuration
- a631263274e7220e008138e7f26c2d35bbcb2203 [nrf noup] bootutil: nrf_cc310: Bugfix for CC310 and shared crypto API

(I stripped out ones with a ci: area).

Does that look like what you want to see?

@SebastianBoe SebastianBoe force-pushed the multi_image branch 3 times, most recently from cb04f10 to b1b42cf Compare December 5, 2019 11:16
tejlmand and others added 13 commits December 12, 2019 14:20
This reverts commit 7fedf1d.

Signed-off-by: Torsten Rasmussen <[email protected]>
This reverts commit 0fa1f04.

Signed-off-by: Torsten Rasmussen <[email protected]>
- Upstream PR#430, plus various fixes from the v1.0.0 development
  cycle.  This added support for being built as a sub image from the
  downstream Nordic patch set for a zephyr multi image build system.

- Downstream partition manager support, plus bug fixes from the v1.0.0
  dev cycle.

  Partition Manager is a component which uses yaml files to resolve
  flash placement with a wholistic view of the device.

Over time, these formerly separate downstream patch series grew
increasingly intertwined after the initial rejection of the upstream
multi-image patch set. This represents the results which roughly
appeared in NCS v1.0.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
Signed-off-by: Øyvind Rønningstad <[email protected]>
Signed-off-by: Sebastian Bøe <[email protected]>
Signed-off-by: Sigvart Hovland <[email protected]>
Signed-off-by: Marti Bolivar <[email protected]>
(cherry picked from commit 0e68ab4)
(cherry picked from commit 6168414)
(cherry picked from commit d62e189)
(cherry picked from commit a4db98d)
(cherry picked from commit b6d3687)
(cherry picked from commit 4b91989)
(cherry picked from commit edc8dc6)
(cherry picked from commit 289f108)
(cherry picked from commit 447495f)
(cherry picked from commit 8cb0e49)
(cherry picked from commit 4a61a17)
(cherry picked from commit 8b0e50c)
(cherry picked from commit 545e2c0)
(cherry picked from commit 0fa1f04)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
Need to rework flash area labels after upstream made them
parametric macro.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
(cherry picked from commit 1e0e56e)
(cherry picked from commit 74d2f03)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
Add support for configurations where there exists two primary slots
but only one secondary slot, which is shared. These two primary slots
are the regular application and B1. B1 can be either S0 or S1
depending on the state of the device.

Decide where an upgrade should be stored by looking at the vector
table.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit f0d3579)
(cherry picked from commit 3db81a2)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
hakonfam and others added 9 commits December 12, 2019 14:23
Leverage the kconfig template functionality to have cleaner
Kconfig code which is also less error prone.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit 0ccf475)
(cherry picked from commit cfe07da)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
This is needed for serial recovery to work using hex files.
Prior to this the update.hex got TLV data at the end of the
partition, which caused many blank pages to be included,
which made it hard to use in a serial recovery scheme.

Instead, make update.hex without TLV data at the end,
and provide a new file test_update.hex which contains
the TLV data, and can be directly flashed to test the
upgrade procedure.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit 424c716)
(cherry picked from commit 0f73241)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
This to be future proof when other components will be signed as well

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit 22da2d2)
(cherry picked from commit b67ab0f)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
Provide update candidates for both s0 and s1.
These candidates must be signed with mcuboot after being signed
by b0.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit 57a219e)
(cherry picked from commit 73f46d1)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
Previously this injection took place earlier in the build process,
resulting in menuconfig data being overwritten.

By moving the injection here, the menuconfig data is not
overwritten.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit 45e7a24)
(cherry picked from commit e1e5458)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
All partitions used by mcuboot must be page size aligned.
Leverage newly added alignment feature to enforce this.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
(cherry picked from commit d65666f)
(cherry picked from commit 46edf6b)
Signed-off-by: Martí Bolívar <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
Align with upstream by not checking the board, this patch will
disappear on the next upmerge.

Signed-off-by: Sebastian Bøe <[email protected]>
It is no longer possible to directly evaluete DT_ within CMakeList,
instead intermediate variable defined within Kconfig needs to be
used.

Signed-off-by: Dominik Ermel <[email protected]>
This partition is not used by mcuboot, remove it.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
@SebastianBoe SebastianBoe merged commit 0b59f48 into nrfconnect:master Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants