Changing BLE address through Program in PSoC 4 BLE

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

cross mob
MKN_4249821
Level 2
Level 2

Hi,

I am trying out "Mesh Flood Direct" example on PSoC 4 BLE 256Kb device. I got the example from github.

I modified the code and executed on CY8C4248LQI-BL583 module. When I assigned node address from CySmart windows application I got message like flash operation successful. But Device address didn't get change.

I have changed the following lines of code for 256KB device.

#define USER_SFLASH_ROW_SIZE            (256u)

#define USER_SFLASH_ROWS                (4u)        /* Total number of user SFlash rows supported by the device */

#define USER_SFLASH_BASE_ADDRESS        (0x0FFFF400u)      /* Starting address of user SFlash row for 256KB PSoC 4 BLE device */       

So, My question is about node address.

> Does device address changes if we assign node address or it just gets stored in SuperVisory Flash?

> Is Node address and BLE physical address(address while advertising) same?

> Can we change BLE physical address through application?

Please help me on this as soon as possible.

Thanks,

MKN

0 Likes
1 Solution

Hello,

Public Device Addresses are comprised of a 24-bit company ID and a 24-bit company-assigned number (unique for each device). Public Device Addresses do not change over time.

Random Device Address is a randomly generated address which is classified into two types, Static Random Address and Private Random Address. Please refer to the section 7.2.1 Bluetooth Address Types in the datasheet for more information.

Every Privacy-enabled BLE device has a unique address called the Identity Address. The Identity Address is the Public Address or Static Address of the BLE device. This Identity address is used for resolving the private address of a device.


If you write the first 6 bytes(non-zero values) of ROW0 in SFLASH (with 0x00 as byte 7 in ROW0) using CySysSFlashWriteUserRow() API, then the device will take the BLE address as public address.

Please refer to the KBA Setting Bluetooth Device Address – KBA211407  for more information.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
3 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

The changes of above lines of code for 256KB device are fine.

> Does device address changes if we assign node address or it just gets stored in SuperVisory Flash?
Ans: Device address won't changes if you assign the node address. Device address and node address are different, node ddress allows the data to be sent to a particular node of the network or broadcast it to all nodes in the network. Please refer to the page 13 in this datasheet for more information.

> Is Node address and BLE physical address(address while advertising) same?
Ans: No. BLE physical address and Node address are different. The two bytes of the node address will refer to a particular kit(Node) where data can be sent over mesh network. Please refer to the page 13 (Point20) in this datasheet for more information.

> Can we change BLE physical address through application?
Ans: Yes, you can change the BLE physical address through application using CyBle_SetDeviceAddress() API. This function sets the Bluetooth device address into BLE Stack's memory. User should call 'CyBle_GapSetIdAddress' API function to set identity address if 'CyBle_SetDeviceAddress'API function is used to set public or random static address.

SFlash in PSoC 4 BLE and PRoC BLE devices contains 4 user configurable rows that the application can use for storing Bluetooth device address. Ble Device Address can be changed by writing non-zero values of first 6 bytes of Row0 in SFlash using CySysSFlashWriteUserRow(0,row) API. Byte 7 will define the address type of the address. Please refer to the Day029_BLE_SFlash_Write for reference.

Thanks,
P Yugandhar.
      

0 Likes

Hi Yugandhar,

Thanks for solving my querries.

I have few more querries.

1. What is the difference between "Public Device Address" and "Random Device Address"? 

2. What is the Identity address?

3. Which address will change if execute CySysSFlashWriteUserRow(0,row)?

Thanks,

MKN

0 Likes

Hello,

Public Device Addresses are comprised of a 24-bit company ID and a 24-bit company-assigned number (unique for each device). Public Device Addresses do not change over time.

Random Device Address is a randomly generated address which is classified into two types, Static Random Address and Private Random Address. Please refer to the section 7.2.1 Bluetooth Address Types in the datasheet for more information.

Every Privacy-enabled BLE device has a unique address called the Identity Address. The Identity Address is the Public Address or Static Address of the BLE device. This Identity address is used for resolving the private address of a device.


If you write the first 6 bytes(non-zero values) of ROW0 in SFLASH (with 0x00 as byte 7 in ROW0) using CySysSFlashWriteUserRow() API, then the device will take the BLE address as public address.

Please refer to the KBA Setting Bluetooth Device Address – KBA211407  for more information.

Thanks,
P Yugandhar.

0 Likes