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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaKa_4741636
Level 1
Level 1
First like received First like given

Hi Team,

I am using CYBT-483039_Evaluation board and using the Bluetooth Designer for client development application.

We need to have unique BD address for 'n' number of clients, which should get randomly generated BD address during programming(flashing) and it should never change even after restarting client device.

I have tried some setting change and below are the results:

1. I have changed the BD address setting in wiced_bt_cfg.c as WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE, with this we are able to get fixed BD address(0x20 0x71 0x9b 0x19 0x3e 0x41) for all the client development application. 

2. To get the random BD address, I have also changed the BD address setting in wiced_bt_cfg.c as WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_CHANGE_TIMEOUT, with this we are able to get random BD address, during programming and restarting the evaluation board.

So we would required as “once we programmed the client device, each client must get unique BD address and it should never change even after restarting client device”.

So please suggest on how we can do this change?

0 Likes
1 Solution

Never mind, got it working by using the WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE define in the configuration. 

These are the steps I used to get it working:

1) edited the wiced_app_cfg.c file to change .rpa_refresh_timeout to WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE

2) built the application with the flag BT_DEVICE_ADDRESS=00A050AABBCC and programmed

3) Ran the application and saw that 00A050AABBCC was the address being advertised

4) Ran the WICED Module Programmer utility to program in a different address, used 00A050112233

5) Ran the application and saw that 00A050112233 was the address being advertised.

Rakesh - I think this could be a workable solution for your production.

View solution in original post

15 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

Please try using BT_DEVICE_ADDRESS=112233445566 (or any suitable BD address) in the make target string to set custom BD address. Eg: demo.hello_client-CYW920719Q40EVB_01 BT_DEVICE_ADDRESS=112233445566 download

Also, you can configure WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE in the wiced_bt_cfg.c.

Please check the Makefile located in  "WICED-Studio-6.4\20719-B1_Bluetooth\" for getting more info regarding similar macros.

[BT_DEVICE_ADDRESS=zzzzzzzzzzzz|random]

Use the 48-bit Bluetooth address specified here instead of the default setting from Platform/*/*.btp file. The special string 'random' (without the quotes) will generate a random Bluetooth device address on every download.

Thanks,

-Dheeraj

Hi Dheeraj,

Thanks for your quick support!!!!!

Can we get the BD address automated, Instead of manual setting the BT_DEVICE_ADDRESS in make target.

So once BD address gets generated, it will be fixed forever, until we change it by doing reprogramming.

Thanks,

Rakesh

0 Likes

Hi Dheeraj,

After we have reprogrammed the client device and to get the random client BD address which should never change even after restarting/rebooting the client device, we are following below settings:

1. Editing in make target with BT_DEVICE_ADDRESS=FFFFFFFFFFFF

2. Configuring WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE in the wiced_bt_cfg.c.

With this setting, it is generating random/unique BD address and it will be fixed thereafter, until we change it by doing reprogramming.

We have tested this feature multiple times on client device and giving us correct results.

Please confirm so that we can proceed with above two settings to achieve the use-case.

Rakesh K | Associate Architect​

Kalpita Technologies​

0 Likes

Dheeraj - In addition to answering Rakesh's question above, can you also let us know the methodology that is used to generate the random address?  The concern is that they do not want to have repetition of an address on any of their parts that are going into the field.

0 Likes

Hi,

Kindly check Configuring the Bluetooth device address in CYW20706

I believe, the 3rd method (Using the Factory_Commit_BD_ADDR  VSC (Vendor Specific Command) to store the device address in flash) is the most suitable way to set BD_ADDR in your case.

Please refer BD_ADDR - how do you get one?  to know how to get one BD_ADDR for final product.

Thanks,

-Dheeraj

0 Likes

Hi Dheeraj,

Some queries:

1. Could you tell us how and where we need to put below VSC function?

wiced_bt_dev_vendor_specific_command(0x10, 7, bd_addr_param, addr_callback);

Also could you provide us in which demo project it is used?

Rakesh K | Associate Architect​

Kalpita Technologies​

0 Likes

Hi Dheeraj,

For testing we have used cyBluetool to send Vendor Specific Command to store the device address in flash, but BD address is not storing in flash.

We tried below steps in CyBluetool:

1. send "Reset" HCI reset command.

2. send "Write_BD_ADDR" VSC command.

3. Read "Read_BD_ADDR"

4. Power OFF and ON evaluation board.

5. Read "Read_BD_ADDR"

Our observations/findings:

1. During testing above step 3 and 5 BD_ADDR are not matching. i.e Board is unable to store device BD_ADDR in flash. Please let us know if we are doing something wrong.

2. If we use, wiced_bt_dev_vendor_specific_command in our programs, do it will cause the same issue? Pls Confirm? also let us know how and where to use this command in our programming.

Rakesh K | Associate Architect​

Kalpita Technologies​

0 Likes

Hi Dheeraj,

We are using wiced studio 6.2.1 SDK for performing below operations.

We are not able to proceed further and waiting for your reply early possible.

Rakesh K | Associate Architect​

Kalpita Technologies​

0 Likes
CoreyW_81
Employee
Employee
50 sign-ins 50 replies posted 25 replies posted

Dheeraj - I too have tried to execute the factory_commit_bd_addr method from the command line using wmbt from WICED 6.4 without success:

C:\DEVELOPMENT\WICED-Studio-6.4\wiced_tools\wmbt\Release>.\wmbt.exe reset_highspeed COM6

MBT_BAUD_RATE:  3000000

TRANSPORT_MODE: 0 (HCI)

Opened COM6 at speed: 3000000

Close Serial Bus

Opened COM6 at speed: 3000000

Sending HCI Command:

0000 < 01 03 0C 00 >

Received HCI Event:

0000 < 00 00 00 >

Close Serial Bus

C:\DEVELOPMENT\WICED-Studio-6.4\wiced_tools\wmbt\Release>.\wmbt.exe factory_commit_bd_addr COM6 33221150A000

MBT_BAUD_RATE:  3000000

TRANSPORT_MODE: 0 (HCI)

Opened COM6 at speed: 3000000

Close Serial Bus

Opened COM6 at speed: 3000000

Sending HCI Command:

0000 < 01 10 FC 07 00 A0 50 11 22 33 00 >

Received HCI Event:

0000 < 00 00 00 >

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

Close Serial Bus

I've confirmed that all FF's were used in the make target for the design.

Note that the device on the module is a CYW20719, not a CYW20706.  Is there a different command to commit the address for the CYW20719?

0 Likes

Hi,

The factory_commit_bd_addr  is not working for the the chip for me too. Let me see check what is the issue. Seems like the

There are multiple ways to program and set BD address for the device.

I can suggest you the following two methods for your use case.

1. Using the "BT_DEVICE_ADDRESS"  in the make target while downloading the firmware.

It is possible to automate the download procedure using simple python/perl scripts which replace the BT_DEVICE_ADDRESS value in the download target string.  " >make.exe demo.hello_client-CYW920719Q40EVB_01 BT_DEVICE_ADDRESS=112233445566 download "

2. Using Module programmer. (It supports CYBT-483039-02 module)

Automation is possible. It is helpful when you want to program multiple modules connected to the PC. Please see the guide below.

WICED Module Programmer User Guide – KBA225060

Whereas wiced_bt_set_local_bdaddr() and write_bd_addr HCI commands store the BD_ADDR into the RAM.

Please let me know if you find any difficulty using the above two methods.

Thanks,

-Dheeraj

0 Likes

For #2, I was able to program the bas snip and was able to get WICED Module Programmer to program the application and program the BD_ADDR.  I've verified this with CyBlueTool.  However, when I start the application, I'm still gettting a random address from the module rather than a fixed address.

Here's what I see in CySmart:

Any thoughts?

0 Likes

Hi,

Did you set WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE for rpa_refresh_timeout in the wiced_bt_cfg.c.?

Thanks,

-Dheeraj

Never mind, got it working by using the WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE define in the configuration. 

These are the steps I used to get it working:

1) edited the wiced_app_cfg.c file to change .rpa_refresh_timeout to WICED_BT_CFG_DEFAULT_RANDOM_ADDRESS_NEVER_CHANGE

2) built the application with the flag BT_DEVICE_ADDRESS=00A050AABBCC and programmed

3) Ran the application and saw that 00A050AABBCC was the address being advertised

4) Ran the WICED Module Programmer utility to program in a different address, used 00A050112233

5) Ran the application and saw that 00A050112233 was the address being advertised.

Rakesh - I think this could be a workable solution for your production.

Hi Dheeraj & Corey,

I have tested and its perfectly working. so, we are able to program BD address and it is also increasing every after programming.

I thank Dheeraj and Corey and most importantly, heartfelt kudos!!!

Rakesh K | Associate Architect​

Kalpita Technologies​