Describe the bug
We are running a ble sample with following KConfigs:
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
The code execution is blocked in the bt_settings_init() function, which is called by the bt_enable() function. The flash_write() function, called during bt_settings_init(), does not return.
After investigation it appears that the problem is in the Flash Manager of the Flash driver for STM32WBAx (flash_stm32wba_fm.c) : When flash_write() driver function is called, a Flash Write operation is requested and once the operation is complete, flash_write() exits.
The Flash operation request is done thanks to a k_work_submit_to_queue() function is called.
But our test scenario, the k_work_submit_to_queue() function returns a -ENODEV. So, the operation is never handled and flash_write() driver function is blocked.
The k_work_submit_to_queue() function returns a -ENODEV because the queue parameter has not been started yet. In fact, the queue is initialized during the bluetooth driver open operation because this queue is shared with bluetooth process.
Regression
Steps to reproduce
No response
Relevant log output
Impact
Annoyance – Minor irritation; no significant impact on usability or functionality.
Environment
No response
Additional Context
No response
Describe the bug
We are running a ble sample with following KConfigs:
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
The code execution is blocked in the bt_settings_init() function, which is called by the bt_enable() function. The flash_write() function, called during bt_settings_init(), does not return.
After investigation it appears that the problem is in the Flash Manager of the Flash driver for STM32WBAx (flash_stm32wba_fm.c) : When flash_write() driver function is called, a Flash Write operation is requested and once the operation is complete, flash_write() exits.
The Flash operation request is done thanks to a k_work_submit_to_queue() function is called.
But our test scenario, the k_work_submit_to_queue() function returns a -ENODEV. So, the operation is never handled and flash_write() driver function is blocked.
The k_work_submit_to_queue() function returns a -ENODEV because the queue parameter has not been started yet. In fact, the queue is initialized during the bluetooth driver open operation because this queue is shared with bluetooth process.
Regression
Steps to reproduce
No response
Relevant log output
Impact
Annoyance – Minor irritation; no significant impact on usability or functionality.
Environment
No response
Additional Context
No response