diff --git a/arch/arm/src/stm32/stm32_hciuart.c b/arch/arm/src/stm32/stm32_hciuart.c index 81e5a75e073..6180c1ccb55 100644 --- a/arch/arm/src/stm32/stm32_hciuart.c +++ b/arch/arm/src/stm32/stm32_hciuart.c @@ -941,9 +941,11 @@ static uint16_t hciuart_rxinuse(const struct hciuart_config_s *config) * Name: hciuart_rxflow_enable * * Description: - * Enable software Rx flow control, i.e., clear the RTS output. This will - * be seen as CTS on the other end of the cable and the HCI UART device - * must stop sending data. + * Enable software Rx flow control, i.e., deassert the RTS output. This + * will be seen as CTS on the other end of the cable and the HCI UART + * device must stop sending data. + * + * NOTE: RTS is logic low * ****************************************************************************/ @@ -965,7 +967,7 @@ static void hciuart_rxflow_enable(const struct hciuart_config_s *config) { wlinfo("Enable RTS flow control\n"); - stm32_gpiowrite(config->rts_gpio, false); + stm32_gpiowrite(config->rts_gpio, true); state->rxflow = true; } } @@ -976,9 +978,11 @@ static void hciuart_rxflow_enable(const struct hciuart_config_s *config) * Name: hciuart_rxflow_disable * * Description: - * Disable software Rx flow control, i.e., set the RTS output. This will - * be seen as CTS on the other end of the cable and the HCI UART device - * can resume sending data. + * Disable software Rx flow control, i.e., assert the RTS output. This + * will be seen as CTS on the other end of the cable and the HCI UART + * device can resume sending data. + * + * NOTE: RTS is logic low * ****************************************************************************/ @@ -998,7 +1002,7 @@ static void hciuart_rxflow_disable(const struct hciuart_config_s *config) { wlinfo("Disable RTS flow control\n"); - stm32_gpiowrite(config->rts_gpio, true); + stm32_gpiowrite(config->rts_gpio, false); state->rxflow = false; } } @@ -1581,13 +1585,12 @@ static int hciuart_configure(const struct hciuart_config_s *config) * based management of RTS. * * Convert the RTS alternate function pin to a push-pull output with - * initial output value of zero, i.e., rx flow control enabled. The HCI + * initial output value of one, i.e., rx flow control enabled. The HCI * UART device should not send data until we assert RTS. */ - regval = GPIO_MODE_MASK | GPIO_PUPD_MASK | GPIO_OPENDRAIN | - GPIO_OUTPUT_SET | GPIO_EXTI; - pinset = (config & ~regval) | GPIO_OUTPUT; + regval = GPIO_MODE_MASK | GPIO_PUPD_MASK | GPIO_OPENDRAIN | GPIO_EXTI; + pinset = (config & ~regval) | GPIO_OUTPUT | GPIO_OUTPUT_SET; #endif stm32_configgpio(pinset); diff --git a/configs/stm32f4discovery/hciuart/defconfig b/configs/stm32f4discovery/hciuart/defconfig index 033acfb1140..5f1a82f7e53 100644 --- a/configs/stm32f4discovery/hciuart/defconfig +++ b/configs/stm32f4discovery/hciuart/defconfig @@ -74,6 +74,7 @@ CONFIG_START_MONTH=9 CONFIG_START_YEAR=2014 CONFIG_STM32_DMA2=y CONFIG_STM32_DMACAPABLE=y +CONFIG_STM32_HCIUART3_BAUD=9600 CONFIG_STM32_JTAG_SW_ENABLE=y CONFIG_STM32_PWR=y CONFIG_STM32_SDIO=y diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c index bb2ee106dad..c841ae76075 100644 --- a/wireless/bluetooth/bt_hcicore.c +++ b/wireless/bluetooth/bt_hcicore.c @@ -868,7 +868,7 @@ static int hci_tx_kthread(int argc, FAR char *argv[]) wlinfo("started\n"); - while (1) + for (; ; ) { FAR struct bt_buf_s *buf; @@ -918,7 +918,7 @@ static int hci_rx_kthread(int argc, FAR char *argv[]) wlinfo("started\n"); - while (1) + for (; ; ) { ret = bt_queue_receive(g_btdev.rx_queue, &buf); if (ret < 0)