- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem I have is I see a different mac address show up once in a while if I don’t follow a specific procedure. The different mac address is the default from the ble component checkbox. I turned that off and still see it once in a while. Here is the way I set the mac address -
- Write the mac address to userflash row 0 status = CySysSFlashWriteUserRow(0, &data[0]);
- Set device address CyBle_SetDeviceAddress(&cyBle_deviceAddress);//CYBLE_GAP_BD_ADDR_T
- Set gapid address CyBle_GapSetIdAddress(&cyBle_deviceAddress);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please refer to the KBA link for setting the Bluetooth device address using PSoC4-BLE-SFLASH-Update.exe tool Setting Bluetooth Device Address – KBA211407 .
Could you please share your project so that we can check at our end ?
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is some additional information -
Here is a question on setting MAC addresses and advertising name. The problem I have is I see a different mac address show up once in a while if I don’t follow this procedure.
- 1. Program the chip.
- 2. Set the antenna id. fwb>setant
- 3. Set the mac. fwb>setmac
- 4. Reboot
I only see it every 1 of 10 times if I just try to set the ant id or mac without starting from a fresh burn. Here is what it looks like –
Advertising Name - TH-3000 00171af0aa3a
FWB>> Compile Date and Time : Oct 8 2019 09:09:07
Bootloader Version 01.02.20
App Version 01.11.47
Advertising Name - TH-3000 00171af0aa3a
Low Power Mode : DISABLED
Flow Control : DISABLED
BootLoader Bluetooth On, StartAdvertisement - 00a05084934a
Bootloader Version 01.02.20
Application Version 01.11.47
Passkey 0l
Here is what I do to set the mac address and advertising name.
- Write the mac address to userflash row 0 status = CySysSFlashWriteUserRow(0, &data[0]);
- Set device address CyBle_SetDeviceAddress(&cyBle_deviceAddress);//CYBLE_GAP_BD_ADDR_T
- Set gapid address CyBle_GapSetIdAddress(&cyBle_deviceAddress);
- Add the model name with the mac address to make an advertising name using this CyBle_GapSetLocalName(Advertising_Name1);
- Save the name to row 3 status = CySysSFlashWriteUserRow(3, &readdata[0]);
So when the program starts and advertises –
- Reads the advertising name from row 3 and sets it with this call. CyBle_GapSetLocalName(Advertising_Name1)
This printout BootLoader Bluetooth On, StartAdvertisement - 00a05084934a uses call
- localAddr.type = 0u;
CyBle_GetDeviceAddress(&localAddr);
for(i = CYBLE_GAP_BD_ADDR_SIZE; i > 0; i--)
{
printf("%2.2x", localAddr.bdAddr[i-1]);
}
printf("\r\n");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding some clarity. When the wrong mac is retrieved from the stack, it is from the stack. Row0 is where the mac address is assigned and did not change. I have proven that -
1. Row 0 is the mac address I want.
2. Stored it correctly.
3. Upon reboot the cypress default mac address is selected by the stack instead of the one I assigned in row 0. Looking for some switch in the stack the selects either the default mac or the one assigned in row 0.
4. This problem will not happen in the field but just need to make sure I am setting the mac address correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding more information -
I see no errors for CyBle_SetDeviceAddress CyBle_GapSetIdAddress.
But upon reboot I see the “default address”.
I connected with the debugger and see that default address in cyBle_deviceAddress.
I set a breakpoint in the setmac to see the memory after CyBle_SetDeviceAddress CyBle_GapSetIdAddress.
When I re-entered there were 0s past the address and everything went fine.
So I can’t tell which of those 2 calls need all 0s but one does.
I also saw in the header file that CyBle_GapSetIdAddress was going to be obsoleted. Maybe related. Who knows.
Entered MAC Address 00171af0aa3a
Write MAC Address
SetDevice 0
GapSetId 0
MAC Address is - 00171af0aa3a
Advertising Name - TH-1000 00171af0aa3a
FWB>> Compile Date and Time : Nov 13 2019 14:05:18
Bootloader Version 01.02.20
App Version 01.11.49
Advertising Name - TH-1000 00171af0aa3a
Low Power Mode : DISABLED
Flow Control : DISABLED
BootLoader Bluetooth On, StartAdvertisement - 00a050000000
Bootloader Version 01.02.20
Application Version 01.11.49
Passkey 0l
> Compile Date and Time : Nov 13 2019 14:05:18
Bootloader Version 01.02.20
App Version 01.11.49
Advertising Name - TH-1000 00171af0aa3a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please refer to the KBA link for setting the Bluetooth device address using PSoC4-BLE-SFLASH-Update.exe tool Setting Bluetooth Device Address – KBA211407 .
Could you please share your project so that we can check at our end ?
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content