Closed gumulka closed 4 months ago
Hi @gumulka! We appreciate you submitting your first issue for our open-source project. 🌟
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙
@gumulka I confirm the ZEPHYR FATAL ERROR 26 with the condition you exposed, even with k_sleep(K_MSEC(10)); Could you please test the following patch on your own.
diff --git a/drivers/entropy/entropy_stm32.c b/drivers/entropy/entropy_stm32.c
index a9cbda2abc7..8bc79fdc898 100644
--- a/drivers/entropy/entropy_stm32.c
+++ b/drivers/entropy/entropy_stm32.c
@@ -112,6 +112,10 @@ static int entropy_stm32_suspend(void)
RNG_TypeDef *rng = dev_data->rng;
int res;
+#if defined(CONFIG_SOC_SERIES_STM32WBX) || defined(CONFIG_STM32H7_DUAL_CORE)
+ /* Prevent concurrent access with PM */
+ z_stm32_hsem_lock(CFG_HW_RNG_SEMID, HSEM_LOCK_WAIT_FOREVER);
+#endif /* CONFIG_SOC_SERIES_STM32WBX || CONFIG_STM32H7_DUAL_CORE */
LL_RNG_Disable(rng);
#ifdef CONFIG_SOC_SERIES_STM32WBAX
@@ -136,6 +140,10 @@ static int entropy_stm32_suspend(void)
res = clock_control_off(dev_data->clock,
(clock_control_subsys_t)&dev_cfg->pclken[0]);
+#if defined(CONFIG_SOC_SERIES_STM32WBX) || defined(CONFIG_STM32H7_DUAL_CORE)
+ z_stm32_hsem_unlock(CFG_HW_RNG_SEMID);
+#endif /* CONFIG_SOC_SERIES_STM32WBX || CONFIG_STM32H7_DUAL_CORE */
+
return res;
}
It fixes the error on my side.
*** Booting Zephyr OS build v3.6.0-3809-gf4e65af48c04 ***
[00:00:00.018,000] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.018,000] <inf> fs_nvs: alloc wra: 0, f80
[00:00:00.018,000] <inf> fs_nvs: data wra: 0, a0
[00:00:00.042,000] <inf> bt_hci_core: No ID address. App must call settings_load()
Bluetooth initialized
[00:00:00.044,000] <inf> bt_hci_core: Identity: 02:80:E1:00:00:00 (public)
[00:00:00.044,000] <inf> bt_hci_core: HCI: version 1.0b (0x00) revision 0xa072, manufacturer 0x0030
[00:00:00.044,000] <inf> bt_hci_core: LMP: version 1.0b (0x00) subver 0x2172
Advertising successfully started
Indicate VND attr 0x8018e20 (UUID 12345678-1234-5678-1234-56789abcdef1)
@FRASTM It also fixes the error on my side. Happy to see it getting merged into mainline!
@FRASTM It also fixes the error on my side. Happy to see it getting merged into mainline!
Great, I am preparing a PR
Describe the bug When using PM_DEVICE together with ENTROPY_GENERATOR on the STM32WB55 board, I get an BUS fault after a while.
The time until the bug occurs can vary, but it does occur after a few seconds every time.
I have tried the v3.6.0 and also mainline zephyr and both have the same error.
To Reproduce
I tried this with the nucleo_wb55rg devboard. To be precise MB1355D-01.
Enable
CONFIG_PM
,CONFIG_PM_DEVICE
andCONFIG_ENTROPY_GENERATOR
in the Bluetooth peripheral sample and wait a bit. I have speed up the process, by replacing the content of the while loop in main withk_sleep(K_MSEC(2));
patch for this
compile and flash with:
Expected behavior No bus fault.
Impact Not sure yet, will have to see. Currently annoyance.
Logs and console output
Log output:
Time until bus fault occurs can vary. With 2ms sleep I have seen between 0.036 and 2.500 seconds in the logs.
Backtrace from gdb with zephyr v3.6.0:
Environment (please complete the following information):