Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never disable bluetooth on nRF53 - workaround post up-merge issue #555

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions subsys/sal/sid_pal/src/sid_ble_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ static sid_error_t ble_adapter_init(const sid_ble_config_t *cfg)
bt_ctlr_set_public_addr(pub_addr.val);
#endif /* CONFIG_MAC_ADDRESS_TYPE_PUBLIC */

#if defined(CONFIG_SOC_SERIES_NRF53X)
static bool bt_enabled;
if (!bt_enabled) {
bt_enabled = true;
}
#endif /* CONFIG_SOC_SERIES_NRF53X */
int err_code;
err_code = bt_enable(NULL);
switch (err_code) {
Expand Down Expand Up @@ -266,6 +272,11 @@ static sid_error_t ble_adapter_deinit(void)
LOG_DBG("Sidewalk -> BLE");
sid_ble_conn_deinit();

#if defined(CONFIG_SOC_SERIES_NRF53X)
return SID_ERROR_NONE;
#endif /* CONFIG_SOC_SERIES_NRF53X */


int err = bt_disable();

if (err) {
Expand Down
4 changes: 0 additions & 4 deletions subsys/sal/sid_pal/src/sid_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ sid_error_t sid_pal_common_init(const platform_specific_init_parameters_t *platf
}
#if defined(CONFIG_SIDEWALK_SUBGHZ_SUPPORT)
set_radio_sx126x_device_config(platform_init_parameters->radio_cfg);
#if defined(CONFIG_SOC_SERIES_NRF53X)
(void)bt_enable(NULL);
(void)bt_disable();
#endif /* defined(CONFIG_SOC_SERIES_NRF53X) */
#endif /* defined(CONFIG_SIDEWALK_SUBGHZ_SUPPORT) */

#if defined(CONFIG_SIDEWALK_TEMPERATURE)
Expand Down
8 changes: 7 additions & 1 deletion utils/src/nordic_dfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ int nordic_dfu_ble_start(void)
application_state_dfu(&global_state_notifier, true);
dk_leds_init();

int err = bt_enable(NULL);
int err = 0;

#if !defined(CONFIG_SOC_SERIES_NRF53X)
err = bt_enable(NULL);
if (err && err != -EALREADY) {
LOG_ERR("Bluetooth enable failed (err %d)", err);
return err;
}
#endif /* CONFIG_SOC_SERIES_NRF53X */

mgmt_callback_register(&dfu_mode_mgmt_cb);

Expand Down Expand Up @@ -153,11 +157,13 @@ int nordic_dfu_ble_stop(void)
return err;
}

#if !defined(CONFIG_SOC_SERIES_NRF53X)
err = bt_disable();
if (err) {
LOG_ERR("Bluetooth disable failed (err %d)", err);
return err;
}
#endif /* CONFIG_SOC_SERIES_NRF53X */

LOG_INF("Advertising successfully stoped");

Expand Down
Loading