This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE DFU and BEACON Rx Tx

Hi, i use the SDK11 and i will send and receive beacon and be able to launch a BLE DFU.

  1. I am able to make a software in wich i can receive and send BEACON but in this case the BLE DFU doesn't work.

  2. I have a other program in witch i can send Beacon and make the BLE DFU but i can't receive BEACON, when i receive a Beacon the device restart.

I use the softdevice s132 and i have begin my soft with the example dfu/bootloader/pca10040/

here is the initialisation of ble_stack :

static void ble_stack_init(bool init_softdevice) { uint32_t err_code; sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, }; nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;

if (init_softdevice)
{
    err_code = sd_mbr_command(&com);
    APP_ERROR_CHECK(err_code);
}

err_code = sd_softdevice_vector_table_base_set(BOOTLOADER_REGION_START);
APP_ERROR_CHECK(err_code);

SOFTDEVICE_HANDLER_APPSH_INIT(&clock_lf_cfg, true);

// Enable BLE stack.
ble_enable_params_t ble_enable_params;
// Only one connection as a central is used when performing dfu.
err_code = softdevice_enable_get_default_config(1, 1, &ble_enable_params);
APP_ERROR_CHECK(err_code);

ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
err_code = softdevice_enable(&ble_enable_params);
APP_ERROR_CHECK(err_code);

err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
APP_ERROR_CHECK(err_code);

}

for the scan i use : static void scan_start(void) { uint32_t err_code; uint32_t count;

// Verify if there is any flash access pending, if yes delay starting scanning until
// it's complete.
err_code = pstorage_access_status_get(&count);
APP_ERROR_CHECK(err_code);

if (count != 0)
{
    m_memory_access_in_progress = true;
    return;
}

m_scan_param.active       = 0;            // Active scanning set.
m_scan_param.selective    = 0;            // Selective scanning not set.
m_scan_param.interval     = SCAN_INTERVAL;// Scan interval.
m_scan_param.window       = SCAN_WINDOW;  // Scan window.
m_scan_param.p_whitelist  = NULL;         // No whitelist provided.
m_scan_param.timeout      = 0x0000;       // No timeout.


err_code = sd_ble_gap_scan_start(&m_scan_param);
APP_ERROR_CHECK(err_code);

}

Sorry for my bad english, and thanks for you help.

How can i solve my problem?

Parents Reply Children
No Data
Related