Skip to content

Conversation

cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Jun 25, 2024

Fix regression using speed optimization introduced in commit cvinayak@1b7fe79 ("Bluetooth: Controller: Support Link Time Optimizations (LTO)").

Fix regression in encrypted connection introduced in commit cvinayak@f3deccd ("Bluetooth: Controller: CCM read data to early when DF enabled on PHY 1M").
Due to this nRF51x SoC hang waiting to encrypt and/or
check MIC.

Only 3 bytes (PDU_EM_LL_SIZE_MAX) is required for empty PDU
transmission, but in case of Radio ISR latency if rx packet
pointer is not setup then Radio DMA will use previously
assigned buffer which can be this empty PDU buffer. Radio
DMA will overrun this buffer and cause memory corruption.
Any detection of ISR latency will not happen if the ISR
function pointer in RAM is corrupted by this overrun.
Increasing ISR latencies in OS and CPU usage in the
ULL_HIGH priority if it is same as LLL priority in Controller
implementation then it is making it tight to execute
Controller code in the tIFS between Tx-Rx PDU's Radio ISRs.

Other fixes to ISR profiling needed as part of analysis of increased ISR latencies.

Related to #74345.
Fixes #76427.

Signed-off-by: Vinayak Kariappa Chettimada [email protected]

@nordicjm
Copy link
Contributor

Gave a quick try and it seems to support a connection on the board here now, although it does continually give this:

*** Booting Zephyr OS build v3.7.0-rc1-315-g8b65ca635f52 ***
[00:00:00.265,869] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.266,021] <inf> bt_hci_core: HW Variant: nRF51x (0x0001)
[00:00:00.266,143] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 3.7 Build 0
[00:00:00.269,683] <inf> bt_hci_core: Identity: E6:66:A0:7E:24:92 (random)
[00:00:00.269,897] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x05f1
[00:00:00.270,080] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
Bluetooth initialized
Starting Legacy Advertising (connectable and scannable)
Advertising successfully started
Connected
[00:00:17.916,961] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.036,956] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.156,982] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.277,160] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.397,003] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.517,181] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.637,176] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.667,327] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.757,324] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.787,200] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.877,197] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.907,348] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:18.997,344] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.027,221] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.117,218] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.147,369] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.237,365] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.267,242] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.357,238] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.387,237] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.477,386] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.507,263] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.597,259] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.627,258] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.717,254] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.747,406] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.837,280] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.867,279] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.957,275] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:19.987,091] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.017,272] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.137,420] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.167,297] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.257,293] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.287,292] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.377,319] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.407,440] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.497,436] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.527,313] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.617,309] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.647,460] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.737,457] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.767,333] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.857,330] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.887,481] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:20.977,478] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.007,354] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.097,351] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.127,502] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.217,498] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.247,375] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.337,371] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.367,370] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.457,519] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.487,396] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.577,392] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.607,391] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.697,540] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.727,416] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.817,413] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.847,412] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.937,408] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:21.967,559] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.057,434] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.087,432] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.177,429] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.207,580] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.297,576] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.327,453] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.417,449] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.447,601] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.537,597] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.567,474] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.657,470] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.687,622] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.777,618] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.807,495] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.897,491] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:22.927,642] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.067,626] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.117,492] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.267,517] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.317,657] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.467,651] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.517,517] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.667,541] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.717,681] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.867,675] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:23.917,572] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.067,687] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.117,706] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.267,639] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.317,718] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.467,742] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.517,608] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.667,602] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.717,742] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.867,767] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:24.917,633] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.067,626] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.117,767] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.267,852] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.317,657] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.467,803] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.517,822] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.667,694] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.717,834] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.867,828] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:25.917,694] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.067,718] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.117,858] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.267,852] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.317,718] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.467,742] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.517,883] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.667,877] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.717,773] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.867,889] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:26.917,907] �wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.067,779] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.117,919] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.267,913] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.317,810] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.467,803] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.517,944] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.667,968] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.717,834] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.867,828] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:27.917,968] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.067,993] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.117,858] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.267,883] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.318,023] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.468,017] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.517,883] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.668,029] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.718,048] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.867,919] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:28.918,060] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.068,054] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.117,919] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.268,005] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.318,084] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.468,078] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.517,944] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.668,090] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.718,109] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.867,980] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:29.918,121] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:30.068,115] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:30.118,011] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:30.268,005] <wrn> bt_att: Unhandled ATT code 0x03
Disconnected (reason 0x13)
Starting Legacy Advertising (connectable and scannable)
Connected
[00:00:34.479,034] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:34.538,146] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:34.658,325] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:34.778,350] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:34.898,345] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.018,341] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.138,183] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.258,361] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.378,509] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.408,386] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.498,382] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.528,533] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.618,530] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.648,406] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.738,403] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.768,402] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.858,398] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.888,549] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:35.978,424] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.008,422] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.098,419] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.128,570] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.218,566] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.248,443] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.338,439] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.368,591] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.458,587] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.488,464] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.578,460] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.608,276] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.638,427] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.728,454] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.758,483] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.848,480] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.878,601] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.968,627] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:36.998,504] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.088,500] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.118,621] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.208,648] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.238,494] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.328,521] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.358,642] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.448,669] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.478,515] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.568,542] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.598,663] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.688,354] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.808,563] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.838,684] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.928,680] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:37.958,557] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.048,553] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.078,704] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.168,701] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.198,577] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.288,574] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.318,572] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.408,721] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.438,598] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.528,594] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.558,593] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.648,620] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.678,741] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.768,615] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.798,614] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.888,641] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:38.918,762] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.008,636] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.038,635] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.128,631] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.158,782] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.248,779] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.278,656] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.368,652] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.398,803] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.518,676] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.548,675] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.638,824] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.668,701] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.808,685] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:39.858,825] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.008,850] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.058,715] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.208,709] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.258,850] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.408,874] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.458,740] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.608,886] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.658,905] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.808,898] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:40.858,764] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:41.008,972] <wrn> bt_att: Unhandled ATT code 0x03
[00:00:41.058,929] <wrn> bt_att: Unhandled ATT code 0x03
Disconnected (reason 0x13)
Starting Legacy Advertising (connectable and scannable)

