Set Bluetooth LE device id (public type) on STM32WBA55 #95131
-
I am looking at the hci_stm32wba.c and hci_core.c sources and I was wondering how and if it is possible to set a public (purchased from IEEE) device id on the STM32WBA55 device. @asm5878 do you have any idea? I've seen that you are a contributor to the hci_stm32wba.c source and I've seen #75176 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello @ivanwagner, your point is valid and we have already started to find a solution. For all STM32WBAX series a public address can be assigned during the initialization of the ble HCI controller. Clearly you can modify the bt_get_ble_add function in order to use the address you want. But an address stored in flash (and in any case retrieved during the initialization) could be a better solution. By the way I will check if a standard approach is already present Zephyr. |
Beta Was this translation helpful? Give feedback.
-
After quick check it seems that this problem could be addressed directly at application level. #include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/kernel.h>
void main(void)
{
// Define your IEEE public BLE address (replace with your own)
bt_addr_le_t my_addr = {
.type = BT_ADDR_LE_PUBLIC,
.a = { {0xC0, 0x98, 0xE5, 0x00, 0x00, 0x01} }
};
// Create a new BLE identity with the specified public address
int id = bt_id_create(&my_addr, NULL);
if (id < 0) {
printk("Failed to set BLE address\n");
return;
}
// Enable the Bluetooth stack
if (bt_enable(NULL)) {
printk("Failed to enable BLE stack\n");
return;
}
printk("BLE address set and stack enabled!\n");
// ... rest of your application code
} clearly the address can be retrieved from a specific otp/flash region. |
Beta Was this translation helpful? Give feedback.
After quick check it seems that this problem could be addressed directly at application level.
For instance: