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); }