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

Advertisements on custom board slower than on PCA10040

Hello,

I used a the ble_app_template example to set up advertisements on the PCA10040 board and on our custom board. Both boards function and have good signal strength. However, the number of advertising packets received from the custom board are significantly less (5x less) than what are received from the dev board. I have looked at the power lines on both boards and they are clean. The custom board had a wrongly placed 32MHz crystal which has been reworked. I am using a 32.768khz crystal as well. 

What should I try next? Any thoughts on why I am getting two different behaviors for the same code on the custom board and the dev board?

#define APP_FAST_ADV_INTERVAL                160
#define APP_FAST_ADV_DURATION                0      

#define APP_SLOW_ADV_INTERVAL                320
#define APP_SLOW_ADV_DURATION                0

static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    ret_code_t err_code;

    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            NRF_LOG_INFO("Fast advertising.");
						SEGGER_RTT_printf(0, "Fast advertising\n");
            err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_ADV_EVT_IDLE:
            sleep_mode_enter();
            break;
				case BLE_ADV_EVT_SLOW:
						SEGGER_RTT_printf(0, "slow advertising\n");
						err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING_SLOW);
            APP_ERROR_CHECK(err_code);
						break;
        default:
            break;
    }
}

static void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;
	uint8_t manuf_data[] = 
		{ 
			MANUF_VERSION_NO, 
			MANUF_FW_VERSION, 
			0x00,
			0x01,
			0x64
    	};


	ble_advdata_manuf_data_t manuf_specific_data;
    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;

    manuf_specific_data.data.p_data        = manuf_data;
    manuf_specific_data.data.size          = sizeof(manuf_data);					
							
	memset(&init, 0, sizeof(init));					

    init.advdata.name_type               = BLE_ADVDATA_SHORT_NAME;
	init.advdata.short_name_len					 = 7;					
    init.advdata.include_appearance      = false;
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    init.advdata.uuids_complete.uuid_cnt = 0;//sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.advdata.uuids_complete.p_uuids  = m_adv_uuids;
		init.advdata.p_manuf_specific_data = &manuf_specific_data;					

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_FAST_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_FAST_ADV_DURATION;
		
	init.config.ble_adv_slow_enabled  = false;
    init.config.ble_adv_slow_interval = APP_SLOW_ADV_INTERVAL;
    init.config.ble_adv_slow_timeout  = APP_SLOW_ADV_DURATION;

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}



Parents
  • If the code is the same, then the big difference comes from the accuracy of the crystals you are using. You have to tell the BLE stack the correct accuracy in ppm of the crystals used. 

    What is the device that is receiving these advertising packets? is it another low power device or a sniffer?

    I would recommend you to sniff the packets of the two devices separately. That is switch the other advertiser off when sniffing one. This is to make sure if the air traffic of the two devices look the same without interference from the other.

  • The 32MHz crystal used has a frequency stability of 50ppm. I believe the PCA10040 has a crystal with 20ppm stability. I will update the config file to reflect our crystal. But does this make such a huge difference? 

    We have a custom desktop application with a USB dongle used to pick up advertising packets from our devices. I have several production devices using nRF51 which advertise at 200ms, phones which advertise at 100ms, and the new nRF52 board which should be advertising at 100ms as well. I see all the other devices at their respective advertising rates, except this one new board. 

Reply
  • The 32MHz crystal used has a frequency stability of 50ppm. I believe the PCA10040 has a crystal with 20ppm stability. I will update the config file to reflect our crystal. But does this make such a huge difference? 

    We have a custom desktop application with a USB dongle used to pick up advertising packets from our devices. I have several production devices using nRF51 which advertise at 200ms, phones which advertise at 100ms, and the new nRF52 board which should be advertising at 100ms as well. I see all the other devices at their respective advertising rates, except this one new board. 

Children
Related