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

Device address fro public device address format

Hi In current Desktop 2 project, We know that software device stack takes 48-bit random device address from FICR registers (DEVICEADDR[1: 0]) for BTLE. Each nRF51 has unigue address. We are planning to apply public device address (compny_assigned + company_id) from IEEE. How can we replace FICR device address by it in nRF51? Then, no side effect at all.

  • Hi there,

    To call any of the SoftDevice functions (sd_*) you first need to enable the SoftDevice.

    Enabling it and then setting the address should work fine.

    Regards,

    Carles

  • Hi I also tried changing device address after enable software device. It still not work. Is there another way to change dvice address?

  • Hi there,

    No, there is no other way. You may be doing something else incorrectly. Maybe you could attach your source file to this thread?

    Thanks,

    Carles

  • Hi, I have no idea how to attach the sorce file. The original project is Desktop 2 v1.0.4 mouse with sofware device v5.1.0. I only modified the below function for verifying. The hardware is nRFgo developement kit (nRF6310). JTAG lite programmer was connected to nRF51822 daughter board and then entered debug mode. Set breakpoint at _NOP.

    .

    static void m_coms_btle_enable_post(void * p_event_data, uint16_t event_size) { uint32_t err_code; ble_gap_addr_t ble_addr;

    *(uint32_t *)0x40000504 = 0xC007FFDF;
    *(uint32_t *)0x40006C18 = 0x00008000;
    
    err_code = ble_stack_init();
    ASSERT(err_code == NRF_SUCCESS);   
    

    // err_code = nrf_power_perpower_set(0x00000040);

    err_code = gap_params_init();
    ASSERT(err_code == NRF_SUCCESS);
    
    err_code = advertising_init(BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE);
    ASSERT(err_code == NRF_SUCCESS);
    
    err_code = services_init();
    ASSERT(err_code == NRF_SUCCESS);
    
    err_code = conn_params_init();
    ASSERT(err_code == NRF_SUCCESS);
    
    sec_params_init();
    
    err_code = advertising_start();
    ASSERT(err_code == NRF_SUCCESS);
    

    //@@@ ble_gap_addr_t same_addr; same_addr.addr[0] = 0x00; same_addr.addr[1] = 0x01; same_addr.addr[2] = 0x02; same_addr.addr[3] = 0x03; same_addr.addr[4] = 0x04; same_addr.addr[5] = 0x05;

    	sd_ble_gap_address_set(&same_addr);  
    err_code = sd_ble_gap_address_get(&ble_addr);   
    ASSERT(err_code == NRF_SUCCESS);
    	
    

    //@@@ if((ble_addr.addr[0] ==0)&&(ble_addr.addr[1] ==1)&&(ble_addr.addr[2] ==2)&&(ble_addr.addr[3] ==3)&&(ble_addr.addr[4] ==4)&&(ble_addr.addr[5] ==5)){ __NOP(); }

    // if (m_coms_btle_is_bond_stored() == false) // { // err_code = m_nfc_init(ble_addr.addr, // s_oob_key, // DEVICE_NAME, // sizeof(DEVICE_NAME), // BLE_APPEARANCE); // ASSERT(err_code == NRF_SUCCESS);
    //
    // m_nfc_enable(); // } }

  • You are not setting the same_addr.addr_type in the code snippet you pasted.

Related