Switch between Bluetooth mesh and constant carrier

Hi,

As part of our production test, we perform a constant carrier test (from Bluetooth DTM sample). But this test is performed after the casing is put on, which means that we are unable to reprogram the device and this test will be part of the application firmware (instead of the test firmware). This test is started by a special command over the communication lines.

Our application initializes Bluetooth mesh (GATT proxy is enabled) directly at boot. And while the constant carrier test does work in the application firmware, it only works when it starts before Bluetooth (mesh) is initialized.

Is there a way to disable Bluetooth (and reset the radio) to start the constant carrier test?
Could we add something to our radio-reset or start function to properly start the constant carrier?

System Information:

  • SOC: nRF52833
  • NCS version: v2.1.0

Constant Carrier library:

#include <hal/nrf_radio.h>

/* Devicetree node identifier for the radio node. */
#define RADIO_NODE DT_NODELABEL(radio)

static void radio_reset(void)
{
	nrf_radio_shorts_set(NRF_RADIO, 0);
	nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED);

	nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_DISABLE);
	while (!nrf_radio_event_check(NRF_RADIO, NRF_RADIO_EVENT_DISABLED)) {
		/* Do nothing */
	}
	nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED);
}

void carrier_stop(void)
{
	radio_reset();
}

void carrier_start(void)
{
	/* Turn off radio before configuring it */
	radio_reset();

	nrf_radio_frequency_set(NRF_RADIO, 2442);
	nrf_radio_txpower_set(NRF_RADIO, NRF_RADIO_TXPOWER_POS8DBM);

	/* Setting packet pointer will start the radio */

	nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_READY);

	/* Set shortcuts:
	 * between READY event and START task and
	 * between END event and DISABLE task
	 */
	nrf_radio_shorts_set(NRF_RADIO,
			     NRF_RADIO_SHORT_READY_START_MASK |
			     NRF_RADIO_SHORT_END_DISABLE_MASK);


    nrf_radio_modecnf0_set(NRF_RADIO, false,
                           RADIO_MODECNF0_DTX_Center);

    /* Shortcut between READY event and START task */
    nrf_radio_shorts_set(NRF_RADIO,
                         NRF_RADIO_SHORT_READY_START_MASK);

    /* Shortcut will start radio in Tx mode when it is ready */
    nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_TXEN);
}

Kind regards,

Tim

Parents Reply Children
No Data
Related