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

bluetooth: controller: Extend DTM commands #42300

Merged
merged 5 commits into from
Mar 18, 2022

Conversation

KAGA164
Copy link
Collaborator

@KAGA164 KAGA164 commented Jan 31, 2022

This PR adds a support for following HCI commands:

  • HCI LE Receiver Test [v3]
  • HCI LE Transmitter Test [v3]
  • HCI LE Transmitter Test [v4]

Those command set add a possibility to test the radio CTE reception and transmission. The HCI LE Transmitter Test v4 commands allows setting a transmit power. The Controller under the DTM test can also generate the HCI Connectionless IQ Report event when it receives the CTE.

platform_allow: nrf52833dk_nrf52833
extra_configs:
- CONFIG_BT_CTLR_DF=y
- CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y"
- CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT=y

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

subsys/bluetooth/controller/Kconfig.dtm Show resolved Hide resolved
subsys/bluetooth/controller/Kconfig.dtm Outdated Show resolved Hide resolved
Comment on lines 2816 to 2818
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX)
if (lll && ull_df_sync_cfg_is_not_enabled(&lll->df_cfg)) {
/* Drop further processing of the event. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up, will conflict with #42302

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Resloved

#endif /* CONFIG_BT_CTLR_DF_CTE_RX */

#if defined(CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT)
static void create_iq_report(bool crc_ok)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static void create_iq_report(bool crc_ok)
static int create_iq_report(bool crc_ok)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 577 to 579
uint32_t start_us;
uint32_t err;
bool cte_request = (cte_len > 0) ? 1 : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uint32_t start_us;
uint32_t err;
bool cte_request = (cte_len > 0) ? 1 : 0;
const bool cte_request = (cte_len > 0) ? 1 : 0;
uint32_t start_us;
uint8_t err;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -193,74 +499,119 @@ static uint32_t init(uint8_t chan, uint8_t phy, void (*isr)(void *))
/* NOTE: No whitening in test mode. */
radio_phy_set(test_phy, test_phy_flags);
radio_tmr_tifs_set(150);
radio_tx_power_max_set();

err = tx_power_set(tx_power);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare a local uint8_t ret;

Suggested change
err = tx_power_set(tx_power);
ret = tx_power_set(tx_power);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

RADIO_PKT_CONF_CTE(cte ? RADIO_PKT_CONF_CTE_ENABLED :
RADIO_PKT_CONF_CTE_DISABLED));

return err;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return err;
return ret;

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
@cvinayak cvinayak self-assigned this Feb 1, 2022
include/bluetooth/hci.h Show resolved Hide resolved
subsys/bluetooth/controller/Kconfig.dtm Outdated Show resolved Hide resolved
subsys/bluetooth/controller/hci/hci.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/hci/hci.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/hci/hci.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@ppryga-nordic ppryga-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One new comment added.
Please go through unresolved comments from previous review also.

subsys/bluetooth/controller/hci/hci.c Outdated Show resolved Hide resolved
@KAGA164 KAGA164 force-pushed the dtm_add_support_for_cte branch from bed66fb to 4700bfa Compare February 23, 2022 11:10
@KAGA164 KAGA164 force-pushed the dtm_add_support_for_cte branch from 4700bfa to 1c0bffb Compare February 25, 2022 15:33
@alwa-nordic alwa-nordic removed their request for review February 28, 2022 16:55
@KAGA164
Copy link
Collaborator Author

KAGA164 commented Mar 3, 2022

@ppryga @cvinayak any comments ? Are we ready to merge it ?

@@ -69,7 +69,7 @@ int cmd_test_tx(const struct shell *sh, size_t argc, char *argv[])
type = strtoul(argv[3], NULL, 16);
phy = strtoul(argv[4], NULL, 16);

err = ll_test_tx(chan, len, type, phy);
err = ll_test_tx(chan, len, type, phy, 0, 0, 0, NULL, 0x7F);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't you forget about this?

