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

Radio Test not generating detectable carrier also modulated function hangs in rnd8

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!

Parents
  • Hi, 

    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?

     For normal 1MBit BLE, the RADIO_MODE_MODE_Ble_1Mbit should be used with modulated tx output. Note that you may have to use 2MBit BLE as well, depending on what you're going to use in your application.

    Specific for BLE certification, test houses usually prefer to use direct_test_mode (DTM).

    For unmodulated, it does not matter, as the carrier does not contain any data (ie: unmodulated = pure sine wave)

    2) for radio certification testing, should I use RADIO_TXPOWER_TXPOWER_0dBm or RADIO_TXPOWER_TXPOWER_Pos4dBm or ?

    This should match your applications max. tx output. You should inherit your own applications TXPOWER setting.

     

    3) when I call radio_modulated_tx_carrier, why does it hang during random number generation:

    Its likely that the RNG isn't started in your initialization routine. Try starting the RNG similar to this (in your init() function):

    NRF_RNG->TASKS_START = 1;

    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 ?

    direct test mode is setup per the bluetooth core specification, and is made to be interfaced with a dedicated bluetooth tester. If you want to do bluetooth certification, I recommend that you run this as a separate action, as compared to teleregulatory compliance. 

    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?

    You should disable the softdevice, then start up the hfclk and other dependencies the radio_test requires to run. The current consumption of the device is usually a good indication on which state it is in. 3-4 mA indicates the CPU is running.

     

    Kind regards,

    Håkon 

  • Thanks Håkon,  

    The HFCLK and NRF_RNG->TASKS_START were the main issues, thanks for your helpful response!

  • Hi!

     

    Anthony Ambuehl said:

    The HFCLK and NRF_RNG->TASKS_START were the main issues, thanks for your helpful response!

    I am glad to hear that you solved the issues!

     

    Cheers,

    Håkon 

Reply Children
No Data
Related