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: Fix timings for Tx test #44735

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

KAGA164
Copy link
Collaborator

@KAGA164 KAGA164 commented Apr 11, 2022

The Tx interval is now calculated once per each
Tx test and the next transmission is triggerd by
the switch timer instead of event timer. This
fixes a corner case issue when timer rollover.

Fixes: #42534.

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
Comment on lines 642 to 640
/* Set the initial value of the TIFS. It will be tuned up after
* the first packet transmission.
*/
radio_tmr_tifs_set(SCAN_INT_UNIT_US);
radio_switch_complete_and_b2b_tx(test_phy, test_phy_flags, test_phy, test_phy_flags);

Copy link
Contributor

Choose a reason for hiding this comment

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

The second PDU will not be at a multiple of 625us slot, this is not correct.

Instead modify calculate_tifs() to calculate the tIFS using the PDU length and PHY used, use it here and in isr_tx so that first and consecutive PDUs will all be at 625us slot multiples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Discussed offline. The tifs is calculated manually at the beginning of the Tx test now

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c Outdated Show resolved Hide resolved
cvinayak
cvinayak previously approved these changes Apr 11, 2022
Copy link
Contributor

@grochu grochu left a comment

Choose a reason for hiding this comment

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

The changes look good, please find 1 minor comment.

transmit_time = PDU_US(len, 0, test_phy, test_phy_flags);
#endif /* CONFIG_BT_CTLR_DF_CTE_TX */

interval = ceiling_fraction((transmit_time + 249), SCAN_INT_UNIT_US) * SCAN_INT_UNIT_US;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to document the magic number, though I know it comes from the original code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like this idea. Done

@cvinayak cvinayak changed the title Bluetooth: Controller: Fix timmings for Tx test Bluetooth: Controller: Fix timings for Tx test Apr 11, 2022
The Tx interval is now calculated at the beginning
of the Tx test and the next transmission is
triggerd by the switch timer instead of event
timer. This fixes a corner case issue when
timer rollover.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
@carlescufi carlescufi merged commit 3defc3d into zephyrproject-rtos:main Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BLE Testing functions do not work properly
4 participants