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

Partition Manager external flash mcuboot/thingy53 #9169

Merged
merged 2 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/partition_manager.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ if (DEFINED ext_flash_dev)
SIZE ${num_bytes}
BASE ${CONFIG_PM_EXTERNAL_FLASH_BASE}
PLACEMENT start_to_end
DEVICE ${ext_flash_dev}
DEVICE "DT_CHOSEN(nordic_pm_ext_flash)"
sigvartmh marked this conversation as resolved.
Show resolved Hide resolved
DEFAULT_DRIVER_KCONFIG ${external_flash_driver_kconfig}
)
endif()
Expand Down
4 changes: 4 additions & 0 deletions doc/nrf/releases/release-notes-changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ This section provides detailed lists of changes by :ref:`script <scripts>`.

* Updated the :file:`ncs/nrf/subsys/partition_manager/pm.yml.pgps` file to place P-GPS partition in external flash when so configured.

* Fixed:

* Fixed an issue with the driver and devicetree symbol for the external flash memory where the driver was sometimes NULL, even if the DT node was chosen.

MCUboot
=======

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Copy link
Contributor

@Damian-Nordic Damian-Nordic Nov 21, 2022

Choose a reason for hiding this comment

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

Does it need to be copied to other Matter samples as well? What has changed recently given that it wasn't necessary in the past?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It probably should be done in a lot of places. I did it here hoping to fix the CHIP door lock tests that were failing, and it seems to have worked.

Basically, it needs to be done if using external flash as one of the slots for MCUboot.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, but it used to not be needed somehow. Is it a regression then?

Copy link
Contributor Author

@oyvindronningstad oyvindronningstad Nov 23, 2022

Choose a reason for hiding this comment

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

It's basically been lucky. Except when the app is non-secure, then it has silently failed. I don't know the details about how it fails. It seems the only test that was failing was the door lock one, so maybe we can merge this, and I can open a PR that changes more samples. @tejlmand could you comment? How important is it to add the chosen to all the samples that use ext_flash and mcuboot?

Copy link
Contributor

Choose a reason for hiding this comment

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

My point is that if this test has failed because of your change then probably other samples will fail on nightly as well. In the integration test suite we may not cover all samples. So it's good to understand which apps must be updated and update them all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tejlmand or should I instead create a pm_ext_flash.overlay and do:

  if (CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY)
    add_overlay_dts(
      mcuboot
      ${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/pm_ext_flash.overlay
      )
  endif()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Damian-Nordic @tejlmand I added overlay files to a number of samples now

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@markaj-nordic markaj-nordic Nov 24, 2022

Choose a reason for hiding this comment

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

@oyvindronningstad Don't we need also to align matter/window_covering and applications/matter_weather_station?

* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
11 changes: 1 addition & 10 deletions scripts/partition_manager_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ def get_header_guard_end(filename):
DEST_HEADER = 1
DEST_KCONFIG = 2

# If nl is something like /soc/peripheral@50000000/qspi@2b000/mx25r6435f@0, it will be
# converted to C define for node, in this example
# DT_N_S_soc_S_peripheral_50000000_S_qspi_2b000_S_mx25r6435f_0.
# If it is just node label, something like flash_sim0, it will just return that.
def dt_device_node_label_or_node(nl):
out = nl.replace('/', "_S_").replace('@', '_' )
if (out != nl):
out = f"DT_N{out}"
return out

def get_config_lines(gpm_config, greg_config, head, split, dest, current_domain=None):
config_lines = list()
Expand Down Expand Up @@ -86,7 +77,7 @@ def add_line(text_before_split, text_after_split):

if dest is DEST_HEADER:
if partition_has_device(partition):
add_line(f'{name_upper}_DEV', dt_device_node_label_or_node(region['device']))
add_line(f'{name_upper}_DEV', region['device'])
if region['default_driver_kconfig']:
add_line(f'{name_upper}_DEFAULT_DRIVER_KCONFIG', region['default_driver_kconfig'])

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};