This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

wl1271,Bluetooth mac address programming

Other Parts Discussed in Thread: WL1271

Hi ,

we have used to EEPROM to store MAC address of WLAN and BT. I can set the Customized MAC address for WLAN using ifconfig command or  hostapd.conf .

I would like to know, is there any way to programm BT mac address?

Thanks & Regards

Raghu Ramaraj

  • Hi,

    You can wright BD address using the HCI command
    http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_Write_BD_Addr_.280xFC06.29


    Note that you cannot permanently set the BD address. you need to configure the BD Address of the device after booting up wl1271 every time. The BD address written with the above command is persistent only while the BT radio is on. Turning it off and on again will cause bd_addr to revert to the value stored in the ROM.
  • hi ,
    Thanks for your reply . I would like to know whether the chip(wl1271) is coming up with pre assigned MAC/bd address ?

    I am getting the different BD address when i am running it on different boards using same sdcard . Because if it is taking from nvs file , then i should get the same BDaddress right ?


    Regards
    Raghu Ramaraj
  • Hi,

    As i have mentioned in my previous mail, you need to change the BD address of the device after BT is turned on. After that if you search for the DUT from the remote device, you should be discovered with the new BD address.
  • Hi,

    I understood the process of programming custom BD address . But i havent done this yet . I am using SDcard to boot up the system and aswell as BT . I am getting different two BDaddress when i am running it in two different custom board (with BT chip) using the same sdcard.

    Regards
    Raghu Ramaraj
  • Hi,
    what do you mean by "when i am running it in two different custom board " ? different BT chips?
  • Hi Sundeep,

    This is basavaraj , Thank you for early reply to us,

    We are using two custom boards of same type which are having same BT chip (WG7311).

    Here, we are getting the different BD address from each board, whenever we boot up from same sdcard on both boards (sdcard contains our linux app).

    So, our question is:- whether BT chip comes up with pre assigned MAC/bd address ? because we are finding different BD address in each chip/Board without any write/program the BD address from our end.

    Please let us know your opinion on this ?

    Thanking you
    Basavaraj
  • Hi,

    My question is If you are having two BT chip (WG7311) attached to two different custom boards you are having (i.e., one WG7311 in each custom board)?

  • Hi,

    Yes, exactly, one WG7311 chip in each custom board, and each board we are booting up independently using same sdcard

    Thanks and regards
    Basavaraj
  • Hi,

    Ok, That is how it should be. The Bluetooth BD address is unique for every device, it is on the ROM.
  • Hi Sundeep,

    Thank you very much your kind reply,
    Here i have one question is

    *) When the Bluetooth BD address is unique for every device, it is already on the ROM :- Can we use same BDaddress for our product ? is there any IP issue / royalty fees to use this BD address ?

    Can you please clarify on this ?

    Thanks and regards
    Basavaraj
  • Hi Sundeep,

    Thank you once again for reply,

    Here, as we know that WG7311 is combo chip having BT and WIFI module together,
    So our another doubt is

    1) When the Bluetooth BD address is unique for every device, it is on the ROM :- is it applicable for wifi too ? i mean is WIFI mac address also comes with chip/preassigned ?

    Thanks and regards
    Basavaraj
  • Hi,
    obviously yes. you can only use the BD address For BT.

  • Hi,

    Thank you reply,
    I would like know the answer for below doubt, so I am posting once again,

    *) When the Bluetooth BD address is unique for every device, it is already on the ROM :- Can we use same BD address for our product ? is there any IP issue / royalty fees to use this BD address ?

    Can you please share your opinion.

    Thanks and regards
    Basavaraj
  • Hi,

    Yes.

    and you question related to WiFi (below), I will let Gigi answer
    When the Bluetooth BD address is unique for every device, it is on the ROM :- is it applicable for wifi too ? i mean is WIFI mac address also comes with chip/preassigned ?
  • Hi,

    Regarding: "is it applicable for wifi too ? i mean is WIFI mac address also comes with chip/preassigned ?"
    The WLAN MAC address will be BD_ADDR+1 when we have configured the address as empty (or 00:00:00:00:00:00) in the NVS file.

    Regards,
    Gigi Joseph.
  • Hi Sundeep,

    Thank you for your reply,

    So, you meant to say, we can use same BD address (which comes up with the chip) for our product without paying any royalty fees as it will not make any IP issue, right ?

    Please confirm to us.

    Thanks and regards
    Basavaraj
  • Hi Gigi,

    Thank you very much for your reply,

    I have done some observation, by using our same sdcard in two our custom boards of same type, each board having WG73311 chip,

    In case of Bluetooth, we can able to see each unique BD address in each board ( when we type :- hciconfig hci0 )

    But in case of Wifi :- we are not able to see unique Wifi MAC address (BD Address+1) as you said, we are seeing common dummy/unknown MAC address, Please have look on below log for more information,

    Board No 1 -log
    ---------------------------------------------------------------------
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: de:ad:be:ef:00:00
    #
    #
    # ifconfig wlan0
    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet 192.168.0.30 netmask 255.255.255.0 broadcast 192.168.0.255
    ether de:ad:be:ef:00:00 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    # hciconfig hci0 -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 78:C5:E5:68:E0:06 ACL MTU: 1021:4 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1510 acl:0 sco:0 events:50 errors:0
    TX bytes:1502 acl:0 sco:0 commands:50 errors:0
    Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF
    Link mode: SLAVE ACCEPT
    Name: 'my_bt'
    Class: 0x400100
    Service Classes: Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 4.0 (0x6) Revision: 0x0
    LMP Version: 4.0 (0x6) Subversion: 0x1f29
    Manufacturer: Texas Instruments Inc. (13)

    #

    Board No 2 -log
    ---------------------------------------------------------------------
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: de:ad:be:ef:00:00
    #
    # ifconfig wlan0
    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet 192.168.0.30 netmask 255.255.255.0 broadcast 192.168.0.255
    ether de:ad:be:ef:00:00 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    # hciconfig hci0 -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 88:33:14:81:01:78 ACL MTU: 1021:4 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1508 acl:0 sco:0 events:50 errors:0
    TX bytes:1500 acl:0 sco:0 commands:50 errors:0
    Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF
    Link mode: SLAVE ACCEPT
    Name: 'my_bt'
    Class: 0x400100
    Service Classes: Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 4.0 (0x6) Revision: 0x0
    LMP Version: 4.0 (0x6) Subversion: 0x1f29
    Manufacturer: Texas Instruments Inc. (13)

    #
    #


    Can you please explain to us , why the behavior is like this ?

    Thanks and regards
    Basavaraj
  • Hi Gigi,

    Thank you for your reply,

    We have done some observation, using same sdcard in two custom boards of same type, each having WG7311 chip.

    In case of BT :- We are able to see the unique BD address from each board (when we type hciconfig hci0)

    But in case of WIFI :- we are not seeing unique WIFI Mac address (BD address+1) in each board as you said, we are seeing a common dummy/unknown WIFI Mac Address from both boards,

    Please have look on below logs for more info,


    Board No 1 -log
    -----------------------------------------
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: de:ad:be:ef:00:00
    #
    #
    # ifconfig wlan0
    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet 192.168.0.30 netmask 255.255.255.0 broadcast 192.168.0.255
    ether de:ad:be:ef:00:00 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    # hciconfig hci0 -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 78:C5:E5:68:E0:06 ACL MTU: 1021:4 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1510 acl:0 sco:0 events:50 errors:0
    TX bytes:1502 acl:0 sco:0 commands:50 errors:0
    Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF
    Link mode: SLAVE ACCEPT
    Name: 'my_bt'
    Class: 0x400100
    Service Classes: Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 4.0 (0x6) Revision: 0x0
    LMP Version: 4.0 (0x6) Subversion: 0x1f29
    Manufacturer: Texas Instruments Inc. (13)

    #

    Board No 2 -log
    -----------------------------------
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: de:ad:be:ef:00:00
    #
    # ifconfig wlan0
    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
    inet 192.168.0.30 netmask 255.255.255.0 broadcast 192.168.0.255
    ether de:ad:be:ef:00:00 txqueuelen 1000 (Ethernet)
    RX packets 0 bytes 0 (0.0 B)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 0 bytes 0 (0.0 B)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    # hciconfig hci0 -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 88:33:14:81:01:78 ACL MTU: 1021:4 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1508 acl:0 sco:0 events:50 errors:0
    TX bytes:1500 acl:0 sco:0 commands:50 errors:0
    Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF
    Link mode: SLAVE ACCEPT
    Name: 'my_bt'
    Class: 0x400100
    Service Classes: Telephony
    Device Class: Computer, Uncategorized
    HCI Version: 4.0 (0x6) Revision: 0x0
    LMP Version: 4.0 (0x6) Subversion: 0x1f29
    Manufacturer: Texas Instruments Inc. (13)

    #
    #

    Can you please explain to us, why the behavior like it ?

    Thanks and regards
    Basavaraj

  • Hi Basavaraj,

    As I said, the WLAN MAC address will be BD_ADDR+1 when we have configured the address as empty (or 00:00:00:00:00:00) in the NVS file.
    It seems in your case, the NVS file contains the mac address as: "de:ad:be:ef:00:00" and hence it is showing that mac id.

    Please write "00:00:00:00:00:00" to the nvs file and see if it makes a difference. To do that, please use the below command.
    calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00

    Please see: http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process for more details.

    Regards,
    Gigi Joseph.
  • Hi Gigi,

    Thank you very much for your reply,

    We have are able to set the mac address to "00:00:00:00:00:00" and but not able to see required WIFI Mac address after reboot/bootup the boards, its not showing the required Wifi Mac Address ie. BDAddress+1.

    Please see the logs below for more info,

    Set WIFI Mac address in Board#1 :-
    -----------------------------------------------
    ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: de:ad:be:ef:00:00
    #
    #
    # ./calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00
    :00:00:00
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: 00:00:00:00:00:00

    After reboot - Board #1
    ---------------------------------
    #
    #
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: 00:00:00:00:00:00


    After reboot - Board #2 -
    ---------------------------------
    #
    #
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: 00:00:00:00:00:00

    Can you please suggest why WIFi MAc address is not taking from ROM ?

    FYI : BD address is unique in each board as before.

    Thanks and regards
    Basavaraj
  • Hi Basavaraj,

    This is expected.
    You are writing "00:00:00:00:00:00" to the nvs file, and reading the same from the nvs file.

    What you should be doing is:

    1. calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00
    2. rmmod wl12xx
    3. rmmod wl12xx_sdio
    4. modprobe wl12xx
    5. modprobe wl12xx_sdio
    6. Verify the mac address by typing "ifconfig wlan0'

    Please let me know if it works for you.

    Regards,
    Gigi Joseph.
  • Hi Gigi,

    Thank you for reply,

    When am trying to change the BD address, its not taking it,

    #hciconfig hci0
    hci0: Type: BR/EDR Bus: UART
    BD Address: 78:C5:E5:68:E0:06 ACL MTU: 1021:4 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1792 acl:0 sco:0 events:53 errors:0
    TX bytes:1516 acl:0 sco:0 commands:53 errors:0

    # ./calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 78:C5:E5
    :68:E0:07
    # ./calibrator get nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin
    MAC addr from NVS: 78:c5:e5:68:e0:07
    #
    # hciconfig hci0
    hci0: Type: BR/EDR Bus: UART
    BD Address: 78:C5:E5:68:E0:06 ACL MTU: 1021:4 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1792 acl:0 sco:0 events:53 errors:0
    TX bytes:1516 acl:0 sco:0 commands:53 errors:0

    After reboot also same above address showing ie 78:C5:E5:68:E0:06,

    The procedure which i followed to change the BD Address is correct or is their any other way to change the BD Address ?
    Please help us

    Thanks and regards
    Basu
  • Hi Basu,

    The procedure to change the BD address is totally different from the nvs method. The nvs is used for WLAN. I believe Sundeep has already explained the procedure to change the BD address in the same post. You may have missed. Anyway, here it is again:

    ***
    You can write BD address using the HCI command
    http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_Write_BD_Addr_.280xFC06.29

    Note that you cannot permanently set the BD address. you need to configure the BD Address of the device after booting up wl1271 every time. The BD address written with the above command is persistent only while the BT radio is on. Turning it off and on again will cause bd_addr to revert to the value stored in the ROM.
    ***


    Regards,
    Gigi Joseph.
  • Hi Gigi,

    Thank you for reply,


    As i followed http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_Write_BD_Addr_.280xFC06.29

    So, I am trying with below command with varies options, getting error, not able to set the new BD address,


    # HCI_VS_Write_BD_ADDR 0xFC06 78:C5:E5:68:E0:07
    -/bin/sh: HCI_VS_Write_BD_ADDR: not found

    # HCI_VS_Write_BD_ADDR 0xFC06 "78:C5:E5:68:E0:07"
    -/bin/sh: HCI_VS_Write_BD_ADDR: not found

    # HCI_VS_Write_BD_ADDR 0xFC0,6 "78:C5:E5:68:E0:07"
    -/bin/sh: HCI_VS_Write_BD_ADDR: not found
    #

    Please let me know what is the problem here?

    Thanks and regards
    Basu
  • Hi Basu,

    HCI_VS_Write_BD_ADDR is a vendor specific HCI command that needs to be sent to the TI chipset.
    BlueZ has a utility by which you can send commands to the chip. It is called hcitool. To convert HCI commands to hcitool format, please see: http://processors.wiki.ti.com/index.php/WL18xx_Bluetooth_RF_Testing#Conversion_of_HCI_cmds_to_HCITool_Tool_format

    For your case, please type:
    hcitool cmd 0x3f 0x0006 <New BD address: 6 bytes>


    Regards,
    Gigi Joseph.
  • Hi Gigi,

    Its working, thank you very much for your help :)

    Best regards

    Basu

  • Hi Basu,

    Thank you very much for the update. I will mark it as closed.

    Regards,
    Gigi Joseph.
  • Hi Joseph, could you help explain how to convert HCI commands to hcitool format? The link you sent is no longer available on TI website. Thanks.