-
Notifications
You must be signed in to change notification settings - Fork 697
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: Add check for unexpected flash sector size #2059
Conversation
41f7c97
to
4cf4f32
Compare
It should also check the program size (not only the sector size). |
That's already done at runtime |
Prints a debug log message if the device has a write block size for a flash device in DTS that is not the same as what the flash driver reports at run-time, this can be used to see if there is a faulty configuration as these compile-time values are used for various calculations Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Right I see what you mean, have added it |
Adds write block size checking functionality and includes a zephyr implementation, this will not throw an error or prevent upgrade but will emit a debug log with a discrepency message Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds notes on these new features Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This does not support configurations with external mem, right? Because with external mem there is no |
It does, but it is driver dependent, for example one of the nxp ones had a write block size of 8 in dts which was wrong, and something like spi-nor might have a value in dts if it uses static configuration or nothing if it uses sfdp |
Bindings for spi-nor and qspi-nor does not provide definition of write-block-size, it is provided via Kconfig option, so only via simplified or run-time sfdp. There is though |
Bad name, but this spi nor driver is what I mean: https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/nxp/mimxrt1020_evk/mimxrt1020_evk.dts#L104 |
OK, that is new to me as there is not such definition in dts bindings for the compatible. |
This change broke mcuboot usage on STM32F2, STM32F4 and STM32F7 series in which use sectors of variable sizes. On these series, erase-block-size depends on sector size and then cannot be defined in flash controller parent. |
This change specifically? I can configure for
|
Ok, fair enough. Let me reword: This change is not compatible with bla bla bla |
Probably, CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n should be set in STM32F2, STM32F4 and STM32F7 configuration files. |
Prints a debug log message if the device has a write block size for a flash device in DTS that is not the same as what the flash driver reports at run-time, this can be used to see if there is a faulty configuration as these compile-time values are used for various calculations
@butok