Skip to content

Commit e50f034

Browse files
mringwaldkalowsk
authored andcommitted
bluetooth: cyw43xxx: support autobaud feature
Newer AIROC controllers like the CYW55573 don't support changing the baudrate in Download Mode. However, a higher baud rate can be used directly to sent HCI Reset. This commit adds the KConfig flag CONFIG_AIROC_DOWNLOAD_MODE to enable the new behaviour. Signed-off-by: Matthias Ringwald <matthias@ringwald.ch>
1 parent bdab748 commit e50f034

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

drivers/bluetooth/hci/Kconfig.infineon

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,22 @@ config AIROC_CUSTOM_FIRMWARE_HCD_BLOB
196196
Path to BT firmware HCD file for custom or vendor CYW43xx modules.
197197
It can be absolute path, or relative from project folder.
198198

199+
config AIROC_AUTOBAUD_MODE
200+
bool "Autobaud mode"
201+
help
202+
Use Autobaud feature of AIROC Controller for fast firmware download
203+
204+
Newer AIROC Controllers such as CYW555xx only allow firmware
205+
upload in Download Mode after a Recovery Reset.
206+
In Download Mode the Baud Rate vendor command cannot be used
207+
initially. Instead, Autobaud mode allows to direct use a higher
208+
baud rate.
209+
210+
Autobaud mode is not required on older AIROC controllers.
211+
212+
https://infineon.github.io/btsdk-docs/BT-SDK/AIROC-HCI-Firmware-Download.pdf
213+
214+
199215
# Change size of command lengths. It for vendor commands related to
200216
# firmware downloading.
201217
config BT_BUF_CMD_TX_SIZE

drivers/bluetooth/hci/h4_ifx_cyw43xxx.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,27 @@ int bt_h4_vnd_setup(const struct device *dev)
251251
/* BT settling time after power on */
252252
(void)k_msleep(BT_POWER_ON_SETTLING_TIME_MS);
253253

254+
/* Newer controllers like CYW555xx require Download mode for firmware upload.
255+
* In Download mode, the baudrate cannot be changed without the Minidriver.
256+
* We use auto-baud mode to use a higher baud rate directly.
257+
*/
258+
if (IS_ENABLED(CONFIG_AIROC_AUTOBAUD_MODE) &&
259+
(fw_download_speed != default_uart_speed)) {
260+
err = bt_hci_uart_set_baudrate(dev, fw_download_speed);
261+
if (err) {
262+
return err;
263+
}
264+
}
265+
254266
/* Send HCI_RESET */
255267
err = bt_hci_cmd_send_sync(BT_HCI_OP_RESET, NULL, NULL);
256268
if (err) {
257269
return err;
258270
}
259271

260-
/* Re-configure baudrate for BT Controller */
261-
if (fw_download_speed != default_uart_speed) {
272+
/* Re-configure baudrate for BT Controller (if we haven't already) */
273+
if (!IS_ENABLED(CONFIG_AIROC_AUTOBAUD_MODE) &&
274+
(fw_download_speed != default_uart_speed)) {
262275
err = bt_update_controller_baudrate(dev, fw_download_speed);
263276
if (err) {
264277
return err;

0 commit comments

Comments
 (0)