Skip to content

Commit

Permalink
[nrfconnect] Fixed storing root certificate during commissioning. (#7748
Browse files Browse the repository at this point in the history
)

In some specific cases like building on nRF5340 or nRF52840
with MCUboot enabled appears problem with storing key root
certificate to the NVS. That is because of the too small
settings storage size.

* Added config option for nRF5340 overlay increasing settings
size from 8kB to 32kB.
* Modified pm_static.yml file for nRF52840 to increase settings
size from 8kB to 32kB.
  • Loading branch information
kkasperczyk-no authored and pull[bot] committed Jul 12, 2021
1 parent 0ba9879 commit 1141008
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config/nrfconnect/app/overlay-dfu_support.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4
# External flash memory configuration
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
CONFIG_PM_EXTERNAL_FLASH_SIZE=0xf2000
CONFIG_PM_EXTERNAL_FLASH_SIZE=0xec000
CONFIG_PM_EXTERNAL_FLASH_BASE=0

# MCU Manager and SMP configuration
Expand Down
5 changes: 5 additions & 0 deletions examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake)

# Load NCS/Zephyr build system
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)

if (EXISTS boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

# TODO: temporary fix to remove after solving static addressing problem on nrf5340
if(${BOARD} STREQUAL "nrf5340dk_nrf5340_cpuapp")
list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-bt_private_addresses.conf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
#

CONFIG_XOROSHIRO_RANDOM_GENERATOR=y

CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/child_image/mcuboot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256
# External flash memory configuration
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
CONFIG_PM_EXTERNAL_FLASH_SIZE=0xf2000
CONFIG_PM_EXTERNAL_FLASH_SIZE=0xec000
CONFIG_PM_EXTERNAL_FLASH_BASE=0
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ mcuboot_pad:
size: 0x200
app:
address: 0xc200
size: 0xf1e00
size: 0xebe00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xc000
size: 0xf2000
size: 0xec000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xc200
size: 0xf1e00
size: 0xebe00
settings_storage:
address: 0xfe000
size: 0x2000
address: 0xf8000
size: 0x8000
region: flash_primary
mcuboot_secondary:
address: 0x0
size: 0xf2000
size: 0xec000
device: MX25R64
region: external_flash
external_flash:
address: 0xf2000
address: 0xec000
size: 0x0
device: MX25R64
region: external_flash
5 changes: 5 additions & 0 deletions examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake)

# Load NCS/Zephyr build system
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)

if (EXISTS boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

# TODO: temporary fix to remove after solving static addressing problem on nrf5340
if(${BOARD} STREQUAL "nrf5340dk_nrf5340_cpuapp")
list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-bt_private_addresses.conf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
#

CONFIG_XOROSHIRO_RANDOM_GENERATOR=y

CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000
2 changes: 1 addition & 1 deletion examples/lock-app/nrfconnect/child_image/mcuboot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256
# External flash memory configuration
CONFIG_PM_EXTERNAL_FLASH=y
CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64"
CONFIG_PM_EXTERNAL_FLASH_SIZE=0xf2000
CONFIG_PM_EXTERNAL_FLASH_SIZE=0xec000
CONFIG_PM_EXTERNAL_FLASH_BASE=0
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ mcuboot_pad:
size: 0x200
app:
address: 0xc200
size: 0xf1e00
size: 0xebe00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xc000
size: 0xf2000
size: 0xec000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xc200
size: 0xf1e00
size: 0xebe00
settings_storage:
address: 0xfe000
size: 0x2000
address: 0xf8000
size: 0x8000
region: flash_primary
mcuboot_secondary:
address: 0x0
size: 0xf2000
size: 0xec000
device: MX25R64
region: external_flash
external_flash:
address: 0xf2000
address: 0xec000
size: 0x0
device: MX25R64
region: external_flash

0 comments on commit 1141008

Please sign in to comment.