Skip to content

soc_flash_nrf: flash_write timeout after bt_disable #91428

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

Closed
1 task
marcowidmer opened this issue Jun 11, 2025 · 0 comments · Fixed by #91430
Closed
1 task

soc_flash_nrf: flash_write timeout after bt_disable #91428

marcowidmer opened this issue Jun 11, 2025 · 0 comments · Fixed by #91430
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@marcowidmer
Copy link
Collaborator

Describe the bug

With CONFIG_SOC_FLASH_NRF_RADIO_SYNC_TICKER=y, calling flash_write() after bt_disable() returns -ETIMEDOUT.

This is because the flash driver wants to sync with the BLE ticker (nrf_flash_sync_is_required() returns true), but the ticker is not being triggered because bluetooth is disabled.

Regression

  • This is a regression.

Steps to reproduce

Run the following sample on the NRF52:

#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/storage/flash_map.h>

#define TEST_PARTITION storage_partition

#define TEST_PARTITION_OFFSET FIXED_PARTITION_OFFSET(TEST_PARTITION)
#define TEST_PARTITION_DEVICE FIXED_PARTITION_DEVICE(TEST_PARTITION)

void main(void)
{
	const struct device *flash_dev = TEST_PARTITION_DEVICE;
	const uint32_t data = 0xdeadbeef;
	int err;

	bt_enable(NULL);
	bt_disable();

	printk("Writing to flash...\n");
	err = flash_write(flash_dev, TEST_PARTITION_OFFSET, &data, sizeof(data));
	printk("Result = %d\n", err);
}

Relevant log output

Writing to flash...
Result = -116

Impact

Functional Limitation – Some features not working as expected, but system usable.

Environment

Zephyr 4.1

Additional Context

No response

@marcowidmer marcowidmer added the bug The issue is a bug, or the PR is fixing a bug label Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant