-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
/* 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); | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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 <[email protected]>
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.