Have not tried with exchanging any data, just a base connection

@cvinayak cvinayak force-pushed the github_radio_rx_overrun_fix2 branch 4 times, most recently from 2391722 to 51fdb1a Compare June 28, 2024 04:35
@cvinayak
Copy link
Contributor Author

cvinayak commented Jun 28, 2024

@thedjnK Could you please retry with this updated PR? discovered that there was a regression (in how Kconfig hidden menu and a choice inside did not get its default assigned) in use of speed optimization for Controller code. (Related issue: #39756)

You should try both the samples/bluetooth/peripheral_hr (cleartext connection) and samples/bluetooth/peripheral (subscribing to a vendor service, for pairing and encrypted connection).

If the changes fix the issues observed, then please review and approve the PR. Thank you in advance.

@carlescufi Hope you will be able to test a bbc:microbit, if you manage to fit it, for peripheral connections (cleartext or encrypted)...

@cvinayak cvinayak force-pushed the github_radio_rx_overrun_fix2 branch from 51fdb1a to 0bdfd29 Compare June 28, 2024 12:53
cvinayak added 4 commits July 20, 2024 03:25
Fix in-system ISR profiling for advertiser and connection
role for the missing implementation when there is CRC error.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Use uint16_t to store ISR profiling value to avoid overflow
in case of higher latencies.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Add ISR profiling using ticker ticks, hence profile ISR
CPU use outside radio events.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Provide Radio ISR latency in microseconds when asserting due
to high ISR latency.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
kruithofa
kruithofa previously approved these changes Jul 29, 2024
Fix ISR profiling when using single timer for tIFS radio
switching wherein in the timer is cleared on every radio
end. Hence, the captured timer value is the latency and
does not required the radio end timestamp to be subtracted.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Only 3 bytes (PDU_EM_LL_SIZE_MAX) is required for empty PDU
transmission, but in case of Radio ISR latency if rx packet
pointer is not setup then Radio DMA will use previously
assigned buffer which can be this empty PDU buffer. Radio
DMA will overrun this buffer and cause memory corruption.
Any detection of ISR latency will not happen if the ISR
function pointer in RAM is corrupted by this overrun.
Increasing ISR latencies in OS and CPU usage in the
ULL_HIGH priority if it is same as LLL priority in
Controller implementation then it is making it tight to
execute Controller code in the tIFS between Tx-Rx PDU's
Radio ISRs.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
In case of ISR latencies, if packet pointer has not been
set on time then we do not want to check uninitialized
length in rx buffer that did not get used by Radio DMA.
This would help us in detecting radio ready event being
set? We can not detect radio ready if it happens twice
before Radio ISR executes after latency.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix regression in encrypted connection introduced in
commit f3deccd ("Bluetooth: Controller: CCM read data
to early when DF enabled on PHY 1M").

Due to this nRF51x SoC hang waiting to encrypt and/or
check MIC.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix regression using speed optimization introduced in
commit 1b7fe79 ("Bluetooth: Controller: Support Link
Time Optimizations (LTO)").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Relax the radio packet pointer assignment deadline assertion
until access address being transmitted. The PDU buffer is
probably only needed just after access address is being
transmitted or received by the radio. This will give some
more breathing room for slow CPUs like in nRF51x SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
@fabiobaltieri fabiobaltieri merged commit 4dbfb22 into zephyrproject-rtos:main Aug 14, 2024
25 checks passed
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.

CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED not selected by default in zephyr 3.7
6 participants