@@ -92,7 +92,7 @@ int cmd_test_rx(const struct shell *sh, size_t argc, char *argv[])
phy = strtoul(argv[2], NULL, 16);
mod_idx = strtoul(argv[3], NULL, 16);

err = ll_test_rx(chan, phy, mod_idx);
err = ll_test_rx(chan, phy, mod_idx, 0, 0, 0, 0, NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't you forget about this?

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
@KAGA164 KAGA164 force-pushed the dtm_add_support_for_cte branch from 1c0bffb to 58506d1 Compare March 7, 2022 11:01
@KAGA164 KAGA164 requested a review from nashif as a code owner March 7, 2022 11:01
@KAGA164
Copy link
Collaborator Author

KAGA164 commented Mar 7, 2022

@ppryga I replaced magic number in shell related files and also I added a doc entry about the Direction Finding in hci_uart sample doc.

@KAGA164 KAGA164 force-pushed the dtm_add_support_for_cte branch from 58506d1 to 66a693c Compare March 7, 2022 14:22
ppryga-nordic
ppryga-nordic previously approved these changes Mar 7, 2022
@ppryga-nordic
Copy link
Collaborator

Approved in regard of changes I've requested.

Copy link
Contributor

@cvinayak cvinayak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you would be testing DTM, this is a request to include related suggestion mentioned here: #42866 (comment)

subsys/bluetooth/controller/Kconfig.dtm Show resolved Hide resolved
cvinayak
cvinayak previously approved these changes Mar 17, 2022
@KAGA164 KAGA164 added the DNM This PR should not be merged (Do Not Merge) label Mar 17, 2022
@KAGA164
Copy link
Collaborator Author

KAGA164 commented Mar 17, 2022

I added DNM. I just want to check one more thing

KAGA164 added 5 commits March 17, 2022 15:53
This adds support for the following Direct Test mode
commands:
- HCI LE Receiver Test [v3]
- HCI LE Transmitter Test [v3]
- HCI LE Transmitter Test [v4]

Those commands set add a possibility to test an CTE
reception and transmission. The HCI LE Transmitter
Test [v4] commands allows also setting a transmit power.

Signed-off-by: Kamil Gawor <[email protected]>
Alignes the Openisa ll_test_tx and ll_test_rx functions
with the new test API.

Signed-off-by: Kamil Gawor <[email protected]>
Adds support for the nrf52833dk_nrf52833 which supports
the Direction Finding feature. It allows also to perform
the Direct Test Mode with the CTE feature.

Signed-off-by: Kamil Gawor <[email protected]>
Adds antenna description for the nrf5340dk_nrf5340_cpunet
target. It allows to performthe Direct Test Mode with the
CTE feature on this target.

Signed-off-by: Kamil Gawor <[email protected]>
Add the Direction Finding documentation section into
the sample README.rst file.

Signed-off-by: Kamil Gawor <[email protected]>
@KAGA164 KAGA164 dismissed stale reviews from cvinayak and ppryga-nordic via 72e89fe March 17, 2022 14:55
@KAGA164 KAGA164 force-pushed the dtm_add_support_for_cte branch from 66a693c to 72e89fe Compare March 17, 2022 14:55
@KAGA164
Copy link
Collaborator Author

KAGA164 commented Mar 17, 2022

@ppryga @cvinayak I needed to rebase due to the API changed for:
void radio_df_cte_rx_2us_switching(bool cte_info_in_s1, uint8_t phy); and
void radio_df_cte_rx_4us_switching(bool cte_info_in_s1, uint8_t phy)

Copy link
Collaborator

@ppryga-nordic ppryga-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick look - ACK

@carlescufi carlescufi merged commit 3e9dfdd into zephyrproject-rtos:main Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Bluetooth Controller area: Bluetooth area: Documentation area: Samples Samples DNM This PR should not be merged (Do Not Merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants