Skip to content

Commit 6935a4b

Browse files
cvinayakdanieldegrasse
authored andcommitted
Bluetooth: Controller: nRF54Lx: Flash sync restrict to one iteration
Write operations are not constant time on nRF54Lx SoCs and depend on the previous value present versus new value to be written. Hence, perform no more than one iteration. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent ae198b8 commit 6935a4b

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

subsys/bluetooth/controller/flash/soc_flash_nrf_ticker.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,24 @@ void nrf_flash_sync_get_timestamp_begin(void)
250250

251251
bool nrf_flash_sync_check_time_limit(uint32_t iteration)
252252
{
253-
uint32_t ticks_diff;
253+
if (IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF54LX)) {
254+
/* Write operations are not constant time depending on the previous value present
255+
* versus new value to be written. Hence, perform no more than one iteration.
256+
*/
257+
258+
ARG_UNUSED(iteration);
254259

255-
ticks_diff = ticker_ticks_diff_get(ticker_ticks_now_get(),
256-
_ticker_sync_context.ticks_begin);
257-
if (ticks_diff + ticks_diff/iteration >
258-
HAL_TICKER_US_TO_TICKS(_ticker_sync_context.slot)) {
259260
return true;
260-
}
261+
} else {
262+
uint32_t ticks_diff;
261263

262-
return false;
264+
ticks_diff = ticker_ticks_diff_get(ticker_ticks_now_get(),
265+
_ticker_sync_context.ticks_begin);
266+
if (ticks_diff + ticks_diff/iteration >
267+
HAL_TICKER_US_TO_TICKS(_ticker_sync_context.slot)) {
268+
return true;
269+
}
270+
271+
return false;
272+
}
263273
}

0 commit comments

Comments
 (0)