From 7a111aeebabb8cf5dc57de4c731fd5a2adc5513d Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 5 May 2022 19:33:52 +0200 Subject: [PATCH] nimble/phy/nrf53: Fix PA/LNA enable READY/DISABLED events were not published if PA/LNA was enabled so it was not working - it only worked if GPIO debugging is also enabled which published those events. --- nimble/drivers/nrf5340/src/ble_phy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nimble/drivers/nrf5340/src/ble_phy.c b/nimble/drivers/nrf5340/src/ble_phy.c index 9734e8878..060e32eef 100644 --- a/nimble/drivers/nrf5340/src/ble_phy.c +++ b/nimble/drivers/nrf5340/src/ble_phy.c @@ -1298,7 +1298,6 @@ ble_phy_dbg_time_setup(void) /* Publish RADIO->EVENTS_READY */ NRF_RADIO_NS->PUBLISH_READY = DPPI_CH_PUB(RADIO_EVENTS_READY); NRF_DPPIC_NS->CHENSET = DPPI_CH_MASK(RADIO_EVENTS_READY); - #endif #if MYNEWT_VAL(BLE_PHY_DBG_TIME_ADDRESS_END_PIN) >= 0 @@ -1435,6 +1434,13 @@ ble_phy_init(void) * TODO: figure out if this affects power consumption */ + /* Publish RADIO->EVENTS_READY */ + NRF_RADIO_NS->PUBLISH_READY = DPPI_CH_PUB(RADIO_EVENTS_READY); + NRF_DPPIC_NS->CHENSET = DPPI_CH_MASK(RADIO_EVENTS_READY); + /* Publish RADIO->EVENTS_DISABLED */ + NRF_RADIO_NS->PUBLISH_DISABLED = DPPI_CH_PUB(RADIO_EVENTS_DISABLED); + NRF_DPPIC_NS->CHENSET = DPPI_CH_MASK(RADIO_EVENTS_DISABLED); + #if PLNA_SINGLE_GPIO plna_idx = ble_phy_gpiote_configure(MYNEWT_VAL(BLE_LL_PA_GPIO)); NRF_GPIOTE_NS->SUBSCRIBE_SET[plna_idx] = DPPI_CH_UNSUB(RADIO_EVENTS_READY);