diff --git a/chipset/bcm/btstack_chipset_bcm.c b/chipset/bcm/btstack_chipset_bcm.c index 7b075da53..f78055fb8 100644 --- a/chipset/bcm/btstack_chipset_bcm.c +++ b/chipset/bcm/btstack_chipset_bcm.c @@ -147,15 +147,6 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){ if (res == 0){ log_info("chipset-bcm: end of file, size %u", init_script_offset); close(hcd_fd); - - // TODO: should not be needed anymore - fixed for embedded below and tested on RedBear Duo - - // wait for firmware patch to be applied - shorter delay possible -#ifdef _WIN32 - Sleep(1000); -#else - sleep(1); -#endif return BTSTACK_CHIPSET_DONE; } if (res < 0){ @@ -285,13 +276,6 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){ } if (init_script_offset >= brcm_patch_ram_length) { - - // It takes up to 2 ms for the BCM to raise its RTS line - // If we send the next command right away, the raise of the RTS will fall happen during - // it and causing the next command to fail (at least on RedBear Duo with manual CTS/RTS) - // - // -> Work around implemented in hci.c - return BTSTACK_CHIPSET_DONE; } diff --git a/src/hci.c b/src/hci.c index 71c49eff4..0d637aa4e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1334,11 +1334,12 @@ static void hci_initializing_run(void){ hci_stack->hci_transport->set_baudrate(baud_rate); } - // - RTS will raise during update, but manual RTS/CTS in WICED port on RedBear Duo cannot handle this - // -> Work around: wait a few milliseconds here. - log_info("BCM delay after init script"); + uint16_t bcm_delay_ms = 300; + // - UART may or may not be disabled during update and Controller RTS may or may not be high during this time + // -> Work around: wait here. + log_info("BCM delay (%u ms) after init script", bcm_delay_ms); hci_stack->substate = HCI_INIT_W4_CUSTOM_INIT_BCM_DELAY; - btstack_run_loop_set_timer(&hci_stack->timeout, 10); + btstack_run_loop_set_timer(&hci_stack->timeout, bcm_delay_ms); btstack_run_loop_set_timer_handler(&hci_stack->timeout, hci_initialization_timeout_handler); btstack_run_loop_add_timer(&hci_stack->timeout); break;