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

Gazell MAC Address

Is there a similar way tot get the radio's MAC address when using Gazell only (no BLE)?

In SoftDevice there is a "sd_ble_gap_address_get()" function call.

  • Hi,

    The RF address in bluetooth (MAC) is different from the RF address in gazell, in terms of the length and build-up.

    To get/set the RF address in gazell, you need to use the functions given by the gazell API: developer.nordicsemi.com/.../a00955.html

    Here are the functions you're looking for (snippet from nrf_gzll.h):

    /**
     * @brief Set the base address for pipe 0.
     *
     * The full on-air address for each pipe is composed of a multi-byte base address
     * prepended to a prefix byte.
     *
     * For packets to be received correctly, the most significant byte of 
     * the base address should not be an alternating sequence of 0s and 1s i.e. 
     * it should not be 0x55 or 0xAA. 
     *
     * @param base_address The 4 byte base address. All bytes are used.
     *
     * @retval true  If the parameter was set.
     * @return false If Gazell was enabled.
     */
    bool nrf_gzll_set_base_address_0(uint32_t base_address);
    
    
    /**
     * @brief Get function counterpart to nrf_gzll_set_base_address_0().
     *
     * @return Base address 0.
     */
    uint32_t nrf_gzll_get_base_address_0(void);
    
    
    /**
     * @brief Set the base address for pipes 1-7.
     *
     * Pipes 1 through 7 share base_address_1. @sa nrf_gzll_set_base_address_0.
     *
     * @param base_address The 4 byte base address.
     *
     * @retval true  If the parameter was set.
     * @retval false If Gazell was enabled.
     */
    bool nrf_gzll_set_base_address_1(uint32_t base_address);
    
    
    /**
     * @brief Get function counterpart to nrf_gzll_set_base_address_1().
     *
     * @return Base address 1.
     */
    uint32_t nrf_gzll_get_base_address_1(void);
    
    
    /**
     * @brief Set the address prefix byte for a specific pipe.
     *
     * Each pipe should have its own unique prefix byte. 
     *
     * @param pipe                The pipe that the address should apply to.
     *                            This value must be < NRF_GZLL_CONST_PIPE_COUNT. 
     * @param address_prefix_byte The address prefix byte.
     *
     * @retval true  If the parameter was set.
     * @retval false If Gazell was enabled, or if the pipe was invalid.
     */
    bool nrf_gzll_set_address_prefix_byte(uint32_t pipe, uint8_t address_prefix_byte);
    
    
    /**
     * @brief Get function counterpart to nrf_gzll_set_address_prefix_byte().
     *
     * @param pipe                    The pipe for which to get the address.
     *                                This value must be < NRF_GZLL_CONST_PIPE_COUNT.
     * @param out_address_prefix_byte The pointer in which to return the 
     *                                address prefix byte.
     * 
     * @retval true If the parameter was returned.
     * @retval false If Gazell was enabled, the pipe was invalid or 
     *               out_address was a NULL pointer.
     */
    bool nrf_gzll_get_address_prefix_byte(uint32_t pipe, uint8_t* out_address_prefix_byte);
    
  • I don't really want to get and set the address for gazell. I understand how those addresses are used.

    What I actually want to do with the MAC address is use it is as a unique identifier, instead of creating my own serial number for the device. If there is already a unique random number that is generated at manufacturing of the silicon then I'd like to leverage number as a way of tracking the final product.

    So to rephrase my question. Regardless of gazell or softdevice, is the radio's random 6 byte MAC address available via registers to read from the nRF51822?

  • Yes, there are several such identifiers. The BLE address used by the softdevices is based on a random number that is programmed into the chip during manufacturing. You can use this 48-bit value regardless of gazell or softdevice.

    There's also a 64-bit device ID (also programmed during manufacturing) that can be used for this purpose.

    Both these numbers are found in the Factory Information Configuration Register (FICR). See section 6 of the nRF51 Reference Manual. Specifically look for the DEVICEID and DEVICEADDR registers.

  • Thank you very much! Exactly what I was looking for.

Related