zephyr: STM32WB55 Bus Fault when connecting then disconnecting then connecting then disconnecting then connecting
STM32WB55 Bus Fault when connecting then disconnecting then connecting then disconnecting then connecting.
I’m using nRF Connect for Mobile to connect to the STM32WB55.
Referenses:
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=n
CONFIG_TINYCRYPT=y
CONFIG_BT_DEVICE_NAME="Simple App"
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_APPEARANCE=0
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_AUTO_PHY_UPDATE=n
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
#include <stdbool.h>
#include <zephyr/types.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/services/bas.h>
BT_GATT_SERVICE_DEFINE(ess_svc,
BT_GATT_PRIMARY_SERVICE(BT_UUID_ESS),
);
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_GAP_APPEARANCE, 0x00, 0x03),
};
static void connected(struct bt_conn *conn, uint8_t err)
{
if (err) {
printk("Connection failed (err 0x%02x)\n", err);
} else {
printk("Connected\n");
}
}
static void disconnected(struct bt_conn *conn, uint8_t reason)
{
printk("Disconnected (reason 0x%02x)\n", reason);
}
BT_CONN_CB_DEFINE(conn_callbacks) = {
.connected = connected,
.disconnected = disconnected,
};
static void bt_ready(void)
{
int err;
printk("Bluetooth initialized\n");
err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
if (err) {
printk("Advertising failed to start (err %d)\n", err);
return;
}
printk("Advertising successfully started\n");
}
void main(void)
{
int err;
err = bt_enable(NULL);
if (err)
{
printk("Bluetooth init failed (err %d)\n", err);
return;
}
bt_ready();
while (1)
{
k_sleep(K_SECONDS(1));
}
}
*** Booting Zephyr OS build v3.2.0-rc3-24-g8364715998c9 ***
Bluetooth initialized
Advertising successfully started
[00:00:00.346,000] [0m<inf> bt_hci_core: Identity: 02:80:E1:00:00:00 (public)[0m
[00:00:00.346,000] [0m<inf> bt_hci_core: HCI: version 5.0 (0x09) revision 0x0026, manufacturer 0x00
30[0m
[00:00:00.346,000] [0m<inf> bt_hci_core: LMP: version 5.0 (0x09) subver 0x2126[0m
Connected
[00:00:07.251,000] [1;33m<wrn> bt_hci_core: opcode 0x2016 status 0x3a[0m
[00:00:07.251,000] [1;31m<err> bt_hci_core: Failed read remote features (-5)[0m
Disconnected (reason 0x13)
Connected
[00:00:15.788,000] [1;33m<wrn> bt_hci_core: opcode 0x2016 status 0x3a[0m
[00:00:15.788,000] [1;31m<err> bt_hci_core: Failed read remote features (-5)[0m
Disconnected (reason 0x13)
Connected
[00:00:19.577,000] [1;33m<wrn> bt_hci_core: opcode 0x2016 status 0x3a[0m
[00:00:19.577,000] [1;31m<err> bt_hci_core: Failed read remote features (-5)[0m
[00:00:20.166,000] [1;31m<err> os: ***** BUS FAULT *****[0m
[00:00:20.166,000] [1;31m<err> os: Imprecise data bus error[0m
[00:00:20.166,000] [1;31m<err> os: r0/a1: 0x200018e0 r1/a2: 0x200300d8 r2/a3: 0x2003d238[0m
[00:00:20.166,000] [1;31m<err> os: r3/a4: 0x00000000 r12/ip: 0x00000000 r14/lr: 0x08001ce7[0m
[00:00:20.166,000] [1;31m<err> os: xpsr: 0x61000000[0m
[00:00:20.166,000] [1;31m<err> os: Faulting instruction address (r15/pc): 0x08001ce6[0m
[00:00:20.166,000] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m
[00:00:20.166,000] [1;31m<err> os: Current thread: 0x200012b8 (unknown)[0m
[00:00:20.237,000] [1;31m<err> os: Halting system[0m
After the last Connected using nRF Connect for Mobile it fails to connect.
Modifying the prj.conf like removing CONFIG_BT_BAS=y can stop zephyr log from printing the BUS FAULT but still after 3rd connection the nRF Connect for Mobile will refuse to connect to STM32WB55.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (9 by maintainers)
@erwango New ticket here https://github.com/zephyrproject-rtos/zephyr/issues/68747