This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE RF is not working on nRF52833 (migration from nRF52840)

Hi Community,

Facing the RF functionality issue on nRF52833 on our custom board.

Our board is functioning well with nRF52840, then it failed after migration to nRF52833.

I've done some testing over example ble_app_beacon, and here are the findings (with some modification on main.c, see .diff file as enclosed):

1. HFCLK is not running via enabling by SoftDevice

2. HFCLK is running by self-programmed (manually enable it via 'nrf_drv_clock_hfclk_request')

3. With both 2 setup as above, I can't scan beacon signal from nRF Connect APP from my phone

Crossing check w/ nRF52833 Development Kit board:

1. 'ble_app_beacon' is running well on this board without any changes to main.c. The beacon signal can be discovered by nRF Connect APP on my phone.

2. adding extra change for checking the status of clock (see .diff file as enclosed), it shows HFCLK is not running. (Why? Beacon can be discovered)

3. with manually enabling (enable MACRO MANUAL_CLK_INIT to request HFCLK), HFCLK is running (with check call to 'nrf_drv_clock_hfclk_is_running'). Beacon is functioning well.

So, my question is that how do I get more information to diagnose this weird issue, either hardware side or software side.

BTW, the migration from nRF52840 to nRF52833 is keep the same components (clocks, chip antenna) and with RF matching modified according to reference circuit '7.3.18 Circuit configuration no. 6 fro CJAA WLCSP' with 32.768kHz is equipped.

The log from modification of main.c of ble_app_beacon running on our custom board:

1. With MANUAL_CLK_INIT macro defined

SEGGER J-Link V6.86f - Real time terminal output
J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00 V1.0, SN=683196507
Process: JLink.exe
<info> app_timer: RTC: initialized.
<info> app: Manual clock init done
<info> app: HFCLK running: y
<info> app: LFCLK running: y
<info> app: LFCLK ACTV SRC: 1
<info> app: LFCLK SRC: 1
<info> app: Beacon example started.

2. Without MANUAL_CLK_INIT macro

SEGGER J-Link V6.86f - Real time terminal output
J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00 V1.0, SN=683196507
Process: JLink.exe
<info> app_timer: RTC: initialized.
<info> app: Clock init to be done by SD
<info> app: HFCLK running: n
<info> app: LFCLK running: y
<info> app: LFCLK ACTV SRC: 1
<info> app: LFCLK SRC: 1
<info> app: Beacon example started.

diff --git a/examples/ble_peripheral/ble_app_beacon/main.c b/examples/ble_peripheral/ble_app_beacon/main.c
index 0e8c1d7..0d0c1a2 100644
--- a/examples/ble_peripheral/ble_app_beacon/main.c
+++ b/examples/ble_peripheral/ble_app_beacon/main.c
@@ -62,6 +62,8 @@
 #include "nrf_log_ctrl.h"
 #include "nrf_log_default_backends.h"

+#include "nrf_drv_clock.h"
+

 #define APP_BLE_CONN_CFG_TAG            1                                  /**< A tag identifying the SoftDevice BLE configuration. */

@@ -285,6 +287,30 @@ static void idle_state_handle(void)
     }
 }

+/** @brief Function for configuring all peripherals used in this example.
+ */
+#define MANUAL_CLK_INIT
+
+#ifdef MANUAL_CLK_INIT
+static void clock_init(void)
+{
+    nrf_drv_clock_hfclk_request(NULL);
+    while (!nrf_drv_clock_hfclk_is_running())
+    {}
+    #if 0
+    // Start 64 MHz crystal oscillator.
+    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
+    NRF_CLOCK->TASKS_HFCLKSTART    = 1;
+
+    // Wait for the external oscillator to start up.
+    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
+    {
+        // Do nothing.
+    }
+    #endif
+    NRF_LOG_INFO("Manual clock init done");
+}
+#endif

 /**
  * @brief Function for application main entry.
@@ -295,10 +321,20 @@ int main(void)
     log_init();
     timers_init();
     leds_init();
+    #ifdef MANUAL_CLK_INIT
+    clock_init();
+    #else
+    NRF_LOG_INFO("Clock init to be done by SD");
+    #endif
     power_management_init();
     ble_stack_init();
     advertising_init();

+    NRF_LOG_INFO("HFCLK running: %s", (nrf_drv_clock_hfclk_is_running () ? "y" : "n"));
+    NRF_LOG_INFO("LFCLK running: %s", (nrf_drv_clock_lfclk_is_running () ? "y" : "n"));
+    NRF_LOG_INFO("LFCLK ACTV SRC: %d", nrf_clock_lf_actv_src_get ());
+    NRF_LOG_INFO("LFCLK SRC: %d", nrf_clock_lf_src_get ());
+
     // Start execution.
     NRF_LOG_INFO("Beacon example started.");
     advertising_start();

Related