Hello,
I've been tasked with adding radio test functionality to our manufacturing support firmware. I reviewed the comments here on devzone and studied the radio_test peripheral example. Since the existing software utilizes the softdevice, I have implemented a step to disable the softdevice before calling functions from radio_test.c.
The processors being used are NRF52832 and NRF52840. (2 different hardware variants)
The SDK release is 15.0.0.
I am using RSSI viewer in NRF Connect to monitor signal level.
Before starting first test, the softdevice is requested to disable:
while (nrf_sdh_is_enabled())
{
NRF_LOG_INFO("disabling soft device");
NRF_LOG_FLUSH();
ret_code_t result = nrf_sdh_disable_request();
if (NRF_SUCCESS != result)
{
NRF_LOG_WARNING("sdh disable result=%d",result);
}
}
Temporarily I have modified nrf_drv_clock.c to leave the LFCLK enabled since my button press timer requires this clock.
/* SD leaves LFCLK enabled - disable it if it is no longer required. */
//DISABLE for now -- nrf_drv_clock_lfclk_release();
On each button press I choose a different radio_test configuration:
switch(cfg) {
case BSP_OP_TEST_RADIO_0_CFG:
NRF_LOG_INFO("carrier 2440");
radio_tx_carrier(RADIO_TXPOWER_TXPOWER_0dBm,RADIO_MODE_MODE_Nrf_2Mbit, RADIO_TEST_2440);
break;
case BSP_OP_TEST_RADIO_1_CFG:
NRF_LOG_INFO("carrier 2402");
radio_tx_carrier(RADIO_TXPOWER_TXPOWER_0dBm,RADIO_MODE_MODE_Nrf_2Mbit, RADIO_TEST_2402);
break;
case BSP_OP_TEST_RADIO_2_CFG:
NRF_LOG_INFO("carrier 2480");
radio_tx_carrier(RADIO_TXPOWER_TXPOWER_0dBm,RADIO_MODE_MODE_Nrf_2Mbit, RADIO_TEST_2480);
break;
case BSP_OP_TEST_RADIO_3_CFG:
NRF_LOG_INFO("modulated 2440");
radio_modulated_tx_carrier(RADIO_TXPOWER_TXPOWER_0dBm,RADIO_MODE_MODE_Ble_1Mbit, RADIO_TEST_2440);
break;
case BSP_OP_TEST_RADIO_4_CFG:
NRF_LOG_INFO("modulated 2402");
radio_modulated_tx_carrier(RADIO_TXPOWER_TXPOWER_0dBm,RADIO_MODE_MODE_Ble_1Mbit, RADIO_TEST_2402);
break;
case BSP_OP_TEST_RADIO_5_CFG:
NRF_LOG_INFO("modulated 2480");
radio_modulated_tx_carrier(RADIO_TXPOWER_TXPOWER_0dBm,RADIO_MODE_MODE_Ble_1Mbit, RADIO_TEST_2480);
break;
default:
Please help clarify these questions:
1) my product is BLE, what mode of operation should I use? RADIO_MODE_MODE_Nrf_2Mbit or RADIO_MODE_MODE_Ble_1Mbit or another?
2) for radio certification testing, should I use RADIO_TXPOWER_TXPOWER_0dBm or RADIO_TXPOWER_TXPOWER_Pos4dBm or ?
3) when I call radio_modulated_tx_carrier, why does it hang during random number generation:
//code from radio_test.c
uint32_t rnd8(void)
{
NRF_RNG->EVENTS_VALRDY = 0;
while (NRF_RNG->EVENTS_VALRDY == 0)
{
// code get stuck in this loop. RNG not functioning.
}
return NRF_RNG->VALUE;
}
4) In DTM test, I see the code configures some additional values (NRF_RADIO->MODECNF0, NRF_RADIO->BASE0, NRF_RADIO->CRCCNF, NRF_RADIO->CRCPOLY, NRF_RADIO->CRCINIT, but this not included in radio_test do I need to configure them ?
5) when observing the radio behavior with RSSI viewer, I do not see any radio activity. Does the softdevice leave the radio in a partially initialized state that is incompatible with the radio_test functions? How do I initialize radio after disabling the softdevice to allow radio_test operation?
thanks for your help!