From 920117922bc8555fcc299ba962eec0be7b7002ab Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 13 May 2025 14:30:26 +0200 Subject: [PATCH] Bluetooth: Controller: nRF53x: Fix NRF_CCM MAXPACKETSIZE value Fix NRF_CCM MAXPACKETSIZE value to mitigate Bus Faults. Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index c4f1d67718a..bb7dbcc6b10 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -2214,11 +2214,16 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_ !defined(CONFIG_SOC_COMPATIBLE_NRF54LX) && \ (!defined(CONFIG_BT_CTLR_DATA_LENGTH_MAX) || \ (CONFIG_BT_CTLR_DATA_LENGTH_MAX < ((HAL_RADIO_PDU_LEN_MAX) - 4U))) + +#define NRF_CCM_WORKAROUND_XXXX_MAXPACKETSIZE_EXTRA 1U + const uint8_t max_len = (NRF_RADIO->PCNF1 & RADIO_PCNF1_MAXLEN_Msk) >> RADIO_PCNF1_MAXLEN_Pos; /* MAXPACKETSIZE value 0x001B (27) - 0x00FB (251) bytes */ - NRF_CCM->MAXPACKETSIZE = max_len - 4U; + NRF_CCM->MAXPACKETSIZE = + MAX(MIN((max_len - 4U + NRF_CCM_WORKAROUND_XXXX_MAXPACKETSIZE_EXTRA), 0x00FB), + 0x001B); #endif #if defined(CONFIG_SOC_COMPATIBLE_NRF54LX)