8 Replies Latest reply on Sep 10, 2020 1:18 AM by SheetalJ_96

    Programming Wi-Fi MAC Address and BT Address (Public device address) in MTB

    KeTa_1341526

      Hello,

       

      Is it possible to do the following in MTB?

      Target: CYW43438

       

      1) Wi-Fi MAC address

          The following describes how to change the MAC address in WICED.

          Wifi mac address modification in WICED

          Like "CUSTOM MODE" of this Forum, I want to change the MAC address with Modus.

          However, I can't find a similar API for the WHD API.

          Does the current version of MTB support it?

       

      2) BT Address/Public device Address

          I want to change the BD address as well as the Wi-Fi MAC address.

          Is there an API to change the BD address with the HCI command?

       

      Best regards,

      Takahashi

        • 1. Re: Programming Wi-Fi MAC Address and BT Address (Public device address) in MTB
          MuraliR_36

          Hello KeTa_1341526

           

          1. The host_get_mac_address() ultimately used the wwd_wifi_set_mac_address(). The equivalent of this can be found at whd_wifi.c with the API being whd_wifi_set_mac_address()

          2. There is no API as such to change the BT MAC of combo devices, however you can use vendor specific HCI commands to achieve this as shown below.

          Capture.PNG

           

          Thanks

          • 2. Re: Programming Wi-Fi MAC Address and BT Address (Public device address) in MTB
            KeTa_1341526

            Hello MuraliR_36,

             

            Thank you for your reply.

            About 2, I found the following Forum.

            Configuring the Bluetooth device address in CYW20706

             

            Is it possible to use [3. Using the Factory_Commit_BD_ADDR VSC] of this?

            Is it possible to issue a Vendor specific command by using "wiced_bt_dev_vendor_specific_command"?

             

            Best regards,

            Takahashi

            • 3. Re: Programming Wi-Fi MAC Address and BT Address (Public device address) in MTB
              SheetalJ_96

              Yes it is possible to use wiced_bt_dev_vendor_specific_command() to send the vendor specific command.

              Also, to make it clear, the blog post you mentioned is specific for CYW20706, not the combo device like 43438.

              • 4. Re: Programming Wi-Fi MAC Address and BT Address (Public device address) in MTB
                KeTa_1341526

                >Also, to make it clear, the blog post you mentioned is specific for CYW20706, not the combo device like 43438.

                You say I can use wiced_bt_dev_vendor_specific_command on CYW43438, right?

                 

                It was also described in the API document for the WICED version of the Combo device, so I think that it can also be used with the Combo device.

                API Reference: WICED Studio 6.2.1 (Wi-Fi/Combo)

                • 7. Re: Programming Wi-Fi MAC Address and BT Address (Public device address) in MTB
                  RaKa_4768241

                  Hi Sheetal,

                   

                  I am also facing similar type of issue and had initiated mail thread in below link:

                  Configuring unique BD address for client device in CYBT-483039-EVAL

                   

                  we have used the wmbt command line to set the BD address. Although we have put the BT_DEVICE_ADDRESS=FFFFFFFFFFFF in make target, but while setting factory commit VSC command, it is failed to execute and showing below message:

                   

                  "Failed execute_factory_commit_bd_addr. Make sure the BD ADDR was programmed to all FFs before using this command!"

                   

                  Please check in steps that we followed for your reference and please suggest if we are doing anything wrong.

                   

                  Microsoft Windows [Version 10.0.18362.1016]

                  (c) 2019 Microsoft Corporation. All rights reserved.

                   

                   

                  C:\Users\Admin>cd Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt help

                  set environment variables: MBT_BAUD_RATE and TRANSPORT_MODE (0: HCI, 1: WICED_HCI)

                   

                   

                  NOTE: MBT_BAUD_RATE Must match baud rate configured in embedded application

                   

                   

                  eg) on Windows,

                      set MBT_BAUD_RATE=4000000

                      set TRANSPORT_MODE=1

                  eg) on Cygwin,

                      export MBT_BAUD_RATE=4000000

                      export TRANSPORT_MODE=1

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>set MBT_BAUD_RATE=4000000

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>set TRANSPORT_MODE=0

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt help

                  MBT_BAUD_RATE:  4000000

                  TRANSPORT_MODE: 0 (HCI)

                   

                   

                  Usage: wmbt help

                  Usage: wmbt download COMx <hcd_pathname>

                  Usage: wmbt reset COMx

                         NOTE: Sends HCI_RESET at 115200

                  Usage: wmbt reset_highspeed COMx

                         NOTE: Sends HCI_RESET at the configured MBT_BAUD_RATE

                  Usage: wmbt wiced_reset COMx

                         NOTE: Sends HCI_CONTROL_COMMAND_RESET at the configured MBT_BAUD_RATE

                  Usage: wmbt le_receiver_test COMx <rx_frequency>

                  Usage: wmbt le_transmitter_test COMx <tx_frequency> <data_length> <data_pattern>

                  Usage: wmbt le_enhanced_receiver_test COMx <rx_channel> <PHY> <modulation_index>

                  Usage: wmbt le_enhanced_transmitter_test COMx <tx_channel> <data_length> <data_pattern> <PHY>

                  Usage: wmbt le_test_end COMx

                  Usage: wmbt tx_frequency_arm COMx <carrier on/off> <tx_frequency> <mode> <modulation_type> <tx_power>

                  Usage: wmbt receive_only COMx <rx_frequency>

                  Usage: wmbt radio_tx_test COMx <bd_addr> <frequency> <modulation_type> <logical_channel> <bb_packet_type> <packet_length> <tx_power>

                  Usage: wmbt radio_rx_test COMx <bd_addr> <frequency> <modulation_type> <logical_channel> <bb_packet_type> <packet_length>

                  Usage: wmbt enable_bqb_test_mode COMx

                  Usage: wmbt read_bd_addr COMx

                  Usage: wmbt factory_commit_bd_addr COMx <bd_addr>

                         NOTE: This writes the BD_ADDR to the Static Section (SS) area of flash.

                               To utilize this command, the BD_ADDR MUST be initially set to all FFs.

                   

                   

                  Check Bluetooth Core 4.1 spec vol. 2 Sections 7.8.28-7.2.30

                  for details of LE Transmitter and Receiver tests

                   

                   

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt reset COM13

                  MBT_BAUD_RATE:  4000000

                  TRANSPORT_MODE: 0 (HCI)

                   

                   

                  Opened COM13 at speed: 115200

                  Close Serial Bus

                  Opened COM13 at speed: 4000000

                  Sending HCI Command:

                  0000 < 01 03 0C 00 >

                  Received HCI Event:

                  0000 < 04 0E 04 01 03 0C 00 >

                  Success

                  Close Serial Bus

                   

                   

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt read_bd_addr COM13

                  MBT_BAUD_RATE:  4000000

                  TRANSPORT_MODE: 0 (HCI)

                   

                   

                  Opened COM13 at speed: 4000000

                  Close Serial Bus

                  Opened COM13 at speed: 4000000

                  Sending HCI Command:

                  0000 < 01 09 10 00 >

                  Received HCI Event:

                  0000 < 04 0E 0A 01 09 10 00 FF FF FF FF FF FF >

                   

                   

                  Success BD_ADDR = ffffffffffff

                   

                   

                  Close Serial Bus

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt reset COM13

                  MBT_BAUD_RATE:  4000000

                  TRANSPORT_MODE: 0 (HCI)

                   

                   

                  Opened COM13 at speed: 115200

                  Close Serial Bus

                  Opened COM13 at speed: 4000000

                  Sending HCI Command:

                  0000 < 01 03 0C 00 >

                  Received HCI Event:

                  0000 < 04 0E 04 01 03 0C 00 >

                  Success

                  Close Serial Bus

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt factory_commit_bd_addr COM13 112233445566

                  MBT_BAUD_RATE:  4000000

                  TRANSPORT_MODE: 0 (HCI)

                   

                   

                  Opened COM13 at speed: 4000000

                  Close Serial Bus

                  Opened COM13 at speed: 4000000

                  Sending HCI Command:

                  0000 < 01 10 FC 07 66 55 44 33 22 11 00 >

                  Received HCI Event:

                  0000 < 04 0E 04 01 10 FC 01 >

                  Failed execute_factory_commit_bd_addr. Make sure the BD ADDR was programmed to all FFs before using this command!

                  Close Serial Bus

                   

                   

                  C:\Users\Admin\Documents\WICED-Studio-6.4\wiced_tools\wmbt\Release>wmbt factory_commit_bd_addr COM13 112233445566

                  MBT_BAUD_RATE:  4000000

                  TRANSPORT_MODE: 0 (HCI)

                   

                   

                  Opened COM13 at speed: 4000000

                  Close Serial Bus

                  Opened COM13 at speed: 4000000

                  Sending HCI Command:

                  0000 < 01 10 FC 07 66 55 44 33 22 11 00 >

                  Received HCI Event:

                  0000 < 04 0E 04 01 10 FC 01 >

                  Failed execute_factory_commit_bd_addr. Make sure the BD ADDR was programmed to all FFs before using this command!

                  Close Serial Bus