You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/07/31 02:29:34 UTC
[incubator-nuttx] branch master updated (cf594b2c81 -> ec59125ad3)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
from cf594b2c81 stm32wb/mbox: renaming msg_buf->cmd_buf
new 9db4caca1d stm32wb/nimble: workaround for unsupported HCI command
new bbdcb82f18 boards/stm32wb/nimble: adding nimble config
new 30a80a390d stm32wb/ble: disable default CPU2 host config option
new ec59125ad3 stm32wb/mbox: fixing ACL transmit buffer
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
arch/arm/src/stm32wb/Kconfig | 6 +-
arch/arm/src/stm32wb/stm32wb_blehci.c | 73 ++++++++++++++++++----
arch/arm/src/stm32wb/stm32wb_mbox.c | 2 +-
boards/arm/stm32wb/nucleo-wb55rg/README.txt | 8 +++
.../configs/{ble => nimble}/defconfig | 6 +-
5 files changed, 78 insertions(+), 17 deletions(-)
copy boards/arm/stm32wb/nucleo-wb55rg/configs/{ble => nimble}/defconfig (92%)
[incubator-nuttx] 04/04: stm32wb/mbox: fixing ACL transmit buffer
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit ec59125ad30d84d5d0cef241ed29b9ab51b69d1a
Author: Sergey Nikitenko <s....@me.com>
AuthorDate: Sat Jul 30 20:21:41 2022 +0300
stm32wb/mbox: fixing ACL transmit buffer
---
arch/arm/src/stm32wb/stm32wb_mbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/src/stm32wb/stm32wb_mbox.c b/arch/arm/src/stm32wb/stm32wb_mbox.c
index bac2711dcb..f99a175594 100644
--- a/arch/arm/src/stm32wb/stm32wb_mbox.c
+++ b/arch/arm/src/stm32wb/stm32wb_mbox.c
@@ -677,7 +677,7 @@ void stm32wb_mboxinitialize(stm32wb_mbox_evt_handler_t evt_handler)
g_bleacl_channel.ch_num = STM32WB_MBOX_BLEACL_CHANNEL;
g_bleacl_channel.cmd_buf = (struct stm32wb_mbox_cmd_s *)
- stm32wb_mbox_shared.ble_cmd_buffer;
+ stm32wb_mbox_shared.ble_acl_buffer;
stm32wb_mbox_list_initialize(&g_bleacl_channel.cmd_buf_queue);
#endif
[incubator-nuttx] 02/04: boards/stm32wb/nimble: adding nimble config
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit bbdcb82f1887f3373ad1b1447e8c6f62012b2f79
Author: Sergey Nikitenko <s....@me.com>
AuthorDate: Sat Jul 30 18:48:38 2022 +0300
boards/stm32wb/nimble: adding nimble config
---
boards/arm/stm32wb/nucleo-wb55rg/README.txt | 8 +++
.../stm32wb/nucleo-wb55rg/configs/nimble/defconfig | 57 ++++++++++++++++++++++
2 files changed, 65 insertions(+)
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/README.txt b/boards/arm/stm32wb/nucleo-wb55rg/README.txt
index f9fc90530e..1e7834e8cf 100644
--- a/boards/arm/stm32wb/nucleo-wb55rg/README.txt
+++ b/boards/arm/stm32wb/nucleo-wb55rg/README.txt
@@ -67,3 +67,11 @@ Configurations
Besides the NuttShell this configuration also enables BLE support.
It includes btsak application for testing BLE applications.
+
+ nimble:
+
+ Besides the NuttShell it includes nimble example application which
+ uses NimBLE host stack.
+
+ nsh> ifup bnep0
+ nsh> nimble
diff --git a/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig b/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig
new file mode 100644
index 0000000000..d674a490e4
--- /dev/null
+++ b/boards/arm/stm32wb/nucleo-wb55rg/configs/nimble/defconfig
@@ -0,0 +1,57 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_NET_IPv4 is not set
+# CONFIG_WIRELESS_BLUETOOTH_HOST is not set
+CONFIG_ALLOW_BSD_COMPONENTS=y
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD="nucleo-wb55rg"
+CONFIG_ARCH_BOARD_NUCLEO_WB55RG=y
+CONFIG_ARCH_CHIP="stm32wb"
+CONFIG_ARCH_CHIP_STM32WB55RG=y
+CONFIG_ARCH_CHIP_STM32WB=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_BOARD_LOOPSPERMSEC=6500
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DRIVERS_BLUETOOTH=y
+CONFIG_DRIVERS_WIRELESS=y
+CONFIG_FS_PROCFS=y
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INTELHEX_BINARY=y
+CONFIG_NET=y
+CONFIG_NET_BLUETOOTH=y
+CONFIG_NET_STATISTICS=y
+CONFIG_NIMBLE=y
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_PTHREAD_MUTEX_TYPES=y
+CONFIG_RAM_SIZE=196608
+CONFIG_RAM_START=0x20000000
+CONFIG_RAW_BINARY=y
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_WAITPID=y
+CONFIG_SIG_EVTHREAD=y
+CONFIG_STM32WB_BLE=y
+CONFIG_STM32WB_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
+CONFIG_STM32WB_DMA1=y
+CONFIG_STM32WB_PWR=y
+CONFIG_STM32WB_USART1=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_TESTING_OSTEST=y
+CONFIG_USART1_SERIAL_CONSOLE=y
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_BLUETOOTH=y
[incubator-nuttx] 01/04: stm32wb/nimble: workaround for unsupported HCI command
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 9db4caca1d3f538ed0eeb7750e0f727736ce4a28
Author: Sergey Nikitenko <s....@me.com>
AuthorDate: Sat Jul 30 18:48:18 2022 +0300
stm32wb/nimble: workaround for unsupported HCI command
---
arch/arm/src/stm32wb/stm32wb_blehci.c | 73 ++++++++++++++++++++++++++++-------
1 file changed, 60 insertions(+), 13 deletions(-)
diff --git a/arch/arm/src/stm32wb/stm32wb_blehci.c b/arch/arm/src/stm32wb/stm32wb_blehci.c
index 560a03dc1e..c991554d76 100644
--- a/arch/arm/src/stm32wb/stm32wb_blehci.c
+++ b/arch/arm/src/stm32wb/stm32wb_blehci.c
@@ -44,6 +44,16 @@
* Pre-processor Definitions
****************************************************************************/
+/* HCI event header fields helpers */
+
+#define STM32WB_BLEHCI_CCEVT_OPCODE(e) (*(uint16_t *)((uint8_t *)(e) + 3))
+#define STM32WB_BLEHCI_CCEVT_STATUS(e) (*((uint8_t *)(e) + 5))
+
+#define STM32WB_BLEHCI_CSEVT_OPCODE(e) (*(uint16_t *)((uint8_t *)(e) + 4))
+#define STM32WB_BLEHCI_CSEVT_STATUS(e) (*((uint8_t *)(e) + 2))
+
+/* BLE init configuration params */
+
#define STM32WB_BLE_PREP_WRITE_NUM \
STM32WB_MBOX_DEFAULT_BLE_PREP_WRITE_NUM(CONFIG_STM32WB_BLE_MAX_ATT_MTU)
@@ -145,8 +155,18 @@ static int stm32wb_blehci_driversend(struct bt_driver_s *btdev,
if (type == BT_CMD || type == BT_ACL_OUT)
{
- wlinfo("passing type %s to mailbox driver\n",
- (type == BT_CMD) ? "CMD" : "ACL");
+ if (type == BT_CMD)
+ {
+ wlinfo("passing CMD 0x%04x (len: %u) to mailbox driver\n",
+ ((struct bt_hci_cmd_hdr_s *)data)->opcode,
+ ((struct bt_hci_cmd_hdr_s *)data)->param_len);
+ }
+ else
+ {
+ wlinfo("passing ACL (handle: 0x%04x, len: %u) to mailbox driver\n",
+ ((struct bt_hci_acl_hdr_s *)data)->handle,
+ ((struct bt_hci_acl_hdr_s *)data)->len);
+ }
/* Ensure non-concurrent access */
@@ -185,31 +205,58 @@ static int stm32wb_blehci_rxevt(struct stm32wb_mbox_evt_s *evt)
len = sizeof(evt->evt_hdr) + evt->evt_hdr.len;
if (evt->evt_hdr.evt == BT_HCI_EVT_CMD_COMPLETE)
{
- wlinfo("received CMD_COMPLETE from mailbox "
- "(opcode: 0x%x, status: 0x%x)\n",
- *(uint16_t *)((uint8_t *)&evt->evt_hdr + 3),
- *((uint8_t *)&evt->evt_hdr + 5));
+ wlinfo("received command COMPLETE event from mailbox "
+ "(opcode: 0x%04x, status: %u)\n",
+ STM32WB_BLEHCI_CCEVT_OPCODE(&evt->evt_hdr),
+ STM32WB_BLEHCI_CCEVT_STATUS(&evt->evt_hdr));
+ }
+ else if (evt->evt_hdr.evt == BT_HCI_EVT_CMD_STATUS)
+ {
+ wlinfo("received command STATUS event from mailbox "
+ "(opcode: 0x%04x, status: %u)\n",
+ STM32WB_BLEHCI_CSEVT_OPCODE(&evt->evt_hdr),
+ STM32WB_BLEHCI_CSEVT_STATUS(&evt->evt_hdr));
+
+#ifdef CONFIG_NIMBLE
+ /* During initialisation NimBLE host stack sends unsupported
+ * 'Set Event Mask Page' HCI command, and a failing response
+ * causes the stack initialisation to fail. As a workaround
+ * with minimal impact we shim the response as succeeded.
+ */
+
+ if (STM32WB_BLEHCI_CSEVT_STATUS(&evt->evt_hdr) != 0 &&
+ (STM32WB_BLEHCI_CSEVT_OPCODE(&evt->evt_hdr) ==
+ BT_OP(BT_OGF_BASEBAND, 0x0063)))
+ {
+ wlwarn("suppress FAILED command STATUS event from mailbox, "
+ "(opcode: 0x%04x, status: %u) \n",
+ STM32WB_BLEHCI_CSEVT_OPCODE(&evt->evt_hdr),
+ STM32WB_BLEHCI_CSEVT_STATUS(&evt->evt_hdr));
+
+ /* Suppress status field error value */
+
+ STM32WB_BLEHCI_CSEVT_STATUS(&evt->evt_hdr) = 0;
+ }
+#endif
}
else
{
- wlinfo("received HCI EVT from mailbox "
- "(evt: %d, len: %zu)\n", evt->evt_hdr.evt, len);
+ wlinfo("received HCI EVT 0x%02x from mailbox (len: %u)\n",
+ evt->evt_hdr.evt, evt->evt_hdr.len);
}
bt_netdev_receive(&g_blehci_driver, BT_EVT, &evt->evt_hdr, len);
break;
case STM32WB_MBOX_HCIACL:
- wlinfo("received HCI ACL from mailbox (handle: %d)\n",
- evt->acl_hdr.handle);
len = sizeof(evt->acl_hdr) + evt->acl_hdr.len;
-
+ wlinfo("received HCI ACL from mailbox (handle: 0x%04x, len: %u)\n",
+ evt->acl_hdr.handle, evt->acl_hdr.len);
bt_netdev_receive(&g_blehci_driver, BT_ACL_IN, &evt->acl_hdr, len);
break;
case STM32WB_MBOX_SYSEVT:
- wlinfo("received SYS event from mailbox (evt: %d)\n",
- evt->evt_hdr.evt);
+ wlinfo("received SYS EVT 0x%02x from mailbox\n", evt->evt_hdr.evt);
if (evt->evt_hdr.evt == STM32WB_SHCI_ASYNC_EVT &&
*(uint16_t *)(&evt->evt_hdr + 1) == STM32WB_SHCI_ASYNC_EVT_C2RDY)
{
[incubator-nuttx] 03/04: stm32wb/ble: disable default CPU2 host config option
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 30a80a390d681a5974bb78dc1970bff00f2c8a8a
Author: Sergey Nikitenko <s....@me.com>
AuthorDate: Sat Jul 30 18:49:32 2022 +0300
stm32wb/ble: disable default CPU2 host config option
---
arch/arm/src/stm32wb/Kconfig | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/src/stm32wb/Kconfig b/arch/arm/src/stm32wb/Kconfig
index d13bcc0b03..93c3a80134 100644
--- a/arch/arm/src/stm32wb/Kconfig
+++ b/arch/arm/src/stm32wb/Kconfig
@@ -957,7 +957,11 @@ if STM32WB_BLE
config STM32WB_BLE_C2HOST
bool "Enable CPU2 HOST stack"
- default y
+ default n
+ ---help---
+ The full stack version of CPU2 firmware allows to enable CPU2 HOST stack and
+ control it using vendor ACL protocol. However, it is not expected to enable
+ this option in the current implementation.
config STM32WB_BLE_MAX_CONN
int "Maximum BLE simultaneous connections"