Skip to content
Commit a923c2f1 authored by Michael Scott's avatar Michael Scott Committed by Jukka Rissanen
Browse files

net: openthread: fix off-by-one error in settings offset calculation

OpenThread uses CONFIG_OT_PLAT_FLASH_PAGES_COUNT to calculate the # of
pages at the end of flash to use for storing OpenThread settings.

This calculation has an off-by-one error which sets the offset for
the storage area as 1 page of flash too low.

For example, on nRF52840:
- default setting for CONFIG_OT_PLAT_FLASH_PAGES_COUNT is 4
- flash size is 1MB (0x100000)
- flash page size is 4096 (0x1000)
- expected offset is 0xfc000

Using the current logic we get an offset of: 0xfb000

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16339



Signed-off-by: default avatarMichael Scott <mike@foundries.io>
parent 0d4290a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment