how to store the defined device address in flash

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

cross mob
YaTr_3516311
Level 5
Level 5
25 sign-ins First solution authored 100 replies posted

Hi,

1. I want to realize "store the defined device address in flash". I have watch the linkConfiguring the Bluetooth device address in CYW20706 .

There is "First, set the device address to all 0xFFs by making use of the BT_DEVICE_ADDRESS=FFFFFFFFFFFF in the make target and download your application." step. How can I realize the "BT_DEVICE_ADDRESS=FFFFFFFFFFFF in the make target and download your application" function in my code? Because above step should use WICED-Studio make target, if  FW upgrade is thourgh OTA(Not WICED-Studio tool), there is no tool.

2. For when to set wiced_bt_set_local_bdaddr which disscussed in link https://community.cypress.com/thread/48118

I know Call wiced_bt_set_local_bdaddr() after stack initialization. I call wiced_bt_set_local_bdaddr() when uart receive my needed set MAC address(This step is analyze recived data then parse then set, it is done in the code runtime). Then wiced_bt_dev_read_local_addr(bda), it is changed. But after reset device, my setted address come back to the old MAC. Can you understand my meanning?

0 Likes
1 Solution

Hi Yao Treacy,

You may have to write the BD address received through UART to NV section of memory. And read the saved BD_ADDR and set it as device local BD_ADDR whenever the board reset or application starts.

Could you please try this logic using the APIs wiced_hal_read_nvram, wiced_hal_write_nvram, wiced_bt_set_local_bdaddr

Thanks,

-Dheeraj

View solution in original post

0 Likes
2 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi YaTr_3516311

1. You have to set BT_DEVICE_ADDRESS=FFFFFFFFFFFF and generate the .hex using the SDK and do OTA upgrade with the generated .hex file.

2. I am checking this. I will get back to you with a solution which you can use to set address permanently using the NV memory. 

Thanks,

-Dheeraj

Hi Yao Treacy,

You may have to write the BD address received through UART to NV section of memory. And read the saved BD_ADDR and set it as device local BD_ADDR whenever the board reset or application starts.

Could you please try this logic using the APIs wiced_hal_read_nvram, wiced_hal_write_nvram, wiced_bt_set_local_bdaddr

Thanks,

-Dheeraj

0 Likes