-
Notifications
You must be signed in to change notification settings - Fork 681
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
boot: zephyr: common defaults, remove arbitrary disables #2015
base: main
Are you sure you want to change the base?
Changes from all commits
f8c03cf
fb7ac6c
f3faa8e
b1d5fe2
dad039d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -382,12 +382,16 @@ config BOOT_ENCRYPTION_KEY_FILE | |
|
||
config BOOT_MAX_IMG_SECTORS | ||
int "Maximum number of sectors per image slot" | ||
default 512 if $(dt_nodelabel_reg_size_int,slot0_partition) > 1048576 | ||
default 256 if $(dt_nodelabel_reg_size_int,slot0_partition) > 524288 | ||
default 128 | ||
help | ||
This option controls the maximum number of sectors that each of | ||
the two image areas can contain. Smaller values reduce MCUboot's | ||
memory usage; larger values allow it to support larger images. | ||
If unsure, leave at the default value. | ||
If unsure, leave at the default value. The required condition is | ||
that (IMAGE_SIZE <= (BOOT_MAX_IMG_SECTORS * SECTOR_SIZE)). The | ||
defaults are configured for a SECTOR_SIZE of 4096. | ||
|
||
config BOOT_SHARE_BACKEND_AVAILABLE | ||
bool | ||
|
@@ -748,8 +752,8 @@ comment "Zephyr configuration options" | |
config MULTITHREADING | ||
default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING | ||
default y if BOOT_USB_DFU_GPIO || BOOT_USB_DFU_WAIT | ||
default n if SOC_FAMILY_NORDIC_NRF | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm against. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like I'm going in circles on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it better that a user knows the impact of their choice other than having a default which increase the footprint by default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zephyr is overflowing with defaults that are not 100% size optimized in the name of making more situations work by default. Search for any Kconfig with the |
||
default n if SOC_FAMILY_ESPRESSIF_ESP32 && MCUBOOT | ||
default n if SOC_SERIES_NRF51X # Minimal flash available | ||
default y | ||
|
||
config LOG_PROCESS_THREAD | ||
|
@@ -782,4 +786,13 @@ config MCUBOOT_VERIFY_IMG_ADDRESS | |
also be useful when BOOT_DIRECT_XIP is enabled, to ensure that the image | ||
linked at the correct address is loaded. | ||
|
||
# When used with MCUboot, the external flash page size must match | ||
# the internal SoC flash page size, which is 4096 for Nordic MCUs. | ||
configdefault NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can NORDIC specific configuration moved from the generic to nordic-specific files? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah maybe this could moved into a specific Kconfig.nrf file which is included when using a nRF file? |
||
default 4096 | ||
# Use a slightly larger default value for stack writes that is unlikely | ||
# to lead to any stack overflows. | ||
configdefault NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE | ||
default 32 | ||
|
||
source "Kconfig.zephyr" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# Disable Zephyr console | ||
CONFIG_CONSOLE=n | ||
|
||
# MCUBoot settings | ||
CONFIG_BOOT_MAX_IMG_SECTORS=256 | ||
|
||
# MCUboot serial recovery | ||
CONFIG_MCUBOOT_SERIAL=y | ||
|
||
CONFIG_MULTITHREADING=y |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# Disable Zephyr console | ||
CONFIG_CONSOLE=n | ||
|
||
# MCUBoot settings | ||
CONFIG_BOOT_MAX_IMG_SECTORS=256 | ||
|
||
# MCUboot serial recovery | ||
CONFIG_MCUBOOT_SERIAL=y | ||
|
||
CONFIG_MULTITHREADING=y |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# Disable Zephyr console | ||
CONFIG_CONSOLE=n | ||
|
||
# MCUBoot settings | ||
CONFIG_BOOT_MAX_IMG_SECTORS=256 | ||
|
||
# MCUboot serial recovery | ||
CONFIG_MCUBOOT_SERIAL=y | ||
|
||
CONFIG_MULTITHREADING=y |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# Disable Zephyr console | ||
CONFIG_CONSOLE=n | ||
|
||
# MCUBoot settings | ||
CONFIG_BOOT_MAX_IMG_SECTORS=256 | ||
|
||
# MCUboot serial recovery | ||
CONFIG_MCUBOOT_SERIAL=y | ||
|
||
CONFIG_MULTITHREADING=y |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default value calculation is a good idea.
If you add it as a separate PR, it should be no complains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this really does not work well, for example a 2MiB stm32 device with 128 or 256KiB sectors here needs a value of 12 or 6 really, but would have a value of 512...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Sector size is missed :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work better than the current solution? Sector size is not exposed to the build or configuration system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately without a sector size it has no big sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So moving from:
to:
isn't valuable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Platforms have different sector sizes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created #2019 though I've tested it on one device - nrf52840dk, it gets 118 which is about right. Haven't actually flashed it to test. It will also probably be slightly wrong if someone has a larger slot0 than slot1 using swap using move, but that would be 2 sectors it'd be out by